From f670508774c35b585b520fa9217d156664b4cb2a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 19 Feb 2021 03:01:02 +0000 Subject: CTAN sync 202102190301 --- macros/latex/contrib/l3backend/CHANGELOG.md | 11 +- macros/latex/contrib/l3backend/README.md | 2 +- .../latex/contrib/l3backend/l3backend-basics.dtx | 14 +- macros/latex/contrib/l3backend/l3backend-box.dtx | 2 +- macros/latex/contrib/l3backend/l3backend-code.pdf | Bin 805972 -> 805668 bytes macros/latex/contrib/l3backend/l3backend-color.dtx | 72 +- macros/latex/contrib/l3backend/l3backend-draw.dtx | 2 +- .../latex/contrib/l3backend/l3backend-graphics.dtx | 2 +- .../latex/contrib/l3backend/l3backend-header.dtx | 2 +- .../latex/contrib/l3backend/l3backend-opacity.dtx | 8 +- macros/latex/contrib/l3backend/l3backend-pdf.dtx | 2 +- macros/latex/contrib/l3experimental/CHANGELOG.md | 9 +- macros/latex/contrib/l3experimental/README.md | 14 +- .../latex/contrib/l3experimental/l3benchmark.dtx | 4 +- .../latex/contrib/l3experimental/l3benchmark.pdf | Bin 314447 -> 314359 bytes macros/latex/contrib/l3experimental/l3bitset.dtx | 4 +- macros/latex/contrib/l3experimental/l3bitset.pdf | Bin 382530 -> 382437 bytes macros/latex/contrib/l3experimental/l3color.dtx | 2553 ----------------- macros/latex/contrib/l3experimental/l3color.ins | 58 - macros/latex/contrib/l3experimental/l3color.pdf | Bin 369039 -> 0 bytes .../latex/contrib/l3experimental/l3draw-boxes.dtx | 2 +- .../latex/contrib/l3experimental/l3draw-code.pdf | Bin 606904 -> 607244 bytes .../latex/contrib/l3experimental/l3draw-layers.dtx | 2 +- .../latex/contrib/l3experimental/l3draw-paths.dtx | 2 +- .../latex/contrib/l3experimental/l3draw-points.dtx | 2 +- .../latex/contrib/l3experimental/l3draw-scopes.dtx | 2 +- .../contrib/l3experimental/l3draw-softpath.dtx | 2 +- .../latex/contrib/l3experimental/l3draw-state.dtx | 2 +- .../contrib/l3experimental/l3draw-transforms.dtx | 2 +- macros/latex/contrib/l3experimental/l3draw.dtx | 18 +- macros/latex/contrib/l3experimental/l3draw.pdf | Bin 490075 -> 489992 bytes macros/latex/contrib/l3experimental/l3galley.dtx | 4 +- macros/latex/contrib/l3experimental/l3galley.pdf | Bin 386004 -> 385907 bytes macros/latex/contrib/l3experimental/l3graphics.dtx | 4 +- macros/latex/contrib/l3experimental/l3graphics.pdf | Bin 363302 -> 363213 bytes macros/latex/contrib/l3experimental/l3pdf-code.pdf | Bin 279001 -> 0 bytes macros/latex/contrib/l3experimental/l3pdf-code.tex | 56 - macros/latex/contrib/l3experimental/l3pdf.dtx | 442 --- macros/latex/contrib/l3experimental/l3pdf.ins | 60 - macros/latex/contrib/l3experimental/l3pdf.pdf | Bin 377364 -> 0 bytes .../latex/contrib/l3experimental/l3str-format.dtx | 4 +- .../latex/contrib/l3experimental/l3str-format.pdf | Bin 345158 -> 345067 bytes .../latex/contrib/l3experimental/l3sys-shell.dtx | 4 +- .../latex/contrib/l3experimental/l3sys-shell.pdf | Bin 311867 -> 311776 bytes macros/latex/contrib/l3experimental/xcoffins.dtx | 4 +- macros/latex/contrib/l3experimental/xcoffins.pdf | Bin 373136 -> 373064 bytes macros/latex/contrib/l3experimental/xgalley.dtx | 4 +- macros/latex/contrib/l3experimental/xgalley.pdf | Bin 285978 -> 285883 bytes macros/latex/contrib/l3kernel/CHANGELOG.md | 52 +- macros/latex/contrib/l3kernel/README.md | 2 +- macros/latex/contrib/l3kernel/expl3.dtx | 4 +- macros/latex/contrib/l3kernel/expl3.pdf | Bin 590739 -> 590636 bytes macros/latex/contrib/l3kernel/interface3.pdf | Bin 1575865 -> 1608206 bytes macros/latex/contrib/l3kernel/interface3.tex | 4 +- macros/latex/contrib/l3kernel/l3.ins | 3 +- macros/latex/contrib/l3kernel/l3basics.dtx | 2 +- macros/latex/contrib/l3kernel/l3bootstrap.dtx | 2 +- macros/latex/contrib/l3kernel/l3box.dtx | 2 +- macros/latex/contrib/l3kernel/l3candidates.dtx | 32 +- macros/latex/contrib/l3kernel/l3cctab.dtx | 2 +- macros/latex/contrib/l3kernel/l3clist.dtx | 2 +- macros/latex/contrib/l3kernel/l3coffins.dtx | 38 +- macros/latex/contrib/l3kernel/l3color-base.dtx | 183 -- macros/latex/contrib/l3kernel/l3color.dtx | 2655 ++++++++++++++++++ macros/latex/contrib/l3kernel/l3debug.dtx | 2 +- macros/latex/contrib/l3kernel/l3deprecation.dtx | 2 +- macros/latex/contrib/l3kernel/l3doc.dtx | 2 +- macros/latex/contrib/l3kernel/l3docstrip.dtx | 2 +- macros/latex/contrib/l3kernel/l3docstrip.pdf | Bin 263501 -> 263408 bytes macros/latex/contrib/l3kernel/l3expan.dtx | 2 +- macros/latex/contrib/l3kernel/l3file.dtx | 2 +- macros/latex/contrib/l3kernel/l3flag.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-assign.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-aux.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-basics.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-convert.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-expo.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-extended.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-logic.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-parse.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-random.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-round.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-traps.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp-trig.dtx | 2 +- macros/latex/contrib/l3kernel/l3fp.dtx | 2 +- macros/latex/contrib/l3kernel/l3fparray.dtx | 2 +- macros/latex/contrib/l3kernel/l3int.dtx | 2 +- macros/latex/contrib/l3kernel/l3intarray.dtx | 2 +- .../latex/contrib/l3kernel/l3kernel-functions.dtx | 2 +- macros/latex/contrib/l3kernel/l3keys.dtx | 2 +- macros/latex/contrib/l3kernel/l3legacy.dtx | 2 +- macros/latex/contrib/l3kernel/l3luatex.dtx | 2 +- macros/latex/contrib/l3kernel/l3msg.dtx | 30 +- macros/latex/contrib/l3kernel/l3names.dtx | 2 +- macros/latex/contrib/l3kernel/l3news.pdf | Bin 380237 -> 380237 bytes macros/latex/contrib/l3kernel/l3news01.pdf | Bin 113669 -> 113669 bytes macros/latex/contrib/l3kernel/l3news02.pdf | Bin 140944 -> 140944 bytes macros/latex/contrib/l3kernel/l3news03.pdf | Bin 138141 -> 138141 bytes macros/latex/contrib/l3kernel/l3news04.pdf | Bin 107188 -> 107188 bytes macros/latex/contrib/l3kernel/l3news05.pdf | Bin 105169 -> 105169 bytes macros/latex/contrib/l3kernel/l3news06.pdf | Bin 140971 -> 140971 bytes macros/latex/contrib/l3kernel/l3news07.pdf | Bin 119190 -> 119190 bytes macros/latex/contrib/l3kernel/l3news08.pdf | Bin 152604 -> 152604 bytes macros/latex/contrib/l3kernel/l3news09.pdf | Bin 236052 -> 236052 bytes macros/latex/contrib/l3kernel/l3news10.pdf | Bin 140521 -> 140521 bytes macros/latex/contrib/l3kernel/l3news11.pdf | Bin 159391 -> 159391 bytes macros/latex/contrib/l3kernel/l3news12.pdf | Bin 192710 -> 192710 bytes macros/latex/contrib/l3kernel/l3pdf.dtx | 458 ++++ macros/latex/contrib/l3kernel/l3prefixes.csv | 1 + macros/latex/contrib/l3kernel/l3prefixes.pdf | Bin 75619 -> 75605 bytes macros/latex/contrib/l3kernel/l3prg.dtx | 2 +- macros/latex/contrib/l3kernel/l3prop.dtx | 2 +- macros/latex/contrib/l3kernel/l3quark.dtx | 2 +- macros/latex/contrib/l3kernel/l3regex.dtx | 9 +- macros/latex/contrib/l3kernel/l3seq.dtx | 2 +- macros/latex/contrib/l3kernel/l3skip.dtx | 2 +- macros/latex/contrib/l3kernel/l3sort.dtx | 2 +- macros/latex/contrib/l3kernel/l3str-convert.dtx | 15 +- macros/latex/contrib/l3kernel/l3str.dtx | 2 +- macros/latex/contrib/l3kernel/l3styleguide.pdf | Bin 280295 -> 280201 bytes macros/latex/contrib/l3kernel/l3styleguide.tex | 2 +- macros/latex/contrib/l3kernel/l3syntax-changes.pdf | Bin 228483 -> 228390 bytes macros/latex/contrib/l3kernel/l3syntax-changes.tex | 2 +- macros/latex/contrib/l3kernel/l3sys.dtx | 2 +- macros/latex/contrib/l3kernel/l3term-glossary.pdf | Bin 217942 -> 217846 bytes macros/latex/contrib/l3kernel/l3term-glossary.tex | 2 +- macros/latex/contrib/l3kernel/l3text-case.dtx | 2 +- macros/latex/contrib/l3kernel/l3text-purify.dtx | 2 +- macros/latex/contrib/l3kernel/l3text.dtx | 4 +- macros/latex/contrib/l3kernel/l3tl-analysis.dtx | 2 +- macros/latex/contrib/l3kernel/l3tl.dtx | 2 +- macros/latex/contrib/l3kernel/l3token.dtx | 2 +- macros/latex/contrib/l3kernel/l3unicode.dtx | 2 +- macros/latex/contrib/l3kernel/source3.pdf | Bin 5998896 -> 6160884 bytes macros/latex/contrib/l3kernel/source3.tex | 2 +- macros/latex/contrib/l3kernel/source3body.tex | 163 +- macros/latex/contrib/luacolor/luacolor.dtx | 53 +- macros/latex/contrib/luacolor/luacolor.pdf | Bin 322070 -> 329760 bytes macros/latex/contrib/lwarp/README.txt | 4 +- macros/latex/contrib/lwarp/lwarp.dtx | 2873 ++++++++++++++++---- macros/latex/contrib/lwarp/lwarp.ins | 15 + macros/latex/contrib/lwarp/lwarp.pdf | Bin 3023923 -> 3153568 bytes macros/latex/contrib/lwarp/lwarpmk.lua | 4 +- 143 files changed, 5955 insertions(+), 4124 deletions(-) delete mode 100644 macros/latex/contrib/l3experimental/l3color.dtx delete mode 100644 macros/latex/contrib/l3experimental/l3color.ins delete mode 100644 macros/latex/contrib/l3experimental/l3color.pdf delete mode 100644 macros/latex/contrib/l3experimental/l3pdf-code.pdf delete mode 100644 macros/latex/contrib/l3experimental/l3pdf-code.tex delete mode 100644 macros/latex/contrib/l3experimental/l3pdf.dtx delete mode 100644 macros/latex/contrib/l3experimental/l3pdf.ins delete mode 100644 macros/latex/contrib/l3experimental/l3pdf.pdf delete mode 100644 macros/latex/contrib/l3kernel/l3color-base.dtx create mode 100644 macros/latex/contrib/l3kernel/l3color.dtx create mode 100644 macros/latex/contrib/l3kernel/l3pdf.dtx (limited to 'macros/latex/contrib') diff --git a/macros/latex/contrib/l3backend/CHANGELOG.md b/macros/latex/contrib/l3backend/CHANGELOG.md index b04d1fd195..f787acd709 100644 --- a/macros/latex/contrib/l3backend/CHANGELOG.md +++ b/macros/latex/contrib/l3backend/CHANGELOG.md @@ -6,6 +6,14 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-02-18] + +### Changed +- Update tracking of PDF management functions + +### Fixed +- Opacity support for pdfTeX/LuaTeX + ## [2021-02-06] ### Changed @@ -151,7 +159,8 @@ this project uses date-based 'snapshot' version identifiers. - Include `l3backend` in file names - Moved backend code to internal for each 'parent' module -[Unreleased]: https://github.com/latex3/latex3/compare/2021-02-06...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2021-02-18...HEAD +[2021-02-18]: https://github.com/latex3/latex3/compare/2021-02-06...2021-02-18 [2021-02-06]: https://github.com/latex3/latex3/compare/2021-01-29...2021-02-06 [2021-01-29]: https://github.com/latex3/latex3/compare/2021-01-09...2021-01-29 [2021-01-09]: https://github.com/latex3/latex3/compare/2020-09-24...2021-01-09 diff --git a/macros/latex/contrib/l3backend/README.md b/macros/latex/contrib/l3backend/README.md index 07d6aadd6a..02118d1218 100644 --- a/macros/latex/contrib/l3backend/README.md +++ b/macros/latex/contrib/l3backend/README.md @@ -1,7 +1,7 @@ LaTeX3 Backend Drivers ====================== -Release 2021-02-06 +Release 2021-02-18 This package forms parts of `expl3`, and contains the code used to interface with backends (drivers) across the `expl3` codebase. The functions here are diff --git a/macros/latex/contrib/l3backend/l3backend-basics.dtx b/macros/latex/contrib/l3backend/l3backend-basics.dtx index 80504ebf03..b7f09e7dbd 100644 --- a/macros/latex/contrib/l3backend/l3backend-basics.dtx +++ b/macros/latex/contrib/l3backend/l3backend-basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -70,27 +70,27 @@ % \begin{macrocode} \ProvidesExplFile %<*dvipdfmx> - {l3backend-dvipdfmx.def}{2021-02-06}{} + {l3backend-dvipdfmx.def}{2021-02-18}{} {L3 backend support: dvipdfmx} % %<*dvips> - {l3backend-dvips.def}{2021-02-06}{} + {l3backend-dvips.def}{2021-02-18}{} {L3 backend support: dvips} % %<*dvisvgm> - {l3backend-dvisvgm.def}{2021-02-06}{} + {l3backend-dvisvgm.def}{2021-02-18}{} {L3 backend support: dvisvgm} % %<*luatex> - {l3backend-luatex.def}{2021-02-06}{} + {l3backend-luatex.def}{2021-02-18}{} {L3 backend support: PDF output (LuaTeX)} % %<*pdftex> - {l3backend-pdftex.def}{2021-02-06}{} + {l3backend-pdftex.def}{2021-02-18}{} {L3 backend support: PDF output (pdfTeX)} % %<*xetex> - {l3backend-xetex.def}{2021-02-06}{} + {l3backend-xetex.def}{2021-02-18}{} {L3 backend support: XeTeX} % % \end{macrocode} diff --git a/macros/latex/contrib/l3backend/l3backend-box.dtx b/macros/latex/contrib/l3backend/l3backend-box.dtx index f6268a776c..bc0a3ffdd5 100644 --- a/macros/latex/contrib/l3backend/l3backend-box.dtx +++ b/macros/latex/contrib/l3backend/l3backend-box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3backend/l3backend-code.pdf b/macros/latex/contrib/l3backend/l3backend-code.pdf index c6f39549e5..a70f304b62 100644 Binary files a/macros/latex/contrib/l3backend/l3backend-code.pdf and b/macros/latex/contrib/l3backend/l3backend-code.pdf differ diff --git a/macros/latex/contrib/l3backend/l3backend-color.dtx b/macros/latex/contrib/l3backend/l3backend-color.dtx index 9373df677d..451a0039a5 100644 --- a/macros/latex/contrib/l3backend/l3backend-color.dtx +++ b/macros/latex/contrib/l3backend/l3backend-color.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -241,13 +241,13 @@ % \end{variable} % \end{macro} % -% \begin{macro}{\@@_backend_stack_push:nn, \@@_backend_stack_push:nx} -% \begin{macro}{\@@_backend_stack_pop:n} +% \begin{macro}{\__kernel_color_backend_stack_push:nn, \__kernel_color_backend_stack_push:nx} +% \begin{macro}{\__kernel_color_backend_stack_pop:n} % Simple enough but needs a version check. % \begin{macrocode} \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 } { - \cs_new_protected:Npn \@@_backend_stack_push:nn #1#2 + \cs_new_protected:Npn \__kernel_color_backend_stack_push:nn #1#2 { \__kernel_backend_literal:x { @@ -256,8 +256,8 @@ push ~ (#2) } } - \cs_generate_variant:Nn \@@_backend_stack_push:nn { nx } - \cs_new_protected:Npn \@@_backend_stack_pop:n #1 + \cs_generate_variant:Nn \__kernel_color_backend_stack_push:nn { nx } + \cs_new_protected:Npn \__kernel_color_backend_stack_pop:n #1 { \__kernel_backend_literal:x { @@ -300,10 +300,10 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_backend_stack_push:nn, \@@_backend_stack_push:nx} -% \begin{macro}{\@@_backend_stack_pop:n} +% \begin{macro}{\__kernel_color_backend_stack_push:nn, \__kernel_color_backend_stack_push:nx} +% \begin{macro}{\__kernel_color_backend_stack_pop:n} % \begin{macrocode} -\cs_new_protected:Npn \@@_backend_stack_push:nn #1#2 +\cs_new_protected:Npn \__kernel_color_backend_stack_push:nn #1#2 { %<*luatex> \tex_pdfextension:D colorstack ~ @@ -313,8 +313,8 @@ % \int_eval:n {#1} ~ push ~ {#2} } -\cs_generate_variant:Nn \@@_backend_stack_push:nn { nx } -\cs_new_protected:Npn \@@_backend_stack_pop:n #1 +\cs_generate_variant:Nn \__kernel_color_backend_stack_push:nn { nx } +\cs_new_protected:Npn \__kernel_color_backend_stack_pop:n #1 { %<*luatex> \tex_pdfextension:D colorstack ~ @@ -410,11 +410,11 @@ { \tl_set:Nn \l_@@_backend_fill_tl {#1} \tl_set:Nn \l_@@_backend_stroke_tl {#2} - \@@_backend_stack_push:nn \l_@@_backend_stack_int { #1 ~ #2 } + \__kernel_color_backend_stack_push:nn \l_@@_backend_stack_int { #1 ~ #2 } \group_insert_after:N \@@_backend_reset: } \cs_new_protected:Npn \@@_backend_reset: - { \@@_backend_stack_pop:n \l_@@_backend_stack_int } + { \__kernel_color_backend_stack_pop:n \l_@@_backend_stack_int } % \end{macrocode} % \end{macro} % \end{macro} @@ -790,7 +790,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5 { - \pdf_object_now:nx { dict } + \pdf_object_unnamed_write:nx { dict } { /FunctionType ~ 2 /Domain ~ [0 ~ 1] @@ -802,21 +802,22 @@ { /Separation ~ / \str_convert_pdfname:n {#1} ~ #2 ~ - \pdf_object_last: + \pdf_object_ref_last: } - \use:x + \cs_if_exist:NT \pdfmanagement_add:nnn { - \pdfmanagement_add:nnn - { Page / Resources / ColorSpace } - { color \int_use:N \g_@@_model_int } - { \pdf_object_last: } + \use:x + { + \pdfmanagement_add:nnn + { Page / Resources / ColorSpace } + { color \int_use:N \g_@@_model_int } + { \pdf_object_ref_last: } + } } } -\cs_if_exist:NF \pdf_object_now:nn - { \cs_gset_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5 { } } \cs_new_protected:Npn \@@_backend_separation_init:n #1 { - \pdf_object_now:nx { array } {#1} + \pdf_object_unnamed_write:nx { array } {#1} } % \end{macrocode} % For CIELAB colors, we need one object per document for the illuminant, @@ -844,7 +845,7 @@ { 100 ~ 0 ~ 0 } {#3} } -\cs_if_exist:NF \pdf_object_now:nn +\cs_if_exist:NF \pdf_object_unnamed_write:nn { \cs_gset_protected:Npn \@@_backend_separation_init_CIELAB:nnn #1#2#3 { } @@ -862,7 +863,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_backend_devicen_init:nnn #1#2#3 { - \pdf_object_now:nx { stream } + \pdf_object_unnamed_write:nx { stream } { { /FunctionType ~ 4 ~ @@ -889,18 +890,19 @@ /DeviceN ~ [ ~ #1 ~ ] ~ #2 ~ - \pdf_object_last: + \pdf_object_ref_last: } - \use:x + \cs_if_exist:NT \pdfmanagement_add:nnn { - \pdfmanagement_add:nnn - { Page / Resources / ColorSpace } - { color \int_use:N \g_@@_model_int } - { \pdf_object_last: } + \use:x + { + \pdfmanagement_add:nnn + { Page / Resources / ColorSpace } + { color \int_use:N \g_@@_model_int } + { \pdf_object_ref_last: } + } } } -\cs_if_exist:NF \pdf_object_now:nn - { \cs_gset_protected:Npn \@@_backend_devicen_init:nnn #1#2#3 { } } \cs_new:Npn \@@_backend_devicen_init:w #1 ~ #2 \s_@@_stop { + 1 @@ -976,7 +978,7 @@ \cs_new_protected:Npn \@@_backend_fill:n #1 { \tl_set:Nn \l_@@_backend_fill_tl {#1} - \@@_backend_stack_push:nn \l_@@_backend_stack_int + \__kernel_color_backend_stack_push:nn \l_@@_backend_stack_int { #1 ~ \l_@@_backend_stroke_tl } \group_insert_after:N \@@_backend_reset: } @@ -989,7 +991,7 @@ \cs_new_protected:Npn \@@_backend_stroke:n #1 { \tl_set:Nn \l_@@_backend_stroke_tl {#1} - \@@_backend_stack_push:nn \l_@@_backend_stack_int + \__kernel_color_backend_stack_push:nn \l_@@_backend_stack_int { \l_@@_backend_fill_tl \c_space_tl #1 } \group_insert_after:N \@@_backend_reset: } diff --git a/macros/latex/contrib/l3backend/l3backend-draw.dtx b/macros/latex/contrib/l3backend/l3backend-draw.dtx index 8602a4da4c..5536391276 100644 --- a/macros/latex/contrib/l3backend/l3backend-draw.dtx +++ b/macros/latex/contrib/l3backend/l3backend-draw.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3backend/l3backend-graphics.dtx b/macros/latex/contrib/l3backend/l3backend-graphics.dtx index 484e5b20b9..c3ec121c07 100644 --- a/macros/latex/contrib/l3backend/l3backend-graphics.dtx +++ b/macros/latex/contrib/l3backend/l3backend-graphics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3backend/l3backend-header.dtx b/macros/latex/contrib/l3backend/l3backend-header.dtx index 77d1d93a26..eafd36f50d 100644 --- a/macros/latex/contrib/l3backend/l3backend-header.dtx +++ b/macros/latex/contrib/l3backend/l3backend-header.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3backend/l3backend-opacity.dtx b/macros/latex/contrib/l3backend/l3backend-opacity.dtx index 06d17b6745..ee4702a3cd 100644 --- a/macros/latex/contrib/l3backend/l3backend-opacity.dtx +++ b/macros/latex/contrib/l3backend/l3backend-opacity.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -151,7 +151,7 @@ \pdfmanagement_add:nnn { Page / Resources / ExtGState } { opacity #1 } { << /ca ~ #1 /CA ~ #1 >> } - \@@_backend_stack_push:nn \c_@@_backend_stack_int + \__kernel_color_backend_stack_push:nn \c_@@_backend_stack_int { /opacity #1 ~ gs } \group_insert_after:N \@@_backend_reset: } @@ -160,7 +160,7 @@ \cs_gset_protected:Npn \@@_backend_select_aux:n #1 { } } \cs_new_protected:Npn \@@_backend_reset: - { \@@_backend_stack_pop:n \c_@@_backend_stack_int } + { \__kernel_color_backend_stack_pop:n \c_@@_backend_stack_int } % \end{macrocode} % \end{macro} % \end{macro} @@ -195,7 +195,7 @@ \pdfmanagement_add:nnn { Page / Resources / ExtGState } { opacity.stroke #1 } { << /CA ~ #2 >> } - \@@_backend_stack_push:nn \c_@@_backend_stack_int + \__kernel_color_backend_stack_push:nn \c_@@_backend_stack_int { /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs } \group_insert_after:N \@@_backend_reset: } diff --git a/macros/latex/contrib/l3backend/l3backend-pdf.dtx b/macros/latex/contrib/l3backend/l3backend-pdf.dtx index dd279399d9..ad2b0d5170 100644 --- a/macros/latex/contrib/l3backend/l3backend-pdf.dtx +++ b/macros/latex/contrib/l3backend/l3backend-pdf.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/CHANGELOG.md b/macros/latex/contrib/l3experimental/CHANGELOG.md index 5c3d6b7d4a..2180a6864b 100644 --- a/macros/latex/contrib/l3experimental/CHANGELOG.md +++ b/macros/latex/contrib/l3experimental/CHANGELOG.md @@ -7,6 +7,12 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-02-18] + +### Removed +- `l3color`: moved to `l3kernel` +- `l3pdf`: moved to `l3kernel` + ## [2021-02-06] ### Changed @@ -195,7 +201,8 @@ this project uses date-based 'snapshot' version identifiers. - New `l3color` module using `xcolor`-like expression syntax - New `l3draw` module, based on `pgf` layer of the TikZ system -[Unreleased]: https://github.com/latex3/latex3/compare/2021-02-06...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2021-02-18...HEAD +[2021-02-18]: https://github.com/latex3/latex3/compare/2021-02-06...2021-02-18 [2021-02-06]: https://github.com/latex3/latex3/compare/2021-01-29...2021-02-06 [2021-01-29]: https://github.com/latex3/latex3/compare/2021-10-27...2021-01-29 [2020-10-27]: https://github.com/latex3/latex3/compare/2020-09-24...2020-10-27 diff --git a/macros/latex/contrib/l3experimental/README.md b/macros/latex/contrib/l3experimental/README.md index 417d53493e..110132faf0 100644 --- a/macros/latex/contrib/l3experimental/README.md +++ b/macros/latex/contrib/l3experimental/README.md @@ -1,7 +1,7 @@ Experimental LaTeX3 Concepts ============================ -Release 2021-02-06 +Release 2021-02-18 Overview -------- @@ -22,7 +22,6 @@ updated at the same time. Currently included in the CTAN release of l3experimental are the following bundles: * `l3benchmark` -* `l3color` * `l3draw` * `l3graphics` * `l3pdf` @@ -36,15 +35,6 @@ bundles: This module provides support for benchmarking the performance of code. - -`l3color` ---------- - -This module provides support for setting colors using a range of color models. -It also allows the construction of 'color expressions', in which multiple colors -are mixed together at the macro level. There is also support for spot colors: -the latter is highly experimental. - `l3draw` -------- @@ -127,7 +117,7 @@ The LaTeX Project ------------------ Development of LaTeX3 is carried out by -[The LaTeX Project](https://www.latex-project.org/latex3/). +[The LaTeX Project](https://www.latex-project.org/latex3/). The development team can be contacted by e-mail: ; for general LaTeX3 discussion diff --git a/macros/latex/contrib/l3experimental/l3benchmark.dtx b/macros/latex/contrib/l3experimental/l3benchmark.dtx index 76f3677781..1771ac2666 100644 --- a/macros/latex/contrib/l3experimental/l3benchmark.dtx +++ b/macros/latex/contrib/l3experimental/l3benchmark.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -129,7 +129,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3benchmark}{2021-02-06}{} +\ProvidesExplPackage{l3benchmark}{2021-02-18}{} {L3 Experimental benchmarking} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3benchmark.pdf b/macros/latex/contrib/l3experimental/l3benchmark.pdf index a788198674..ee7144dba8 100644 Binary files a/macros/latex/contrib/l3experimental/l3benchmark.pdf and b/macros/latex/contrib/l3experimental/l3benchmark.pdf differ diff --git a/macros/latex/contrib/l3experimental/l3bitset.dtx b/macros/latex/contrib/l3experimental/l3bitset.dtx index 7c61b81f83..686df60ccd 100644 --- a/macros/latex/contrib/l3experimental/l3bitset.dtx +++ b/macros/latex/contrib/l3experimental/l3bitset.dtx @@ -42,7 +42,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % \begin{documentation} @@ -264,7 +264,7 @@ %<@@=bitset> % \end{macrocode} % \begin{macrocode} -\ProvidesExplPackage{l3bitset}{2021-02-06}{} +\ProvidesExplPackage{l3bitset}{2021-02-18}{} {L3 Experimental bitset support} % \end{macrocode} % A bitset is a string variable. diff --git a/macros/latex/contrib/l3experimental/l3bitset.pdf b/macros/latex/contrib/l3experimental/l3bitset.pdf index 68490cb185..2c9b2877c2 100644 Binary files a/macros/latex/contrib/l3experimental/l3bitset.pdf and b/macros/latex/contrib/l3experimental/l3bitset.pdf differ diff --git a/macros/latex/contrib/l3experimental/l3color.dtx b/macros/latex/contrib/l3experimental/l3color.dtx deleted file mode 100644 index 0f1b130da8..0000000000 --- a/macros/latex/contrib/l3experimental/l3color.dtx +++ /dev/null @@ -1,2553 +0,0 @@ -% \iffalse meta-comment -% -%% File: l3color.dtx -% -% Copyright (C) 2017-2021 The LaTeX Project -% -% It may be distributed and/or modified under the conditions of the -% LaTeX Project Public License (LPPL), either version 1.3c of this -% license or (at your option) any later version. The latest version -% of this license is in the file -% -% http://www.latex-project.org/lppl.txt -% -% This file is part of the "l3experimental bundle" (The Work in LPPL) -% and all files in that bundle must be distributed together. -% -% ----------------------------------------------------------------------- -% -% The development version of the bundle can be found at -% -% https://github.com/latex3/latex3 -% -% for those people who are interested. -% -%<*driver|package> -\RequirePackage{expl3} -% -%<*driver> -\documentclass[full]{l3doc} -\begin{document} - \DocInput{\jobname.dtx} -\end{document} -% -% \fi -% -% \title{^^A -% The \textsf{l3color} package\\ Experimental color support^^A -% } -% -% \author{^^A -% The \LaTeX{} Project\thanks -% {^^A -% E-mail: -% \href{mailto:latex-team@latex-project.org} -% {latex-team@latex-project.org}^^A -% }^^A -% } -% -% \date{Released 2021-02-06} -% -% \maketitle -% -% \begin{documentation} -% -% \section{Color models} -% -% A color \emph{model} is a way to represent sets of colors. Different models -% are particularly suitable for different output methods, \emph{e.g.}~screen -% or print. Parameter-based models can describe a very large number of unique -% colors, and have a varying number of \emph{axes} which define a color -% space. In contrast, various proprietary models are available which define -% \emph{spot} colors (more formally separations). -% -% Core models are used to pass color information to output; these are -% \enquote{native} to \pkg{l3color}. Core models use real numbers in the range -% $[0,1]$ to represent values. The core models supported here are -% \begin{itemize} -% \item \texttt{gray} Grayscale color, with a single axis running from -% $0$ (fully black) to $1$ (fully white) -% \item \texttt{rgb} Red-green-blue color, with three axes, one for each of -% the components -% \item \texttt{cmyk} Cyan-magenta-yellow-black color, with four axes, one for -% each of the components -% \end{itemize} -% There are also interface models: these are convenient for users but have -% to be manipulated before storing/passing to the backend. Interface models -% are primarily integer-based: see below for more detail. The supported -% interface models are -% \begin{itemize} -% \item \texttt{Gray} Grayscale color, with a single axis running from -% $0$ (fully black) to $15$ (fully white) -% \item \texttt{hsb} Hue-saturation-brightness color, with three axes,all -% real values in the range $[0,1]$ for hue saturation and brightness -% \item \texttt{Hsb} Hue-saturation-brightness color, with three axes, integer -% in the range $[0,360]$ for hue, real values in the range $[0,1]$ for -% saturation and brightness -% \item \texttt{HSB} Hue-saturation-brightness color, with three axes, integers -% in the range $[0,240]$ for hue, saturation and brightness -% \item \texttt{HTML} HTML format representation of RGB color given as a -% single six-digit hexadecimal number -% \item \texttt{RGB} Red-green-blue color, with three axes, one for each of -% the components, values as integers from $0$ to $255$ -% \item \texttt{wave} Light wavelength, a real number in the range -% $380$ to $780$ (nanometres) -% \end{itemize} -% All interface models are internally stored as |rgb|. -% -% To allow parsing of data from \pkg{xcolor}, any leading model up the first -% \texttt{:} will be discarded; the approach of selecting an internal form -% for data is \emph{not} used in \pkg{l3color}. -% -% Additional models may be created to allow mixing of separation colors -% with each other or with those from other models. See -% Section~\ref{l3color:sec:new-models} for more detail of color support -% for additional models. -% -% When color is selected by model, the \meta{values} given are specified as -% a comma-separated list. The length of the list will therefore be determined -% by the detail of the model involved. -% -% Color models (and interconversion) are complex, and more details are given -% in the manual to the \LaTeXe{} \pkg{xcolor} package and in the -% \emph{PostScript Language Reference Manual}, published by Addison--Wesley. -% -% \section{Color expressions} -% -% In addition to allowing specification of color by model and values, -% \pkg{l3color} also supports color expressions. These are created -% by combining one or more color names, with the amount of each specified -% as a percentage. The latter is given between |!| symbols in the expression. -% Thus for example -% \begin{verbatim} -% red!50!green -% \end{verbatim} -% is a mixture of $50\,\%$ red and $50\,\%$ green. A trailing percentage is -% interpreted as implicitly followed by |white|, and so -% \begin{verbatim} -% red!25 -% \end{verbatim} -% specifies $25\,\%$ red mixed with $75\,\%$ white. -% -% Where the models for the mixed colors are different, the model of the first -% color is used. Thus -% \begin{verbatim} -% red!50!cyan -% \end{verbatim} -% will result in a color specification using the |rgb| model, made up of -% $50\,\%$ red and $50\,\%$ of cyan \emph{expressed in \texttt{rgb}}. As color -% model interconversion is not exact. -% -% The one exception to the above is where the first model in an expression is -% |gray|. In this case, the order of mixing is \enquote{swapped} internally, so -% that for example -% \begin{verbatim} -% black!50!red -% \end{verbatim} -% has the same result as -% \begin{verbatim} -% red!50!black -% \end{verbatim} -% (the predefined colors |black| and |white| use the |gray| model). -% -% Where more than two colors are mixed in an expression, evaluation takes place -% in a stepwise fashion. Thus in -% \begin{verbatim} -% cyan!50!magenta!10!yellow -% \end{verbatim} -% the sub-expression -% \begin{verbatim} -% cyan!50!magenta -% \end{verbatim} -% is first evaluated to give an intermediate color specification, before -% the second step -% \begin{verbatim} -% !10!yellow -% \end{verbatim} -% where || represents this transitory calculated value. -% -% Within a color expression, |.| may be used to represent the color active -% for typesetting (the current color). This allows for example -% \begin{verbatim} -% .!50 -% \end{verbatim} -% to mean a mixture of $50\,\%$ of current color with white. -% -% (Color expressions supported here are a subset of those provided by -% the \LaTeXe{} \pkg{xcolor} package. At present, only such features as are -% clearly useful have been added here.) -% -% \section{Named colors} -% -% Color names are stored in a single namespace, which makes them accessible -% as part of color expressions. Whilst they are not reserved in a technical -% sense, the names |black|, |white|, |red|, |green|, |blue|, |cyan|, |magenta| -% and |yellow| have special meaning and should not be redefined. Color names -% should be made up of letters, numbers and spaces only: other characters are -% reserved for use in color expressions. In particular, |.| represents the -% current color at the start of a color expression. -% -% \begin{function}{\color_set:nn} -% \begin{syntax} -% \cs{color_set:nn} \Arg{name} \Arg{color expression} -% \end{syntax} -% Evaluates the \meta{color expression} and stores the resulting -% color specification as the \meta{name}. -% \end{function} -% -% \begin{function}{\color_set:nnn} -% \begin{syntax} -% \cs{color_set:nnn} \Arg{name} \Arg{model(s)} \Arg{value(s)} -% \end{syntax} -% Stores the color specification equivalent to the \meta{model(s)} and -% \meta{values} as the \meta{name}. -% \end{function} -% -% \begin{function}{\color_set_eq:nn} -% \begin{syntax} -% \cs{color_set_eq:nn} \Arg{name1} \Arg{name2} -% \end{syntax} -% Copies the color specification in \meta{name2} to \meta{name1}. The -% special name |.| may be used to represent the current color, allowing -% it to be saved to a name. -% \end{function} -% -% \begin{function}{\color_show:n} -% \begin{syntax} -% \cs{color_show:n} \Arg{name} -% \end{syntax} -% Displays the color specification stored in the \meta{name} on the -% terminal. -% \end{function} -% -% \section{Selecting colors} -% -% General selection of color is safe when split across pages: a stack is -% used to ensure that the correct color is re-selected on the new page. -% -% \begin{function}{\color_select:n} -% \begin{syntax} -% \cs{color_select:n} \Arg{color expression} -% \end{syntax} -% Parses the \meta{color expression} and then activates the resulting -% color specification for typeset material. -% \end{function} -% -% \begin{function}{\color_select:nn} -% \begin{syntax} -% \cs{color_select:nn} \Arg{model(s)} \Arg{value(s)} -% \end{syntax} -% Activates the color specification equivalent to the \meta{model(s)} and -% \meta{value(s)} for typeset material. -% \end{function} -% -% \begin{variable}{\l_color_fixed_model_tl} -% When this is set to a non-empty value, colors will be converted to -% the specified model when they are selected. Note that included images -% and similar are not influenced by this setting. -% \end{variable} -% -% \section{Colors for fills and strokes} -% -% Colors for drawing operations and so forth are split into strokes and fills -% (the latter may also be referred to as non-stroke color). The fill color is -% used for text under normal circumstances. Depending on the backend, stroke -% color may use a \emph{stack}, in which case it exhibits the same page breaking -% behavior as general color. However, \texttt{dvips}/\texttt{dvisvgm} do not -% support this, and so color will need to be contained within a scope, such -% as \cs{draw_begin:}/\cs{draw_end:}. -% -% Note that the \emph{current color} is the fill color, as this is used for -% running text. -% -% \begin{function}{\color_fill:n, \color_stroke:n} -% \begin{syntax} -% \cs{color_fill:n} \Arg{color expression} -% \end{syntax} -% Parses the \meta{color expression} and then activates the resulting -% color specification for filling or stroking. -% \end{function} -% -% \begin{function}{\color_fill:nn, \color_stroke:nn} -% \begin{syntax} -% \cs{color_fill:nn} \Arg{model(s)} \Arg{value(s)} -% \end{syntax} -% Activates the color specification equivalent to the \meta{model(s)} and -% \meta{value(s)} for filling or stroking. -% \end{function} -% -% \begin{variable}{color.sc} -% When using \texttt{dvips}, this PostScript variables hold the stroke color. -% \end{variable} -% -% \section{Multiple color models} -% -% When selecting or setting a color with an explicit model, it is possible -% to give values for more than one model at one time. This is particularly -% useful where automated conversion between models does not give the desired -% outcome. To do this, the list of models and list of values are both subdivided -% using |/| characters (as for the similar function in \pkg{xcolor}). For -% example, to save a color with explicit |cmyk| and |rgb| values, one could -% use -% \begin{verbatim} -% \color_set:nnn { foo } { cmyk / rgb } -% { 0.1 , 0.2 , 0.3 , 0.4 / 0.1, 0.2 , 0.3 } -% \end{verbatim} -% The manually-specified conversion will be used in preference to automated -% calculation whenever the model(s) listed are used: both in expressions and -% when a fixed model is active. -% -% Similarly, the same syntax can be applied to directly selecting a color. -% \begin{verbatim} -% \color_select:nn { cmyk / rgb } -% { 0.1 , 0.2 , 0.3 , 0.4 / 0.1, 0.2 , 0.3 } -% \end{verbatim} -% Again, this list is used when a fixed model is active: the first entry is used -% unless there is a fixed model matching one of the other entries. -% -% \section{Exporting color specifications} -% -% The major use of color expressions is in setting typesetting output, but there -% are other places in which some form of color information is required. These -% may need data in a different format or using a different model to the internal -% representation. Thus a set of functions are available to export colors in -% different formats. -% -% Valid export targets are -% \begin{itemize} -% \item \texttt{backend} Two brace groups: the first containing the -% model, the second containing space-separated values appropriate -% for the model; this is the format required by backend functions -% of \pkg{expl3} -% \item \texttt{HTML} Uppercase two-digit hexadecimal values, expressing -% a red-green-blue color; the digits are \emph{not} separated -% \item \texttt{space-sep-cmyk} Space-separated cyan-magenta-yellow-black -% values -% \item \texttt{space-sep-rgb} Space-separated red-green-blue values -% suitable for use as a PDF annotation color -% \end{itemize} -% -% \begin{function}{\color_export:nnN} -% \begin{syntax} -% \cs{color_export:nnN} \Arg{color expression} \Arg{format} \Arg{tl} -% \end{syntax} -% Parses the \meta{color expression} as described earlier, -% then converts to the \meta{format} specified and assigns the data to the -% \meta{tl}. -% \end{function} -% -% \begin{function}{\color_export:nnnN} -% \begin{syntax} -% \cs{color_export:nnnN} \Arg{model} \Arg{value(s)} \Arg{format} \Arg{tl} -% \end{syntax} -% Expresses the combination of \meta{model} and \meta{value(s)} in an -% internal representation, then converts to the \meta{format} specified and -% assigns the data to the \meta{tl}. -% \end{function} -% -% \section{Creating new color models} -% \label{l3color:sec:new-models} -% -% Additional color models are required to support specialist workflows, for -% example those involving separations (see -% \url{https://helpx.adobe.com/indesign/using/spot-process-colors.html} -% for details of the use of separations in print). Color models may be split -% into families; for the standard device-based color models (\texttt{DeviceCMYK}, -% \texttt{DeviceRGB}, \texttt{DeviceGray}), these are synonymous. This -% is not generally the case: see the PDF reference for more details. (Note that -% \pkg{l3color} uses the shorter names \texttt{cmyk}, etc.) -% -% \begin{function}{\color_model_new:nnn} -% \begin{syntax} -% \cs{color_model_new:nnn} \Arg{model} \Arg{family} \Arg{params} -% \end{syntax} -% Creates a new \meta{model} which is derived from the color model \meta{family}. -% The latter should be one of -% \begin{itemize} -% \item \texttt{DeviceN} -% \item \texttt{Separation} -% \end{itemize} -% (The \meta{family} may be given in mixed case as-in the PDF reference: -% internally, case of these strings is folded.) -% Depending on the \meta{family}, one or more \meta{params} are mandatory or -% optional. -% \end{function} -% -% For a \texttt{Separation} space, there are three \emph{compulsory} keys. -% \begin{itemize} -% \item \texttt{name} The name of the Separation, for example the formal -% name of a spot color ink. Such a \meta{name} may contain spaces, etc., -% which are not permitted in the \meta{model}. -% \item \texttt{alternative-model} An alternative device colorspace, one of -% \texttt{cmyk}, \texttt{rgb}, \texttt{gray} or \texttt{CIELAB}. The three -% parameter-based models work as described above; see below for -% details of CIELAB colors. -% \item \texttt{alternative-values} A comma-separated list of values -% appropriate to the \texttt{alternative-model}. This information is used by -% the PDF application if the \texttt{Separation} is not available. -% \end{itemize} -% -% CIELAB color separations are created using the -% \texttt{alternative-model = CIELAB} setting. These colors must also have an -% \texttt{illuminant} key, one of \texttt{a}, \texttt{c}, \texttt{e}, -% \texttt{d50}, \texttt{d55}, \texttt{d65} or \texttt{d75}. The -% \texttt{alternative-values} in this case are the three parameters $L*$, $a*$ -% and $b*$ of the CIELAB model. Full details of this device-independent color -% approach are given in the documentation to the \pkg{colorspace} package. -% -% CIELAB colors \emph{cannot} be converted into other device-dependent color -% spaces, and as such, mixing can only occur if colors set up using the CIELAB -% model are also given with an alternative parameter-based model. If that is -% not the case, \pkg{l3color} will fallback to using black as the colorant in -% any mixing. -% -% For a \texttt{DeviceN} space, there is one \emph{compulsory} key. -% \begin{itemize} -% \item \texttt{names} The names of the components of the \texttt{DeviceN} -% space. Each should be either the \meta{name} of a \texttt{Separation} model, -% a process color name (\texttt{cyan}, etc.) or the special name \texttt{none}. -% \end{itemize} -% -% \end{documentation} -% -% \begin{implementation} -% -% \section{\pkg{l3color} Implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \begin{macrocode} -%<@@=color> -% \end{macrocode} -% -% \begin{macrocode} -\ProvidesExplPackage{l3color}{2021-02-06}{} - {L3 Experimental color support} -% \end{macrocode} -% -% \subsection{Predefined color names} -% -% The ability to predefine colors with a name is a key part of this module and -% means there has to be a method for storing the results. At first sight, it -% seems natural to follow the usual \pkg{expl3} model and create a -% \texttt{color} variable type for the process. That would then allow both -% local and global colors, constant colors and the like. However, these names -% need to be accessible in some form at the user level, for selection of colors -% either simply by name or as part of a more complex expression. This does not -% require that the full name is exposed but does require that they can be -% looked up in a predictable way. As such, it is more useful to expose just the -% color names as part of the interface, with the result that only local color -% names can be created. (This is also seen for example in key creation in -% \pkg{l3keys}.) As a result, color names are declarative (no \texttt{new} -% functions). -% -% Since there is no need to manipulate colors \emph{en masse}, each is stored -% in a two-part structure: a \texttt{prop} for the colors themselves, and a -% \texttt{tl} for the default model for each color. -% -% \subsection{Setup} -% -% \begin{variable}{\l_@@_internal_int, \l_@@_internal_tl} -% \begin{macrocode} -\int_new:N \l_@@_internal_int -\tl_new:N \l_@@_internal_tl -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\s_@@_mark} -% Internal scan marks. \cs{s_@@_stop} is already defined in \pkg{l3color-base}. -% \begin{macrocode} -\scan_new:N \s_@@_mark -% \end{macrocode} -% \end{variable} -% -% \subsection{Utility functions} -% -% \begin{macro}[int, TF, EXP]{\@@_if_defined:n} -% A simple wrapper to avoid needing to have the lookup repeated in too many -% places. -% \begin{macrocode} -\prg_new_conditional:Npnn \@@_if_defined:n #1 { T, F, TF } - { - \prop_if_exist:cTF { l_@@_named_ #1 _prop } - \prg_return_true: - \prg_return_false: - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_model:N, \@@_values:N} -% Simple abstractions. -% \begin{macrocode} -\cs_new:Npn \@@_model:N #1 { \exp_after:wN \use_i:nn #1 } -\cs_new:Npn \@@_values:N #1 { \exp_after:wN \use_ii:nn #1 } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_extract:nNN, \@@_extract:VNN} -% Recover the values for the standard model for a color. -% \begin{macrocode} -\cs_new_protected:Npn \@@_extract:nNN #1#2#3 - { - \tl_set_eq:Nc #2 { l_@@_named_ #1 _tl } - \prop_get:cVN { l_@@_named_ #1 _prop } #2 #3 - } -\cs_generate_variant:Nn \@@_extract:nNN { V } -% \end{macrocode} -% \end{macro} -% -% \subsection{Model conversion} -% -% \begin{macro}{\@@_convert:nnN, \@@_convert:VVN} -% \begin{macro}{\@@_convert:nnnN, \@@_convert:nVnN, \@@_convert:nnVN} -% \begin{macro}[aux, EXP] -% { -% \@@_convert_gray_rgb:w -% \@@_convert_gray_cmyk:w -% \@@_convert_cmyk_gray:w -% \@@_convert_cmyk_rgb:w -% \@@_convert_rgb_gray:w -% \@@_convert_rgb_cmyk:w -% } -% \begin{macro}[aux, EXP]{\@@_convert_rgb_cmyk:nnnn} -% Model conversion is carried out using standard formulae, as described in -% the manual for \pkg{xcolor} (see also the \emph{PostScript Language -% Reference Manual}). -% \begin{macrocode} -\cs_new_protected:Npn \@@_convert:nnN #1#2#3 - { \@@_convert:nnVN {#1} {#2} #3 #3 } -\cs_generate_variant:Nn \@@_convert:nnN { VV } -\cs_new_protected:Npn \@@_convert:nnnN #1#2#3#4 - { - \tl_set:Nx #4 - { - \cs_if_exist:cTF { @@_convert_ #1 _ #2 :w } - { \use:c { @@_convert_ #1 _ #2 :w } #3 ~ 0 ~ 0 ~ 0 \s_@@_stop } - { \use:c { c_@@_fallback_ #2 _tl } } - } - } -\cs_generate_variant:Nn \@@_convert:nnnN { nV , nnV } -\cs_new:Npn \@@_convert_gray_rgb:w #1 ~ #2 \s_@@_stop - { #1 ~ #1 ~ #1 } -\cs_new:Npn \@@_convert_gray_cmyk:w #1 ~ #2 \s_@@_stop - { 0 ~ 0 ~ 0 ~ \fp_eval:n { 1 - #1 } } -% \end{macrocode} -% These rather odd values are based on \textsc{ntsc} television: the set are -% used for the |cmyk| conversion. -% \begin{macrocode} -\cs_new:Npn \@@_convert_rgb_gray:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop - { \fp_eval:n { 0.3 * #1 + 0.59 * #2 + 0.11 * #3 } } -% \end{macrocode} -% The conversion from |rgb| to |cmyk| is the most complex: a two-step -% procedure which requires \emph{black generation} and \emph{undercolor -% removal} functions. The PostScript reference describes them as -% device-dependent, but following \pkg{xcolor} we assume they are linear. -% Moreover, as the likelihood of anyone using a non-unitary matrix here is -% tiny, we simplify and treat those two concepts as no-ops. -% \begin{macrocode} -\cs_new:Npn \@@_convert_rgb_cmyk:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop - { - \exp_args:Nf \@@_convert_rgb_cmyk:nnnn - { \fp_eval:n { min ( 1 - #1 , 1 - #2 , 1 - #3 ) } } {#1} {#2} {#3} - } -\cs_new:Npn \@@_convert_rgb_cmyk:nnnn #1#2#3#4 - { - \fp_eval:n { min ( 1 , max ( 0 , 1 - #2 - #1 ) ) } \c_space_tl - \fp_eval:n { min ( 1 , max ( 0 , 1 - #3 - #1 ) ) } \c_space_tl - \fp_eval:n { min ( 1 , max ( 0 , 1 - #4 - #1 ) ) } \c_space_tl - #1 - } -\cs_new:Npn \@@_convert_cmyk_gray:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop - { \fp_eval:n { 1 - min ( 1 , 0.3 * #1 + 0.59 * #2 + 0.11 * #3 + #4 ) } } -\cs_new:Npn \@@_convert_cmyk_rgb:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop - { - \fp_eval:n { 1 - min ( 1 , #1 + #4 ) } \c_space_tl - \fp_eval:n { 1 - min ( 1 , #2 + #4 ) } \c_space_tl - \fp_eval:n { 1 - min ( 1 , #3 + #4 ) } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Color expressions} -% -% \begin{variable} -% {\l_@@_model_tl, \l_@@_value_tl, \l_@@_next_model_tl, \l_@@_next_value_tl} -% Working space to store the color data whilst doing calculations: keeping -% it on the stack is attractive but gets tricky (return is non-trivial). -% \begin{macrocode} -\tl_new:N \l_@@_model_tl -\tl_new:N \l_@@_value_tl -\tl_new:N \l_@@_next_model_tl -\tl_new:N \l_@@_next_value_tl -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\@@_parse:nN} -% \begin{macro}{\@@_parse_aux:nN} -% \begin{macro}{\@@_parse_eq:Nn} -% \begin{macro}{\@@_parse_eq:nNn} -% \begin{macro}{\@@_parse:Nw} -% \begin{macro}{\@@_parse_loop_init:Nnn} -% \begin{macro}{\@@_parse_loop:w} -% \begin{macro}{\@@_parse_loop:nn} -% \begin{macro}{\@@_parse_gray:n, \@@_parse_std:n} -% \begin{macro}{\@@_parse_break:w} -% \begin{macro}{\@@_parse_end:} -% \begin{macro}[aux, EXP]{\@@_parse_mix:Nnnn, \@@_parse_mix:NVVn} -% \begin{macro}[aux, EXP]{\@@_parse_mix:nNnn} -% \begin{macro}[aux, EXP] -% { -% \@@_parse_mix_gray:nw , -% \@@_parse_mix_rgb:nw , -% \@@_parse_mix_cmyk:nw -% } -% The main function for parsing color expressions removes actives but -% otherwise expands, then starts working through the expression itself. -% At the end, we apply the payload. -% \begin{macrocode} -\cs_new_protected:Npx \@@_parse:nN #1#2 - { - \exp_not:N \@@_backend_pickup:N \exp_not:N \l_@@_current_tl - \tl_set:Nx \exp_not:c { l_@@_named_ . _tl } - { \exp_not:N \@@_model:N \exp_not:N \l_@@_current_tl } - \prop_put:NVx \exp_not:c { l_@@_named_ . _prop } - \exp_not:c { l_@@_named_ . _tl } - { \exp_not:N \@@_values:N \exp_not:N \l_@@_current_tl } - \exp_not:N \exp_args:Ne \exp_not:N \@@_parse_aux:nN - { \exp_not:N \tl_to_str:n {#1} } #2 - } -% \end{macrocode} -% Before going to all of the effort of parsing an expression, these two -% precursor functions look for a pre-defined name, either on its own or -% with a trailing |!| (which is the same thing). -% \begin{macrocode} -\cs_new_protected:Npn \@@_parse_aux:nN #1#2 - { - \tl_if_exist:cTF { l_@@_named_ #1 _prop } - { \@@_parse_set_eq:Nn #2 {#1} } - { \@@_parse:Nw #2#1 ! \s_@@_stop } - \@@_check_model:N #2 - } -\cs_new_protected:Npn \@@_parse_set_eq:Nn #1#2 - { - \tl_if_empty:NTF \l_color_fixed_model_tl - { \exp_args:Nv \@@_parse_set_eq:nNn { l_@@_named_ #2 _tl } } - { \exp_args:NV \@@_parse_set_eq:nNn \l_color_fixed_model_tl } - #1 {#2} - } -% \end{macrocode} -% Here, we have to allow for the case where there is a fixed model: -% that can't be swept up by generic conversion as we are dealing with a -% named color. -% \begin{macrocode} -\cs_new_protected:Npn \@@_parse_set_eq:nNn #1#2#3 - { - \prop_get:cnNTF - { l_@@_named_ #3 _prop } {#1} - \l_@@_value_tl - { \tl_set:Nx #2 { {#1} { \l_@@_value_tl } } } - { - \tl_set_eq:Nc \l_@@_model_tl { l_@@_named_ #3 _tl } - \prop_get:cVN { l_@@_named_ #3 _prop } \l_@@_model_tl - \l_@@_value_tl - \@@_convert:nnN - \l_@@_model_tl {#1} \l_@@_value_tl - \tl_set:Nx #2 - { - {#1} - { \l_@@_value_tl } - } - } - } -\cs_new_protected:Npn \@@_parse:Nw #1#2 ! #3 \s_@@_stop - { - \@@_if_defined:nTF {#2} - { - \tl_if_blank:nTF {#3} - { \@@_parse_set_eq:Nn #1 {#2} } - { \@@_parse_loop_init:Nnn #1 {#2} {#3} } - } - { - \__kernel_msg_error:nnn { color } { unknown-color } {#2} - \tl_set:Nn \l_@@_current_tl { { gray } { 0 } } - } - } -% \end{macrocode} -% Once we establish that a full parse is needed, the next job is to get the -% detail of the first color. That will determine the model we use for the -% calculation: splitting here makes checking that a bit easier. -% \begin{macrocode} -\cs_new_protected:Npn \@@_parse_loop_init:Nnn #1#2#3 - { - \group_begin: - \@@_extract:nNN {#2} \l_@@_model_tl \l_@@_value_tl - \@@_parse_loop:w #3 ! ! ! ! \s_@@_stop - \tl_set:Nx \l_@@_internal_tl - { { \l_@@_model_tl } { \l_@@_value_tl } } - \exp_args:NNNV \group_end: - \tl_set:Nn #1 \l_@@_internal_tl - } -% \end{macrocode} -% This is the loop proper: there can be an open-ended set of colors to parse, -% separated by |!| tokens. There are a few cases to look out for. At the end -% of the expression and with we find a mix of $100$ then we simply skip the -% next color entirely (we can't stop the loop as there might be a further -% valid color to mix in). On the other hand, if we get a mix of $0$ then -% drop everything so far and start again. There is also a trailing -% |white| to \enquote{read in} if the final explicit data is a mix. -% Those conditions are separate from actually looping, which is therefore -% sorted out by checking if we have further data to process: in contrast -% to \pkg{xcolor}, we don't allow |!!| so the test can be simplified. -% \begin{macrocode} -\cs_new_protected:Npn \@@_parse_loop:w #1 ! #2 ! #3 ! #4 ! #5 \s_@@_stop - { - \bool_lazy_or:nnF - { \tl_if_blank_p:n {#1} } - { \int_compare_p:nNn {#1} = { 100 } } - { - \int_compare:nNnTF {#1} = { 0 } - { - \tl_if_blank:nTF {#2} - { \@@_extract:nNN { white } } - { \@@_extract:nNN {#2} } - \l_@@_model_tl \l_@@_value_tl - } - { - \use:x - { - \@@_parse_loop:nn {#1} - { \tl_if_blank:nTF {#2} { white } {#2} } - } - } - } - \tl_if_blank:nF {#3} - { \@@_parse_loop:w #3 ! #4 ! #5 \s_@@_stop } - \@@_parse_end: - } -% \end{macrocode} -% The \enquote{payload} of calculation in the loop first. If the model for -% the upcoming color is different from that of the existing (partial) color, -% convert the model. For |gray| the two are flipped round so that the outcome -% is something with \enquote{real} color. We are then in a position to do the -% actual calculation itself. The two auxiliaries here give us a way to break -% the loop should an invalid name be found. -% \begin{macrocode} -\cs_new_protected:Npn \@@_parse_loop:nn #1#2 - { - \@@_if_defined:nTF {#2} - { - \@@_extract:nNN {#2} \l_@@_next_model_tl \l_@@_next_value_tl - \tl_if_eq:NNF \l_@@_model_tl \l_@@_next_model_tl - { - \str_if_eq:VnTF \l_@@_model_tl { gray } - { \@@_parse_gray:n {#2} } - { \@@_parse_std:n {#2} } - } - \tl_set:Nx \l_@@_value_tl - { - \@@_parse_mix:NVVn - \l_@@_model_tl \l_@@_value_tl \l_@@_next_value_tl {#1} - } - } - { - \__kernel_msg_error:nnn { color } { unknown-color } {#2} - \@@_extract:nNN { black } \l_@@_model_tl \l_@@_value_tl - \@@_parse_break:w - } - } -% \end{macrocode} -% The \texttt{gray} model needs special handling: the models need to be -% swapped: we do that using a dedicated function. -% \begin{macrocode} -\cs_new_protected:Npn \@@_parse_gray:n #1 - { - \tl_set_eq:NN \l_@@_model_tl \l_@@_next_model_tl - \tl_set:Nn \l_@@_next_model_tl { gray } - \exp_args:NnV \@@_convert:nnN { gray } \l_@@_model_tl - \l_@@_value_tl - \prop_get:cVN { l_@@_named_ #1 _prop } \l_@@_model_tl - \l_@@_next_value_tl - } -\cs_new_protected:Npn \@@_parse_std:n #1 - { - \prop_get:cVNF { l_@@_named_ #1 _prop } - \l_@@_model_tl - \l_@@_next_value_tl - { - \@@_convert:VVN - \l_@@_next_model_tl - \l_@@_model_tl - \l_@@_next_value_tl - } - } -\cs_new_protected:Npn \@@_parse_break:w #1 \@@_parse_end: { } -\cs_new_protected:Npn \@@_parse_end: { } -% \end{macrocode} -% Do the vector arithmetic: mainly a question of shuffling input, along -% with one pre-calculation to keep down the use of division. -% \begin{macrocode} -\cs_new:Npn \@@_parse_mix:Nnnn #1#2#3#4 - { - \exp_args:Nf \@@_parse_mix:nNnn - { \fp_eval:n { #4 / 100 } } - #1 {#2} {#3} - } -\cs_generate_variant:Nn \@@_parse_mix:Nnnn { NVV } -\cs_new:Npn \@@_parse_mix:nNnn #1#2#3#4 - { - \use:c { @@_parse_mix_ #2 :nw } {#1} - #3 \s_@@_mark #4 \s_@@_stop - } -\cs_new:Npn \@@_parse_mix_gray:nw #1#2 \s_@@_mark #3 \s_@@_stop - { \fp_eval:n { #2 * #1 + #3 * ( 1 - #1 ) } } -\cs_new:Npn \@@_parse_mix_rgb:nw - #1#2 ~ #3 ~ #4 \s_@@_mark #5 ~ #6 ~ #7 \s_@@_stop - { - \fp_eval:n { #2 * #1 + #5 * ( 1 - #1 ) } \c_space_tl - \fp_eval:n { #3 * #1 + #6 * ( 1 - #1 ) } \c_space_tl - \fp_eval:n { #4 * #1 + #7 * ( 1 - #1 ) } - } -\cs_new:Npn \@@_parse_mix_cmyk:nw - #1#2 ~ #3 ~ #4 ~ #5 \s_@@_mark #6 ~ #7 ~ #8 ~ #9 \s_@@_stop - { - \fp_eval:n { #2 * #1 + #6 * ( 1 - #1 ) } \c_space_tl - \fp_eval:n { #3 * #1 + #7 * ( 1 - #1 ) } \c_space_tl - \fp_eval:n { #4 * #1 + #8 * ( 1 - #1 ) } \c_space_tl - \fp_eval:n { #5 * #1 + #9 * ( 1 - #1 ) } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}[EXP] -% { -% \@@_parse_model_gray:w, \@@_parse_model_rgb:w, -% \@@_parse_model_cmyk:w -% } -% \begin{macro}[EXP]{\@@_parse_number:n} -% \begin{macro}[EXP]{\@@_parse_number:w} -% Turn the input into internal form, also tidying up the number quickly. -% \begin{macrocode} -\cs_new:Npn \@@_parse_model_gray:w #1 , #2 \s_@@_stop - { { gray } { \@@_parse_number:n {#1} } } -\cs_new:Npn \@@_parse_model_rgb:w #1 , #2 , #3 , #4 \s_@@_stop - { - { rgb } - { - \@@_parse_number:n {#1} ~ - \@@_parse_number:n {#2} ~ - \@@_parse_number:n {#3} - } - } -\cs_new:Npn \@@_parse_model_cmyk:w #1 , #2 , #3 , #4 , #5 \s_@@_stop - { - { cmyk } - { - \@@_parse_number:n {#1} ~ - \@@_parse_number:n {#2} ~ - \@@_parse_number:n {#3} ~ - \@@_parse_number:n {#4} - } - } -\cs_new:Npn \@@_parse_number:n #1 - { \@@_parse_number:w #1 . 0 . \s_@@_stop } -\cs_new:Npn \@@_parse_number:w #1 . #2 . #3 \s_@@_stop - { \tl_if_blank:nTF {#1} { 0 } {#1} . #2 } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}[EXP] -% { -% \@@_parse_model_Gray:w, \@@_parse_model_hsb:w, -% \@@_parse_model_Hsb:w, \@@_parse_model_HSB:w, -% \@@_parse_model_HTML:w, \@@_parse_model_RGB:w -% } -% \begin{macro}[EXP]{\@@_parse_model_hsb:nnn, \@@_parse_model_hsb_aux:nnn} -% \begin{macro}[EXP]{\@@_parse_model_hsb:nnnn} -% \begin{macro}[EXP]{\@@_parse_model_hsb:nnnnn} -% \begin{macro}[EXP] -% { -% \@@_parse_model_hsb_0:nnnn , -% \@@_parse_model_hsb_1:nnnn , -% \@@_parse_model_hsb_2:nnnn , -% \@@_parse_model_hsb_3:nnnn , -% \@@_parse_model_hsb_4:nnnn , -% \@@_parse_model_hsb_5:nnnn -% } -% \begin{macro}[EXP]{\@@_parse_model_wave:w} -% \begin{macro}[EXP] -% {\@@_parse_model_wave_auxi:nn, \@@_parse_model_wave_auxii:nn} -% \begin{macro}[EXP]{\@@_parse_model_wave_rho:n} -% \begin{macrocode} -\cs_new:Npn \@@_parse_model_Gray:w #1 , #2 \s_@@_stop - { { gray } { \fp_eval:n { #1 / 15 } } } -\cs_new:Npn \@@_parse_model_hsb:w #1 , #2 , #3 , #4 \s_@@_stop - { \@@_parse_model_hsb:nnn {#1} {#2} {#3} } -\cs_new:Npn \@@_parse_model_Hsb:w #1 , #2 , #3 , #4 \s_@@_stop - { - \exp_args:Ne \@@_parse_model_hsb:nnn { \fp_eval:n { #1 / 360 } } - {#2} {#3} - } -% \end{macrocode} -% The conversion here is non-trivial but is described at length -% in the \pkg{xcolor} manual. For ease, we calculate the integer -% and fractional parts of the hue first, then use them to work out the -% possible values for $r$, $g$ and $b$ before putting them in the correct -% places. -% \begin{macrocode} -\cs_new:Npn \@@_parse_model_hsb:nnn #1#2#3 - { - { rgb } - { - \exp_args:Ne \@@_parse_model_hsb_aux:nnn - { \fp_eval:n { 6 * #1 } } {#2} {#3} - } - } -\cs_new:Npn \@@_parse_model_hsb_aux:nnn #1#2#3 - { - \exp_args:Nee \@@_parse_model_hsb_aux:nnnn - { \fp_eval:n { floor(#1) } } { \fp_eval:n { #1 - floor(#1) } } - {#2} {#3} - } -\cs_new:Npn \@@_parse_model_hsb_aux:nnnn #1#2#3#4 - { - \use:e - { - \exp_not:N \@@_parse_model_hsb_aux:nnnnn - { \@@_parse_number:n {#4} } - { \fp_eval:n { round(#4 * (1 - #3) ,5) } } - { \fp_eval:n { round(#4 * ( 1 - #3 * #2 ) ,5) } } - { \fp_eval:n { round(#4 * ( 1 - #3 * (1 - #2) ) ,5) } } - {#1} - } - } -\cs_new:Npn \@@_parse_model_hsb_aux:nnnnn #1#2#3#4#5 - { \use:c { @@_parse_model_hsb_ #5 :nnnn } {#1} {#2} {#3} {#4} } -\cs_new:cpn { @@_parse_model_hsb_0:nnnn } #1#2#3#4 { #1 ~ #4 ~ #2 } -\cs_new:cpn { @@_parse_model_hsb_1:nnnn } #1#2#3#4 { #3 ~ #1 ~ #2 } -\cs_new:cpn { @@_parse_model_hsb_2:nnnn } #1#2#3#4 { #2 ~ #1 ~ #4 } -\cs_new:cpn { @@_parse_model_hsb_3:nnnn } #1#2#3#4 { #2 ~ #3 ~ #1 } -\cs_new:cpn { @@_parse_model_hsb_4:nnnn } #1#2#3#4 { #4 ~ #2 ~ #1 } -\cs_new:cpn { @@_parse_model_hsb_5:nnnn } #1#2#3#4 { #1 ~ #2 ~ #3 } -\cs_new:cpn { @@_parse_model_hsb_6:nnnn } #1#2#3#4 { #1 ~ #2 ~ #2 } -\cs_new:Npn \@@_parse_model_HSB:w #1 , #2 , #3 , #4 \s_@@_stop - { - \exp_args:Neee \@@_parse_model_hsb:nnn - { \fp_eval:n {#1 / 240} } - { \fp_eval:n {#2 / 240} } - { \fp_eval:n {#3 / 240} } - } -\cs_new:Npn \@@_parse_model_HTML:w #1 , #2 \s_@@_stop - { \@@_parse_model_HTML_aux:w #1 0 0 0 0 0 0 \s_@@_stop } -\cs_new:Npn \@@_parse_model_HTML_aux:w #1#2#3#4#5#6#7 \s_@@_stop - { - { rgb } - { - \fp_eval:n { round(\int_from_hex:n {#1#2} / 255,5) } ~ - \fp_eval:n { round(\int_from_hex:n {#3#4} / 255,5) } ~ - \fp_eval:n { round(\int_from_hex:n {#5#6} / 255,5) } - } - } -\cs_new:Npn \@@_parse_model_RGB:w #1 , #2 , #3 , #4 \s_@@_stop - { - { rgb } - { - \fp_eval:n { round(#1 / 255,5) } ~ - \fp_eval:n { round(#2 / 255,5) } ~ - \fp_eval:n { round(#3 / 255,5) } - } - } -% \end{macrocode} -% Following the description in the \pkg{xcolor} manual. As we always use |rgb|, -% there is no need to find the sixth, we just pas the information straight -% to the |hsb| auxiliary defined earlier. -% \begin{macrocode} -\cs_new:Npn \@@_parse_model_wave:w #1 , #2 \s_@@_stop - { - { rgb } - { - \fp_compare:nNnTF {#1} < { 420 } - { \@@_parse_model_wave_auxi:nn {#1} { 0.3 + 0.7 * (#1 - 380) / 40 } - } - { - \fp_compare:nNnTF {#1} > { 700 } - { \@@_parse_model_wave_auxi:nn {#1} { 0.3 + 0.7 * (#1 - 780) / -80 } } - { \@@_parse_model_wave_auxi:nn {#1} { 1 } } - } - } - } -\cs_new:Npn \@@_parse_model_wave_auxi:nn #1#2 - { - \fp_compare:nNnTF {#1} < { 440 } - { - \@@_parse_model_wave_auxii:nn - { 4 + \@@_parse_model_wave_rho:n { (#1 - 440) / -60 } } - {#2} - } - { - \fp_compare:nNnTF {#1} < { 490 } - { - \@@_parse_model_wave_auxii:nn - { 4 - \@@_parse_model_wave_rho:n { (#1 - 440) / 50 } } - {#2} - } - { - \fp_compare:nNnTF {#1} < { 510 } - { - \@@_parse_model_wave_auxii:nn - { 2 + \@@_parse_model_wave_rho:n { (#1 - 510) / -20 } } - {#2} - } - { - \fp_compare:nNnTF {#1} < { 580 } - { - \@@_parse_model_wave_auxii:nn - { 2 - \@@_parse_model_wave_rho:n { (#1 - 510) / 70 } } - {#2} - } - { - \fp_compare:nNnTF {#1} < { 645 } - { - \@@_parse_model_wave_auxii:nn - { \@@_parse_model_wave_rho:n { (#1 - 645) / -65 } } - {#2} - } - { \@@_parse_model_wave_auxii:nn { 0 } {#2} } - } - } - } - } - } -\cs_new:Npn \@@_parse_model_wave_auxii:nn #1#2 - { - \exp_args:Neee \@@_parse_model_hsb_aux:nnn - { \fp_eval:n {#1} } - { 1 } - { \@@_parse_model_wave_rho:n {#2} } - } -\cs_new:Npn \@@_parse_model_wave_rho:n #1 - { \fp_eval:n { min(1, max(0,#1) ) } } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Selecting colors (and color models)} -% -% \begin{variable}{\l_color_fixed_model_tl} -% For selecting a single fixed model. -% \begin{macrocode} -\tl_new:N \l_color_fixed_model_tl -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\@@_check_model:N} -% \begin{macro}{\@@_check_model:nn} -% Check that the model in use is the one required. -% \begin{macrocode} -\cs_new_protected:Npn \@@_check_model:N #1 - { - \tl_if_empty:NF \l_color_fixed_model_tl - { - \exp_after:wN \@@_check_model:nn #1 - \tl_if_eq:NNF \l_@@_model_tl \l_color_fixed_model_tl - { - \@@_convert:VVN \l_@@_model_tl \l_color_fixed_model_tl - \l_@@_value_tl - } - \tl_set:Nx #1 - { { \l_color_fixed_model_tl } { \l_@@_value_tl } } - } - } -\cs_new_protected:Npn \@@_check_model:nn #1#2 - { - \tl_set:Nn \l_@@_model_tl {#1} - \tl_set:Nn \l_@@_value_tl {#2} - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\@@_select:} -% A backend-neutral location for \enquote{last minute} manipulations before -% handing off to the backend code. We set the special |.| syntax here: this -% will therefore always be available. The finalisation is separate from the -% main function so it can also be applied to \emph{e.g.}~page color. -% \begin{macrocode} -\cs_new_protected:Npx \@@_select: - { - \tl_set:Nx \exp_not:c { l_@@_named_ . _tl } - { \exp_not:N \@@_model:N \exp_not:N \l_@@_current_tl } - \prop_clear:N \exp_not:c { l_@@_named_ . _prop } - \prop_put:NVx \exp_not:c { l_@@_named_ . _prop } - \exp_not:c { l_@@_named_ . _tl } - { \exp_not:N \@@_values:N \exp_not:N \l_@@_current_tl } - \@@_select:N \exp_not:N \l_@@_current_tl - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\color_select:n} -% \begin{macro}{\color_select:nn} -% \begin{macro}{\@@_select_main:Nw, \@@_select_loop:Nw} -% \begin{macro}{\@@_select:nnN} -% \begin{macro}{\@@_select_swap:Nnn} -% Parse the input expressions then get the backend to actually activate -% them. The main complexity here is the need to check through multiple models. -% That is done \enquote{locally} here as the approach is subtly different to -% when different models are being stored. -% \begin{macrocode} -\cs_new_protected:Npn \color_select:n #1 - { - \@@_parse:nN {#1} \l_@@_current_tl - \@@_select: - } -\cs_new_protected:Npn \color_select:nn #1#2 - { - \@@_select_main:Nw \l_@@_current_tl - #1 / / \s_@@_mark #2 / / \s_@@_stop - \@@_select: - } -% \end{macrocode} -% If the first color model is the fixed one, or if there is no fixed -% model, we don't need most of the data: just set up and apply the backend -% function. -% \begin{macrocode} -\cs_new_protected:Npn \@@_select_main:Nw - #1 #2 / #3 / #4 \s_@@_mark #5 / #6 / #7 \s_@@_stop - { - \@@_select:nnN {#2} {#5} #1 - \bool_lazy_or:nnF - { \tl_if_empty_p:N \l_color_fixed_model_tl } - { \str_if_eq_p:nV {#2} \l_color_fixed_model_tl } - { \@@_select_loop:Nw #1 #3 / #4 \s_@@_mark #6 / #7 \s_@@_stop } - } -% \end{macrocode} -% If a fixed model applies, we need to check each possible value in order. -% If there is no hit at all, fall back on the generic formula-based -% interchange. -% \begin{macrocode} -\cs_new_protected:Npn \@@_select_loop:Nw - #1 #2 / #3 \s_@@_mark #4 / #5 \s_@@_stop - { - \str_if_eq:nVTF {#2} \l_color_fixed_model_tl - { \@@_select:nnN {#2} {#4} #1 } - { - \tl_if_blank:nTF {#2} - { \exp_after:wN \@@_select_swap:Nnn \exp_after:wN #1 #1 } - { \@@_select_loop:Nw #1 #3 \s_@@_mark #5 \s_@@_stop } - } - } -\cs_new_protected:Npn \@@_select:nnN #1#2#3 - { - \cs_if_exist:cTF { @@_parse_model_ #1 :w } - { - \tl_set:Nx #3 - { \use:c { @@_parse_model_ #1 :w } #2 , 0 , 0 , 0 , 0 \s_@@_stop } - } - { \__kernel_msg_error:nnn { color } { unknown-model } {#1} } - } -\cs_new_protected:Npn \@@_select_swap:Nnn #1#2#3 - { - \@@_convert:nVnN {#2} \l_color_fixed_model_tl {#3} \l_@@_value_tl - \tl_set:Nx #1 - { { \l_color_fixed_model_tl } { \l_@@_value_tl } } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Fill and stroke color} -% -% \begin{macro}{\color_fill:n, \color_stroke:n} -% \begin{macro}{\color_fill:nn, \color_stroke:nn} -% \begin{macro}{\@@_draw:nnn} -% \begin{macrocode} -\cs_new_protected:Npn \color_fill:n #1 - { - \@@_parse:nN {#1} \l_@@_current_tl - \exp_after:wN \@@_draw:nnn \l_@@_current_tl { fill } - } -\cs_new_protected:Npn \color_stroke:n #1 - { - \@@_parse:nN {#1} \l_@@_current_tl - \exp_after:wN \@@_draw:nnn \l_@@_current_tl { stroke } - } -\cs_new_protected:Npn \color_fill:nn #1#2 - { - \@@_select_main:Nw \l_@@_current_tl - #1 / / \s_@@_mark #2 / / \s_@@_stop - \exp_after:wN \@@_draw:nnn \l_@@_current_tl { fill } - } -\cs_new_protected:Npn \color_stroke:nn #1#2 - { - \@@_select_main:Nw \l_@@_current_tl - #1 / / \s_@@_mark #2 / / \s_@@_stop - \exp_after:wN \@@_draw:nnn \l_@@_current_tl { stroke } - } -\cs_new_protected:Npn \@@_draw:nnn #1#2#3 - { \use:c { @@_backend_ #3 _ #1 :n } {#2} } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Defining named colors} -% -% \begin{variable}{\l_@@_named_tl} -% Space to store the detail of the named color. -% \begin{macrocode} -\tl_new:N \l_@@_named_tl -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\color_set:nn} -% \begin{macro}{\@@_set:nnn} -% \begin{macro}{\@@_set:nn} -% \begin{macro}{\@@_set:nnw} -% \begin{macro}{\color_set:nnn} -% \begin{macro}{\@@_set_colon:nnw} -% \begin{macro}{\@@_set_loop:nw} -% \begin{macro}{\color_set_eq:nn} -% Defining named colors means working through the model list and saving -% both the \enquote{main} color and any equivalents in other models. Even -% if there is only one model, we store a |prop| as well as a |tl|, as there -% could be grouping weirdness, etc. When setting using an expression, -% we need to avoid any fixed model issues, which is done without a group as -% in \pkg{l3keys}. -% \begin{macrocode} -\cs_new_protected:Npn \color_set:nn #1#2 - { - \exp_args:NV \@@_set:nnn - \l_color_fixed_model_tl {#1} {#2} - } -\cs_new_protected:Npn \@@_set:nnn #1#2#3 - { - \tl_clear:N \l_color_fixed_model_tl - \@@_set:nn {#2} {#3} - \tl_set:Nn \l_color_fixed_model_tl {#1} - } -\cs_new_protected:Npn \@@_set:nn #1#2 - { - \str_if_eq:nnF {#1} { . } - { - \@@_parse:nN {#2} \l_@@_named_tl - \tl_clear_new:c { l_@@_named_ #1 _tl } - \tl_set:cx { l_@@_named_ #1 _tl } - { \@@_model:N \l_@@_named_tl } - \prop_clear_new:c { l_@@_named_ #1 _prop } - \prop_put:cvx { l_@@_named_ #1 _prop } { l_@@_named_ #1 _tl } - { \@@_values:N \l_@@_named_tl } - \@@_set:nnw {#1} {#2} #2 ! \s_@@_stop - } - } -% \end{macrocode} -% When setting an expression-based color, there could be multiple model -% data available for one or more of the input colors. Where that is true for -% the \emph{first} named color in an expression, we re-parse the expression -% when they are also parameter-based: only |cmyk|, |gray| and |rgb| make -% any sense here. There is a bit of a performance hit but this should be -% rare and taking place during set-up. -% \begin{macrocode} -\cs_new_protected:Npn \@@_set:nnw #1#2#3 ! #4 \s_@@_stop - { - \clist_map_inline:nn { cmyk , gray , rgb } - { - \prop_get:cnNT { l_@@_named_ #3 _prop } {##1} \l_@@_internal_tl - { - \prop_if_in:cnF { l_@@_named_ #1 _prop } {##1} - { - \group_begin: - \tl_set:cn { l_@@_named_ #3 _tl } {##1} - \@@_parse:nN {#2} \l_@@_internal_tl - \exp_args:NNNV \group_end: - \tl_set:Nn \l_@@_internal_tl \l_@@_internal_tl - \prop_put:cxx { l_@@_named_ #1 _prop } - { \@@_model:N \l_@@_internal_tl } - { \@@_values:N \l_@@_internal_tl } - } - } - } - } -\cs_new_protected:Npx \color_set:nnn #1#2#3 - { - \exp_not:N \str_if_eq:nnF {#1} { . } - { - \tl_clear_new:c { l_@@_named_ #1 _tl } - \prop_clear_new:c { l_@@_named_ #1 _prop } - \exp_not:N \@@_set_colon:nnw {#1} {#3} - #2 \c_colon_str \c_colon_str \exp_not:N \s_@@_stop - } - } -\use:x - { - \cs_new_protected:Npn \exp_not:N \@@_set_colon:nnw - ##1##2 ##3 \c_colon_str ##4 \c_colon_str - ##5 \exp_not:N \s_@@_stop - } - { - \tl_if_blank:nTF {#4} - { \@@_set_loop:nw {#1} #3 } - { \@@_set_loop:nw {#1} #4 } - / / \s_@@_mark #2 / / \s_@@_stop - } -\cs_new_protected:Npn \@@_set_loop:nw - #1#2 / #3 \s_@@_mark #4 / #5 \s_@@_stop - { - \tl_if_blank:nF {#2} - { - \@@_select:nnN {#2} {#4} \l_@@_named_tl - \tl_set:Nx \l_@@_internal_tl { \@@_model:N \l_@@_named_tl } - \tl_if_empty:cT { l_@@_named_ #1 _tl } - { \tl_set_eq:cN { l_@@_named_ #1 _tl } \l_@@_internal_tl } - \prop_put:cVx { l_@@_named_ #1 _prop } \l_@@_internal_tl - { \@@_values:N \l_@@_named_tl } - \@@_set_loop:nw {#1} #3 \s_@@_mark #5 \s_@@_stop - } - } -\cs_new_protected:Npn \color_set_eq:nn #1#2 - { - \@@_if_defined:nTF {#2} - { - \tl_clear_new:c { l_@@_named_ #1 _tl } - \prop_clear_new:c { l_@@_named_ #1 _prop } - \str_if_eq:nnTF {#2} { . } - { - \tl_set:cx { l_@@_named_ #1 _tl } - { \@@_model:N \l_@@_current_tl } - \prop_put:cvx { l_@@_named_ #1 _prop } { l_@@_named_ #1 _tl } - { \@@_values:N \l_@@_current_tl } - } - { - \tl_set_eq:cc { l_@@_named_ #1 _tl } { l_@@_named_ #2 _tl } - \prop_set_eq:cc { l_@@_named_ #1 _prop } { l_@@_named_ #2 _prop } - } - } - { - \__kernel_msg_error:nnn { color } { unknown-color } {#2} - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% A small set of colors are always defined. -% \begin{macrocode} -\color_set:nnn { black } { gray } { 0 } -\color_set:nnn { white } { gray } { 1 } -\color_set:nnn { cyan } { cmyk } { 1 , 0 , 0 , 0 } -\color_set:nnn { magenta } { cmyk } { 0 , 1 , 0 , 0 } -\color_set:nnn { yellow } { cmyk } { 0 , 0 , 1 , 0 } -\color_set:nnn { red } { rgb } { 1 , 0 , 0 } -\color_set:nnn { green } { rgb } { 0 , 1 , 0 } -\color_set:nnn { blue } { rgb } { 0 , 0 , 1 } -% \end{macrocode} -% -% \begin{variable}{\l_@@_named_._prop, \l_@@_named_._tl} -% A special named color: this is always defined though not fixed in -% definition. -% \begin{macrocode} -\prop_new:c { l_@@_named_._prop } -\tl_new:c { l_@@_named_._tl } -\tl_set:cx { l_@@_named_._tl } { \@@_model:N \l_@@_current_tl } -% \end{macrocode} -% \end{variable} -% -% \subsection{Exporting colors} -% -% \begin{macro}{\color_export:nnN} -% \begin{macro}{\color_export:nnnN} -% \begin{macro}{\@@_export:nN} -% \begin{macro}{\@@_export:nnnN} -% \begin{macrocode} -\cs_new_protected:Npn \color_export:nnN #1#2#3 - { - \group_begin: - \tl_if_exist:cT { c_@@_export_ #2 _tl } - { \tl_set_eq:Nc \l_color_fixed_model_tl { c_@@_export_ #2 _tl } } - \@@_parse:nN {#1} #3 - \@@_export:nN {#2} #3 - \exp_args:NNNV \group_end: - \tl_set:Nn #3 #3 - } -\cs_new_protected:Npn \color_export:nnnN #1#2#3#4 - { - \@@_select_main:Nw #4 - #1 / / \s_@@_mark #2 / / \s_@@_stop - \@@_export:nN {#3} #4 - } -\cs_new_protected:Npn \@@_export:nN #1#2 - { \exp_after:wN \@@_export:nnnN #2 {#1} #2 } -\cs_new:Npn \@@_export:nnnN #1#2#3#4 - { - \cs_if_exist_use:cF { @@_export_format_ #3 :nnN } - { - \__kernel_msg_error:nnn { color } { unknown-export-format } {#3} - \use_none:nnn - } - {#1} {#2} #4 - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\@@_export_format_backend:nnN} -% Simple. -% \begin{macrocode} -\cs_new_protected:Npn \@@_export_format_backend:nnN #1#2#3 - { \tl_set:Nn #3 { {#1} {#2} } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_export:nnnNN} -% A generic auxiliary for cases where only one model is appropriate. -% \begin{macrocode} -\cs_new_protected:Npn \@@_export:nnnNN #1#2#3#4#5 - { - \str_if_eq:nnTF {#2} {#1} - { #5 #4 #3 \s_@@_stop } - { - \@@_convert:nnnN {#2} {#1} {#3} #4 - \exp_after:wN #5 \exp_after:wN #4 - #4 \s_@@_stop - } - } -% \end{macrocode} -% \end{macro} -% -% \begin{variable} -% { -% \c_@@_export_HTML_tl , -% \c_@@_export_space-sep-cmyk_tl , -% \c_@@_export_space-sep-rgb_tl -% } -% \begin{macrocode} -\tl_const:Nn \c_@@_export_HTML_tl { rgb } -\tl_const:cn { c_@@_export_space-sep-cmyk_tl } { cmyk } -\tl_const:cn { c_@@_export_space-sep-rgb_tl } { rgb } -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\@@_export_format_space-sep-cmyk:nnN} -% \begin{macro}{\@@_export_space-sep-cmyk:Nw} -% \begin{macrocode} -\cs_new_protected:cpx { @@_export_format_space-sep-cmyk:nnN } #1#2#3 - { - \exp_not:N \@@_export:nnnNN { cmyk } {#1} {#2} #3 - \exp_not:c { @@_export_space-sep-cmyk:Nw } - } -\cs_new_protected:cpn { @@_export_space-sep-cmyk:Nw } #1#2 \s_@@_stop - { \tl_set:Nx #1 {#2} } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro} -% { -% \@@_export_format_HTML:nnN , -% \@@_export_format_space-sep-rgb:nnN -% } -% \begin{macro} -% { -% \@@_export_HTML:Nw , -% \@@_export_space-sep-rgb:Nw -% } -% \begin{macro}[EXP]{\@@_export_HTML:n} -% \textsc{html} values must be given in |rgb|: we force conversion if -% required, then do some simple maths. -% \begin{macrocode} -\cs_new_protected:Npn \@@_export_format_HTML:nnN #1#2#3 - { \@@_export:nnnNN { rgb } {#1} {#2}#3 \@@_export_HTML:Nw } -\cs_new_protected:cpx { @@_export_format_space-sep-rgb:nnN } #1#2#3 - { - \exp_not:N \@@_export:nnnNN { rgb } {#1} {#2} #3 - \exp_not:c { @@_export_space-sep-rgb:Nw } - } -\cs_new_protected:Npn \@@_export_HTML:Nw #1#2 ~ #3 ~ #4 \s_@@_stop - { - \tl_set:Nx #1 - { - \@@_export_HTML:n {#2} - \@@_export_HTML:n {#3} - \@@_export_HTML:n {#4} - } - } -\cs_new:Npn \@@_export_HTML:n #1 - { - \fp_compare:nNnTF {#1} = { 0 } - { 00 } - { \int_to_Hex:n { \fp_to_int:n { #1 * 255 } } } - } -\cs_new_protected:cpn { @@_export_space-sep-rgb:Nw } #1#2 \s_@@_stop - { \tl_set:Nx #1 {#2} } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Additional color models} -% -% \begin{variable}{\l_@@_internal_prop} -% \begin{macrocode} -\prop_new:N \l_@@_internal_prop -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_model_int} -% A tracker for the total number of new models. -% \begin{macrocode} -\int_new:N \g_@@_model_int -% \end{macrocode} -% \end{variable} -% -% \begin{variable} -% {\c_@@_fallback_cmyk_tl, \c_@@_fallback_gray_tl, \c_@@_fallback_rgb_tl} -% Conversion from Separation or DeviceN spaces may not be possible; have -% a fallback to black. -% \begin{macrocode} -\tl_const:Nn \c_@@_fallback_cmyk_tl { 0 ~ 0 ~ 0 ~ 1 } -\tl_const:Nn \c_@@_fallback_gray_tl { 1 } -\tl_const:Nn \c_@@_fallback_rgb_tl { 1 ~ 1 ~ 1 } -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_colorants_prop} -% Mapping from names to colorants. -% \begin{macrocode} -\prop_new:N \g_@@_colorants_prop -\prop_gput:Nnn \g_@@_colorants_prop { black } { Black } -\prop_gput:Nnn \g_@@_colorants_prop { blue } { Blue } -\prop_gput:Nnn \g_@@_colorants_prop { cyan } { Cyan } -\prop_gput:Nnn \g_@@_colorants_prop { green } { Green } -\prop_gput:Nnn \g_@@_colorants_prop { magenta } { Magenta } -\prop_gput:Nnn \g_@@_colorants_prop { none } { None } -\prop_gput:Nnn \g_@@_colorants_prop { red } { Red } -\prop_gput:Nnn \g_@@_colorants_prop { yellow } { Yellow } -% \end{macrocode} -% \end{variable} -% -% \begin{variable} -% { -% \c_@@_model_whitepoint_CIELAB_a_tl , -% \c_@@_model_whitepoint_CIELAB_b_tl , -% \c_@@_model_whitepoint_CIELAB_e_tl , -% \c_@@_model_whitepoint_CIELAB_d50_tl , -% \c_@@_model_whitepoint_CIELAB_d55_tl , -% \c_@@_model_whitepoint_CIELAB_d65_tl , -% \c_@@_model_whitepoint_CIELAB_d75_tl -% } -% Whitepoint data for the CIELAB profiles. -% \begin{macrocode} -\tl_const:Nn \c_@@_model_whitepoint_CIELAB_a_tl { 1.0985 ~ 1 ~ 0.3558 } -\tl_const:Nn \c_@@_model_whitepoint_CIELAB_b_tl { 0.9807 ~ 1 ~ 1.1822 } -\tl_const:Nn \c_@@_model_whitepoint_CIELAB_e_tl { 1 ~ 1 ~ 1 } -\tl_const:cn { c_@@_model_whitepoint_CIELAB_d50_tl } { 0.9642 ~ 1 ~ 0.8251 } -\tl_const:cn { c_@@_model_whitepoint_CIELAB_d55_tl } { 0.9568 ~ 1 ~ 0.9214 } -\tl_const:cn { c_@@_model_whitepoint_CIELAB_d65_tl } { 0.9504 ~ 1 ~ 1.0888 } -\tl_const:cn { c_@@_model_whitepoint_CIELAB_d75_tl } { 0.9497 ~ 1 ~ 1.2261 } -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\c_@@_model_range_CIELAB_tl} -% The range for CIELAB color spaces. -% \begin{macrocode} -\tl_const:Nn \c_@@_model_range_CIELAB_tl { 0 ~ 100 ~ -128 ~ 127 ~ -128 ~ 127 } -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_alternative_model_prop} -% For tracking the alternative model set up for separations, etc. -% \begin{macrocode} -\prop_new:N \g_@@_alternative_model_prop -\clist_map_inline:nn { cyan , magenta , yellow , black } - { \prop_gput:Nnn \g_@@_alternative_model_prop {#1} { cmyk } } -\clist_map_inline:nn { red , green , blue } - { \prop_gput:Nnn \g_@@_alternative_model_prop {#1} { rgb } } -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_alternative_values_prop} -% Same for the values: a bit more involved. -% \begin{macrocode} -\prop_new:N \g_@@_alternative_values_prop -\prop_gput:Nnn \g_@@_alternative_values_prop { cyan } { 1 , 0 , 0 , 0 } -\prop_gput:Nnn \g_@@_alternative_values_prop { magenta } { 0 , 1 , 0 , 0 } -\prop_gput:Nnn \g_@@_alternative_values_prop { yellow } { 0 , 0 , 1 , 0 } -\prop_gput:Nnn \g_@@_alternative_values_prop { black } { 0 , 0 , 0 , 1 } -\prop_gput:Nnn \g_@@_alternative_values_prop { red } { 1 , 0 , 0 } -\prop_gput:Nnn \g_@@_alternative_values_prop { green } { 0 , 1 , 0 } -\prop_gput:Nnn \g_@@_alternative_values_prop { blue } { 0 , 0 , 1 } -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\color_model_new:nnn, \@@_model_new:nnn} -% Set up a new model: in general this has to be handled by a family-dependent -% function. To avoid some \enquote{interesting} questions with casing, we -% fold the case of the family name. The key--value list should always be -% present, so we convert it up-front to a |prop|, then deal with the detail -% on a per-family basis. -% \begin{macrocode} -\cs_new_protected:Npn \color_model_new:nnn #1#2#3 - { - \exp_args:Nee \@@_model_new:nnn - { \tl_to_str:n {#1} } - { \str_foldcase:n {#2} } {#3} - } -\cs_new_protected:Npn \@@_model_new:nnn #1#2#3 - { - \cs_if_exist:cTF { @@_parse_model_ #1 :w } - { - \__kernel_msg_error:nnn { color } { model-already-defined } {#1} - } - { - \cs_if_exist:cTF { @@_model_ #2 :n } - { - \prop_set_from_keyval:Nn \l_@@_internal_prop {#3} - \use:c { @@_model_ #2 :n } {#1} - } - { - \__kernel_msg_error:nnn { color } { unknown-model-type } {#2} - } - } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_model_separation:n} -% \begin{macro}{\@@_model_separation:nn} -% \begin{macro}{\@@_model_separation:nnn} -% \begin{macro}{\@@_model_separation:w} -% \begin{macro} -% { -% \@@_model_separation_cmyk:nnnnnn , -% \@@_model_separation_gray:nnnnnn , -% \@@_model_separation_rgb:nnnnnn -% } -% \begin{macro}{\@@_model_convert:nnn} -% \begin{macro}{\@@_model_separation_CIELAB:nnnnnn} -% \begin{macro}{\@@_model_separation_CIELAB:nnnnnnn} -% Separations must have a \enquote{real} name, which is pretty easy to find. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_separation:n #1 - { - \prop_get:NnNTF \l_@@_internal_prop { name } - \l_@@_internal_tl - { - \exp_args:NV \@@_model_separation:nn - \l_@@_internal_tl {#1} - } - { - \__kernel_msg_error:nnn { color } - { separation-requires-name } {#1} - } - } -% \end{macrocode} -% We have two keys to find at this stage: the alternative space model -% and linked values. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_separation:nn #1#2 - { - \prop_get:NnNTF \l_@@_internal_prop { alternative-model } - \l_@@_internal_tl - { - \exp_args:NV \@@_model_separation:nnn - \l_@@_internal_tl {#2} {#1} - } - { - \__kernel_msg_error:nnn { color } - { separation-alternative-model } {#2} - } - } -\cs_new_protected:Npn \@@_model_separation:nnn #1#2#3 - { - \cs_if_exist:cTF { @@_model_separation_ #1 :nnnnnn } - { - \prop_get:NnNTF \l_@@_internal_prop { alternative-values } - \l_@@_internal_tl - { - \exp_after:wN \@@_model_separation:w \l_@@_internal_tl - , 0 , 0 , 0 , 0 \s_@@_stop {#2} {#3} {#1} - } - { - \__kernel_msg_error:nnn { color } - { separation-alternative-values } {#2} - } - } - { - \__kernel_msg_error:nnn { color } - { unknown-alternative-model } {#1} - } - } -% \end{macrocode} -% As each alternative space leads to a different requirement for conversion, -% and as there are only a small number of choices, we manually split the data -% and then set up. Notice that mixing tints is really just the same -% as mixing \texttt{gray}. The \texttt{white} color is special, as it allows -% tints to be adjusted without an additional color space. To make sure the -% data is set for that at all group levels, we need to work on a per-level -% basis. Within the output, only the set-up needs the \enquote{real} name -% of the colorspace: we use a simple tracking number for general usage -% as this is a clear namespace without issues of escaping chars. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_separation:w - #1 , #2 , #3 , #4 , #5 \s_@@_stop #6#7#8 - { - \int_gincr:N \g_@@_model_int - \tl_const:cn { c_@@_fallback_ #6 _tl } { 1 } - \cs_new_eq:cN { @@_parse_mix_ #6 :nw } \@@_parse_mix_gray:nw - \cs_new:cpn { @@_parse_model_ #6 :w } ##1 , ##2 \s_@@_stop - { {#6} { \@@_parse_number:n {##1} } } - \clist_map_inline:nn { fill , stroke , select } - { - \cs_new_protected:cpx { @@_backend_ ##1 _ #6 :n } ####1 - { - \exp_not:c { @@_backend_ ##1 _ separation:nn } - { color \int_use:N \g_@@_model_int } {####1} - } - } - \use:c { @@_model_separation_ #8 :nnnnnn } - {#6} {#7} {#1} {#2} {#3} {#4} - \prop_gput:Nnn \g_@@_alternative_model_prop {#6} {#8} - \prop_gput:Nnx \g_@@_colorants_prop {#6} - { \str_convert_pdfname:n {#7} } - \cs_new_protected:cpx { @@_model_ #6 _white: } - { - \prop_put:Nnn \exp_not:N \l_@@_named_white_prop {#6} { 0 } - \exp_not:N \int_compare:nNnF { \tex_currentgrouplevel:D } = 0 - { \group_insert_after:N \exp_not:c { @@_model_ #6 _ white: } } - } - \use:c { @@_model_ #6 _white: } - } -\cs_new_protected:Npn \@@_model_separation_cmyk:nnnnnn #1#2#3#4#5#6 - { - \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop - { - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #4} ~ - \fp_eval:n {##1 * #5} ~ - \fp_eval:n {##1 * #6} - } - \@@_model_convert:nnn {#1} { cmyk } { rgb } - \@@_model_convert:nnn {#1} { cmyk } { gray } - \prop_gput:Nnn \g_@@_alternative_values_prop {#1} { #3 , #4 , #5 , #6 } - \@@_backend_separation_init:nnnnn {#2} { /DeviceCMYK } { } - { 0 ~ 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 ~ #6 } - } -\cs_new_protected:Npn \@@_model_separation_rgb:nnnnnn #1#2#3#4#5#6 - { - \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop - { - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #4} ~ - \fp_eval:n {##1 * #5} - } - \@@_model_convert:nnn {#1} { rgb } { cmyk } - \@@_model_convert:nnn {#1} { rgb } { gray } - \prop_gput:Nnn \g_@@_alternative_values_prop {#1} { #3 , #4 , #5 } - \@@_backend_separation_init:nnnnn {#2} { /DeviceRGB } { } - { 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 } - } -\cs_new_protected:Npn \@@_model_separation_gray:nnnnnn #1#2#3#4#5#6 - { - \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop - { - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} - } - \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 ~ ##2 \s_@@_stop - { \fp_eval:n {##1 * #3} } - \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop - { - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} ~ - \fp_eval:n {##1 * #3} - } - \prop_gput:Nnn \g_@@_alternative_values_prop {#1} {#3} - \@@_backend_separation_init:nnnnn {#2} { /DeviceGray } { } { 0 } {#3} - } -% \end{macrocode} -% Generic model conversion \emph{via} an alternative intermediate. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_convert:nnn #1#2#3 - { - \cs_new:cpx { @@_convert_ #1 _ #3 :w } ##1 ~ ##2 \s_@@_stop - { - \exp_not:N \exp_args:NNe \exp_not:N \use:nn - \exp_not:c { @@_convert_ #2 _ #3 :w } - { \exp_not:c { @@_convert_ #1 _ #2 :w } ##1 ~ ##2 \s_@@_stop } - \c_space_tl \exp_not:N \s_@@_stop - } - } -% \end{macrocode} -% Setting up for CIELAB needs a bit more work: there is the illuminant and -% the need for an appropriate object. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_separation_CIELAB:nnnnnn #1#2#3#4#5#6 - { - \prop_get:NnNF \l_@@_internal_prop { illuminant } - \l_@@_internal_tl - { - \__kernel_msg_error:nnn { color } - { CIELAB-requires-illuminant } {#1} - \tl_set:Nn \l_@@_internal_tl { d50 } - } - \exp_args:NV \@@_model_separation_CIELAB:nnnnnnn - \l_@@_internal_tl {#1} {#2} {#3} {#4} {#5} {#6} - } -% \end{macrocode} -% If a CIELAB space is being set up, we need the illuminant, then create -% the appropriate set up. At present, this doesn't include \texttt{BlackPoint} -% or \texttt{Range} data, but that may be added later. As CIELAB colors -% cannot be converted to anything else, we fallback to producing black: the -% user should set up a second model for colors set up this way. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_separation_CIELAB:nnnnnnn #1#2#3#4#5#6#7 - { - \tl_if_exist:cTF { c_@@_model_whitepoint_CIELAB_ #1 _tl } - { - \@@_backend_separation_init_CIELAB:nnn {#1} {#3} { #4 ~ #5 ~ #6 } - \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 ~ ##2 \s_@@_stop - { 0 ~ 0 ~ 0 ~ 1 } - \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 ~ ##2 \s_@@_stop - { 1 ~ 1 ~ 1 } - \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 ~ ##2 \s_@@_stop - { 1 } - } - { - \__kernel_msg_error:nnn { color } - { unknown-CIELAB-illuminant } {#1} - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\@@_model_devicen:n} -% \begin{macro}{\@@_model_devicen:nn} -% \begin{macro}{\@@_model_devicen:nnn} -% \begin{macro}{\@@_model_devicen:nnnn} -% \begin{macro} -% { -% \@@_model_devicen_parse_1:nn , -% \@@_model_devicen_parse_2:nn , -% \@@_model_devicen_parse_3:nn , -% \@@_model_devicen_parse_4:nn , -% \@@_model_devicen_parse_generic:nn -% } -% \begin{macro}[EXP]{\@@_model_devicen_parse:nw} -% \begin{macro}[EXP]{\@@_model_devicen_mix:nw} -% \begin{macro}{\@@_model_devicen_init:nnn} -% \begin{macro}{\@@_model_devicen_init:nnnn} -% \begin{macro}{\@@_model_devicen_tranform:w} -% \begin{macro} -% { -% \@@_model_devicen_tranform_1:nnnnn , -% \@@_model_devicen_tranform_3:nnnnn , -% \@@_model_devicen_tranform_4:nnnnn , -% } -% \begin{macro}{\@@_model_devicen_tranform:nnn} -% \begin{macro}[EXP]{\@@_model_devicen_colorant:n} -% \begin{macro}{\@@_model_devicen_convert:nnn} -% \begin{macro} -% { -% \@@_model_devicen_convert_cmyk:n , -% \@@_model_devicen_convert_gray:n , -% \@@_model_devicen_convert_rgb:n -% } -% \begin{macro}{\@@_model_devicen_convert:nnnn} -% \begin{macro}[EXP]{\@@_model_devicen_convert:n, \@@_model_devicen_convert_aux:n} -% \begin{macro}[EXP]{\@@_model_devicen_convert:w} -% \begin{macro}[EXP]{\@@_convert_devicen_cmyk:nnnnw} -% \begin{macro}[EXP]{\@@_convert_devicen_cmyk:nnnnnnnnn} -% \begin{macro}[EXP]{\@@_convert_devicen_cmyk_aux:nnnnw} -% \begin{macro}[EXP]{\@@_convert_devicen_gray:nw} -% \begin{macro}[EXP]{\@@_convert_devicen_gray:nnn} -% \begin{macro}[EXP]{\@@_convert_devicen_gray_aux:nw} -% \begin{macro}[EXP]{\@@_convert_devicen_rgb:nnnw} -% \begin{macro}[EXP]{\@@_convert_devicen_rgb:nnnnnnn} -% \begin{macro}[EXP]{\@@_convert_devicen_rgb_aux:nnnw} -% We require a list of component names here: one might call them colorants, -% but it's convenient to use \TeX{} names instead so we slightly adjust the -% terminology. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen:n #1 - { - \prop_get:NnNTF \l_@@_internal_prop { names } - \l_@@_internal_tl - { - \exp_args:NV \@@_model_devicen:nn - \l_@@_internal_tl {#1} - } - { - \__kernel_msg_error:nnn { color } - { DeviceN-requires-names } {#1} - } - } -% \end{macrocode} -% All valid models will have an alternative listed, either hard-coded for -% the core device ones, or dynamically added for Separations, etc. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen:nn #1#2 - { - \tl_clear:N \l_@@_model_tl - \clist_map_inline:nn {#1} - { - \prop_get:NnNTF \g_@@_alternative_model_prop {##1} - \l_@@_internal_tl - { - \tl_if_empty:NTF \l_@@_model_tl - { \tl_set_eq:NN \l_@@_model_tl \l_@@_internal_tl } - { - \str_if_eq:VVF \l_@@_model_tl \l_@@_internal_tl - { - \__kernel_msg_error:nnn { color } - { DeviceN-inconsistent-alternative } - {#2} - \clist_map_break:n { \use_none:nnnn } - } - } - } - { - \str_if_eq:nnF {##1} { none } - { - \__kernel_msg_error:nnn { color } - { DeviceN-no-alternative } - {#2} - } - } - } - \tl_if_empty:NTF \l_@@_model_tl - { - \__kernel_msg_error:nnn { color } - { DeviceN-no-alternative } {#2} - } - { \exp_args:NV \@@_model_devicen:nnn \l_@@_model_tl {#1} {#2} } - } -% \end{macrocode} -% We now complete the data we require by first finding out how many -% colorants there are, then moving on to begin constructing the function -% required to map to the alternative color space. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen:nnn #1#2#3 - { - \exp_args:Nx \@@_model_devicen:nnnn - { \clist_count:n {#2} } {#1} {#2} {#3} - } -% \end{macrocode} -% At this stage, we have checked everything is in place, so we can set up -% the \TeX{} and backend data structures. As for separations, it's not really -% possible in general to have a fallback, so we simply provide -% \enquote{black} for each element. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen:nnnn #1#2#3#4 - { - \int_gincr:N \g_@@_model_int - \tl_const:cx { c_@@_fallback_ #4 _tl } - { \prg_replicate:nn {#1} { 1 ~ } } - \cs_if_exist_use:cF { @@_model_devicen_parse_ #1 :nn } - { \@@_model_devicen_parse_generic:nn } - {#4} {#1} - \clist_map_inline:nn { fill , stroke , select } - { - \cs_new_protected:cpx { @@_backend_ ##1 _ #4 :n } ####1 - { - \exp_not:c { @@_backend_ ##1 _ devicen:nn } - { color \int_use:N \g_@@_model_int } {####1} - } - } - \cs_new_protected:cpx { @@_model_ #4 _white: } - { - \prop_put:Nnn \exp_not:N \l_@@_named_white_prop {#4} - { \prg_replicate:nn {#1} { 0 ~ } } - \exp_not:N \int_compare:nNnF { \tex_currentgrouplevel:D } = 0 - { \group_insert_after:N \exp_not:c { @@_model_ #4 _ white: } } - } - \use:c { @@_model_ #4 _white: } - \@@_model_devicen_init:nnn {#1} {#2} {#3} - \@@_model_devicen_convert:nnn {#4} {#2} {#3} - } -% \end{macrocode} -% For short lists of DeviceN colors, wee can use hand-tuned parsing. This -% lines up with other models, where we allow for up to four components. For -% larger spaces,. rather than limit artificially, we use a somewhat slow -% approach based on open-ended commas-lists. -% \begin{macrocode} -\cs_new_protected:cpn { @@_model_devicen_parse_1:nn } #1#2 - { - \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 \s_@@_stop - { {#1} { \@@_parse_number:n {##1} } } - \cs_new_eq:cN { @@_parse_mix_ #1 :nw } \@@_parse_mix_gray:nw - } -\cs_new_protected:cpn { @@_model_devicen_parse_2:nn } #1#2 - { - \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 , ##3 \s_@@_stop - { {#1} { \@@_parse_number:n {##1} ~ \@@_parse_number:n {##2} } } - \cs_new:cpn { @@_parse_mix_ #1 :nw } - ##1##2 ~ ##3 \s_@@_mark ##4 ~ ##5 \s_@@_stop - { - \fp_eval:n { ##2 * ##1 + ##4 * ( 1 - ##1 ) } \c_space_tl - \fp_eval:n { ##3 * ##1 + ##5 * ( 1 - ##1 ) } - } - } -\cs_new_protected:cpn { @@_model_devicen_parse_3:nn } #1#2 - { - \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 , ##3 , ##4 \s_@@_stop - { - {#1} - { - \@@_parse_number:n {##1} ~ - \@@_parse_number:n {##2} ~ - \@@_parse_number:n {##3} - } - } - \cs_new_eq:cN { @@_parse_mix_ #1 :nw } \@@_parse_mix_rgb:nw - } -\cs_new_protected:cpn { @@_model_devicen_parse_4:nn } #1#2 - { - \cs_new:cpn { @@_parse_model_ #1 :w } - ##1 , ##2 , ##3 , ##4 , ##5 \s_@@_stop - { - {#1} - { - \@@_parse_number:n {##1} ~ - \@@_parse_number:n {##2} ~ - \@@_parse_number:n {##3} ~ - \@@_parse_number:n {##4} - } - } - \cs_new_eq:cN { @@_parse_mix_ #1 :nw } \@@_parse_mix_cmyk:nw - } -\cs_new_protected:Npn \@@_model_devicen_parse_generic:nn #1#2 - { - \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 \s_@@_stop - { - {#1} - { \@@_model_devicen_parse:nw {#2} ##1 , ##2 , \q_nil , \s_@@_stop } - } - \cs_new:cpx { @@_parse_mix_ #1 :nw } - ##1 ##2 \s_@@_mark ##3 \s_@@_stop - { - \exp_not:N \@@_model_devicen_mix:nw {##1} - ##2 \c_space_tl \exp_not:N \q_nil \c_space_tl \exp_not:N \s_@@_mark - ##3 \c_space_tl \exp_not:N \q_nil \c_space_tl \exp_not:N \s_@@_stop - } - } -\cs_new:Npn \@@_model_devicen_parse:nw #1#2 , #3 \s_@@_stop - { - \int_compare:nNnT {#1} > 0 - { - \quark_if_nil:nTF {#2} - { \prg_replicate:nn {#1} { 0 ~ } } - { - \@@_parse_number:n {#2} - \int_compare:nNnT {#1} > 1 { ~ } - \exp_args:Nf \@@_model_devicen_parse:nw - { \int_eval:n { #1 - 1 } } #3 \s_@@_stop - } - } - } -\cs_new:Npn \@@_model_devicen_mix:nw #1#2 ~ #3 \s_@@_mark #4 ~ #5 \s_@@_stop - { - \fp_eval:n { #2 * #1 + #4 * ( 1 - #1 ) } - \quark_if_nil:oF { \tl_head:w #3 \q_stop } - { - \c_space_tl - \@@_model_devicen_mix:nw {#1} #3 \s_@@_mark #5 \s_@@_stop - } - } -% \end{macrocode} -% To construct the tint transformation, we have to use PostScript. The -% aim is to have the final tint for each device colorant as -% \[ -% 1 - \prod_{n} (1 - X_{n} D_{X_{n}}) -% \] -% where $X$ is a DeviceN colorant and $D$ is the amount of device colorant -% that the DeviceN colorant maps to. At the start of the process, the -% PostScript stack will contain the $X_{n}$ values, whilst we have the -% $D$ values on a per-DeviceN colorant basis. The more convenient approach -% for us is therefore to take each DeviceN colorant in turn and find the -% value $1 - X_{n} D_{X_{n}}$, multiplying as we go, and finalise with the -% subtraction. That contrasts to \pkg{colorspace}: it splits the process -% up by process color, which works better when you have a fixed list -% of colorants. (\pkg{colorspace} only supports up to $4$ DeviceN colors, -% and only \texttt{cmyk} as the alternative space.) To set this up, -% we first need to know the number of values in the target color space: -% this is easily handled as there are a very small range of possibles. -% Once we have that information, it's relatively easy to build the required -% PostScript using some generic code. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen_init:nnn #1#2#3 - { - \exp_args:Ne \@@_model_devicen_init:nnnn - { - \str_case:nn {#2} - { - { cmyk } { 4 } - { gray } { 1 } - { rgb } { 3 } - } - } - {#1} {#2} {#3} - } -% \end{macrocode} -% As we always need to split the alternative values into parts, we use a -% shared auxiliary and only use a minimal difference between code paths. -% Construction of the tint transformation is as far as possible done using -% loops, which means there are some inefficiencies for device colors in -% the \texttt{DeviceN} space: we roll the stack one-at-a-time even if there -% is a potential shortcut. However, that way there is nothing to special-case. -% Once this is sorted, we can write the tint transform object, which will -% remain as the last object until we sort out the final step: the colorant -% list. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen_init:nnnn #1#2#3#4 - { - \tl_set:Nx \l_@@_internal_tl - { \prg_replicate:nn {#1} { 1.0 ~ } } - \int_zero:N \l_@@_internal_int - \clist_map_inline:nn {#4} - { - \int_incr:N \l_@@_internal_int - \prop_get:NnN \g_@@_alternative_values_prop {##1} - \l_@@_value_tl - \exp_after:wN \@@_model_devicen_transform:w - \l_@@_value_tl , 0 , 0 , 0 \s_@@_stop {#1} {#2} - } - \tl_put_right:Nx \l_@@_internal_tl - { - \prg_replicate:nn {#1} - { neg ~ 1.0 ~ add ~ #1 ~ -1 ~ roll ~ } - \int_eval:n { #2 + 4 } ~ 4 ~ roll - \prg_replicate:nn {#2} { ~ pop } - } - \use:x - { - \@@_backend_devicen_init:nnn - { - \clist_map_function:nN {#4} - \@@_model_devicen_colorant:n - } - { - \str_case:nn {#3} - { - { cmyk } { /DeviceCMYK } - { gray } { /DeviceGray } - { rgb } { /DeviceRGB } - } - } - { \exp_not:V \l_@@_internal_tl } - } - } -\cs_new_protected:Npn \@@_model_devicen_transform:w - #1 , #2 , #3 , #4 , #5 \s_@@_stop #6#7 - { - \use:c { @@_model_devicen_transform_ #6 :nnnnn } - {#1} {#2} {#3} {#4} {#7} - } -\cs_new_protected:cpn { @@_model_devicen_transform_1:nnnnn } #1#2#3#4#5 - { \@@_model_devicen_transform:nnn {#5} { 1 } {#1} } -\cs_new_protected:cpn { @@_model_devicen_transform_3:nnnnn } #1#2#3#4#5 - { - \clist_map_inline { #1 , #2 , #3 } - { \@@_model_devicen_transform:nnn {#5} { 3 } {##1} } - } -\cs_new_protected:cpn { @@_model_devicen_transform_4:nnnnn } #1#2#3#4#5 - { - \clist_map_inline:nn { #1 , #2 , #3 , #4 } - { \@@_model_devicen_transform:nnn {#5} { 4 } {##1} } - } -\cs_new_protected:Npn \@@_model_devicen_transform:nnn #1#2#3 - { - \tl_put_right:Nx \l_@@_internal_tl - { - \fp_compare:nNnF {#3} = \c_zero_fp - { - \int_eval:n { #1 - \l_@@_internal_int + #2 } ~ index ~ - #3 ~ neg ~ mul ~ 1.0 ~ add ~ mul ~ - } - #2 ~ -1 ~ roll ~ - } - } -\cs_new:Npn \@@_model_devicen_colorant:n #1 - { - / \prop_item:Nn \g_@@_colorants_prop {#1} ~ - } -% \end{macrocode} -% Here we need to set up conversion from the DeviceN space to the alternative -% at the \TeX{} level. This also means supplying methods for inter-converting -% to other parameter-based spaces. Essentially the approach is exactly the same -% as the PostScript, just expressed in \TeX{} terms. -% \begin{macrocode} -\cs_new_protected:Npn \@@_model_devicen_convert:nnn #1#2#3 - { - \use:c { @@_model_devicen_convert_ #2 :nn } {#1} {#3} - } -\cs_new_protected:Npn \@@_model_devicen_convert_cmyk:nn #1#2 - { - \@@_model_convert:nnn {#1} { cmyk } { gray } - \@@_model_convert:nnn {#1} { cmyk } { rgb } - \@@_model_devicen_convert:nnnn {#1} { cmyk } { 4 } {#2} - } -\cs_new_protected:Npn \@@_model_devicen_convert_gray:nn #1#2 - { - \@@_model_convert:nnn {#1} { gray } { cmyk } - \@@_model_convert:nnn {#1} { gray } { rgb } - \@@_model_devicen_convert:nnnn {#1} { gray } { 1 } {#2} - } -\cs_new_protected:Npn \@@_model_devicen_convert_rgb:nn #1#2 - { - \@@_model_convert:nnn {#1} { rgb } { cmyk } - \@@_model_convert:nnn {#1} { rgb } { gray } - \@@_model_devicen_convert:nnnn {#1} { rgb } { 3 } {#2} - } -\cs_new_protected:Npn \@@_model_devicen_convert:nnnn #1#2#3#4 - { - \cs_new:cpx { @@_convert_ #1 _ #2 :w } ##1 \s_@@_stop - { - \exp_not:c { @@_convert_devicen_ #2 : \prg_replicate:nn {#3} { n } w } - \prg_replicate:nn {#3} { { 1 } } - ##1 \exp_not:N \s_@@_mark - \clist_map_function:nN {#4} \@@_model_devicen_convert:n - \exp_not:N \s_@@_stop - } - } -\cs_new:Npn \@@_model_devicen_convert:n #1 - { - { - \exp_args:Ne \@@_model_devicen_convert_aux:n - { \prop_item:Nn \g_@@_alternative_values_prop {#1} } - } - } -\cs_new:Npn \@@_model_devicen_convert_aux:n #1 - { \@@_model_devicen_convert_aux:w #1 , , , , \s_@@_stop } -\cs_new:Npn \@@_model_devicen_convert_aux:w #1 , #2 , #3 , #4 , #5 \s_@@_stop - { - {#1} - \tl_if_blank:nF {#2} - { - {#2} - \tl_if_blank:nF {#3} - { - {#3} - \tl_if_blank:nF {#4} { {#4} } - } - } - } -\cs_new:Npn \@@_convert_devicen_cmyk:nnnnw - #1#2#3#4#5 ~ #6 \s_@@_mark #7#8 \s_@@_stop - { - \@@_convert_devicen_cmyk:nnnnnnnnn {#5} {#1} {#2} {#3} {#4} #7 - #6 \s_@@_mark #8 \s_@@_stop - } -\cs_new:Npn \@@_convert_devicen_cmyk:nnnnnnnnn #1#2#3#4#5#6#7#8#9 - { - \use:e - { - \exp_not:N \@@_convert_devicen_cmyk_aux:nnnnw - { \fp_eval:n { #2 * (1 - (#1 * #6)) } } - { \fp_eval:n { #3 * (1 - (#1 * #7)) } } - { \fp_eval:n { #4 * (1 - (#1 * #8)) } } - { \fp_eval:n { #5 * (1 - (#1 * #9)) } } - } - } -\cs_new:Npn \@@_convert_devicen_cmyk_aux:nnnnw - #1#2#3#4 #5 \s_@@_mark #6 \s_@@_stop - { - \tl_if_blank:nTF {#5} - { - \fp_eval:n { 1 - #1 } ~ - \fp_eval:n { 1 - #2 } ~ - \fp_eval:n { 1 - #3 } ~ - \fp_eval:n { 1 - #4 } - } - { - \@@_convert_devicen_cmyk:nnnnw {#1} {#2} {#3} {#4} - #5 \s_@@_mark #6 \s_@@_stop - } - } -\cs_new:Npn \@@_convert_devicen_gray:nw - #1#2 ~ #3 \s_@@_mark #4#5 \s_@@_stop - { - \@@_convert_devicen_gray:nnn {#2} {#1} #4 - #3 \s_@@_mark #5 \s_@@_stop - } -\cs_new:Npn \@@_convert_devicen_gray:nnn #1#2#3 - { - \exp_arsgs:Ne \@@_convert_devicen_gray_aux:nw - { \fp_eval:n { #2 * (1 - (#1 * #3)) } } - } -\cs_new:Npn \@@_convert_devicen_gray_aux:nw - #1 #2 \s_@@_mark #3 \s_@@_stop - { - \tl_if_blank:nTF {#2} - { \fp_eval:n { 1 - #1 } } - { - \@@_convert_devicen_gray:nw {#1} - #2 \s_@@_mark #3 \s_@@_stop - } - } -\cs_new:Npn \@@_convert_devicen_rgb:nnnw - #1#2#3#4 ~ #5 \s_@@_mark #6#7 \s_@@_stop - { - \@@_convert_devicen_cmyk:nnnnnn {#4} {#1} {#2} {#3} #6 - #5 \s_@@_mark #7 \s_@@_stop - } -\cs_new:Npn \@@_convert_devicen_rgb:nnnnnnn #1#2#3#4#5#6#7 - { - \use:e - { - \exp_not:N \@@_convert_devicen_rgb_aux:nnnw - { \fp_eval:n { #2 * (1 - (#1 * #5)) } } - { \fp_eval:n { #3 * (1 - (#1 * #6)) } } - { \fp_eval:n { #4 * (1 - (#1 * #7)) } } - } - } -\cs_new:Npn \@@_convert_devicen_rgb_aux:nnnw - #1#2#3 #4 \s_@@_mark #5 \s_@@_stop - { - \tl_if_blank:nTF {#4} - { - \fp_eval:n { 1 - #1 } ~ - \fp_eval:n { 1 - #2 } ~ - \fp_eval:n { 1 - #3 } - } - { - \@@_convert_devicen_rgb:nnnw {#1} {#2} {#3} - #4 \s_@@_mark #5 \s_@@_stop - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Diagnostics} -% -% \begin{macro}{\color_show:n} -% \begin{macro}{\@@_show:n} -% Extract the information about a color and format for the user: the approach -% is similar to the keys module here. -% \begin{macrocode} -\cs_new_protected:Npn \color_show:n #1 - { - \msg_show:nnxxxx { LaTeX / color } { show } - {#1} - { - \@@_if_defined:nT {#1} - { - \exp_args:Nv \@@_show:n { l_@@_named_ #1 _tl } - \prop_map_function:cN - { l_@@_named_ #1 _prop } - \msg_show_item_unbraced:nn - } - } - { } - { } - } -\cs_new:Npn \@@_show:n #1 - { - \msg_show_item_unbraced:nn { model } {#1} - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \subsection{Messages} -% -% \begin{macrocode} -\__kernel_msg_new:nnnn { color } { CIELAB-requires-illuminant } - { CIELAB~color~space~'#1'~require~an~illuminant. } - { - LaTeX~has~been~asked~to~create~a~separation~color~space~using~ - CIELAB~specifications,~but~no~\\ \\ - \iow_indent:n { illuminant~=~ } - \\ \\ - key~was~given~with~the~correct~information.~LaTeX~will~use~illuminant~ - 'd50'~for~recovery. - } -\__kernel_msg_new:nnnn { color } { conversion-not-available } - { No~model~conversion~available~from~'#1'~to~'#2'. } - { - LaTeX~has~been~asked~to~convert~a~color~from~model~'#1'~ - to~model'#2',~but~there~is~no~method~available~to~do~that. - } -\__kernel_msg_new:nnnn { color } { DeviceN-inconsistent-alternative } - { DeviceN~color~spaces~require~a~single~alternative~space. } - { - LaTeX~has~been~asked~to~create~a~DeviceN~color~space~'#1',~ - but~the~constituent~colors~do~not~have~a~common~alternative~ - color. - } -\__kernel_msg_new:nnnn { color } { DeviceN-no-alternative } - { DeviceN~color~spaces~require~an~alternative~space. } - { - LaTeX~has~been~asked~to~create~a~DeviceN~color~space~'#1',~ - but~the~constituent~colors~do~not~all~have~a~device-based~alternative. - } -\__kernel_msg_new:nnnn { color } { DeviceN-requires-names } - { DeviceN~color~space~'#1'~require~a~list~of~names. } - { - LaTeX~has~been~asked~to~create~a~DeviceN~color~space,~ - but~no~\\ \\ - \iow_indent:n { names~=~ } - \\ \\ - key~was~given~with~the~correct~information. - } -\__kernel_msg_new:nnnn { color } { model-already-defined } - { Color~model~'#1'~already~defined. } - { - LaTeX~was~asked~to~define~a~new~color~model~called~'#1',~but~ - this~color~model~already~exists. - } -\__kernel_msg_new:nnnn { color } { separation-alternative-model } - { Separation~color~space~'#1'~require~an~alternative~model. } - { - LaTeX~has~been~asked~to~create~a~separation~color~space,~ - but~no~\\ \\ - \iow_indent:n { alternative-model~=~ } - \\ \\ - key~was~given~with~the~correct~information. - } -\__kernel_msg_new:nnnn { color } { separation-alternative-values } - { Separation~color~space~'#1'~require~values~for~the~alternative~space. } - { - LaTeX~has~been~asked~to~create~a~separation~color~space,~ - but~no~\\ \\ - \iow_indent:n { alternative-values~=~ } - \\ \\ - key~was~given~with~the~correct~information. - } -\__kernel_msg_new:nnnn { color } { separation-requires-name } - { Separation~color~space~'#1'~require~a~formal~name. } - { - LaTeX~has~been~asked~to~create~a~separation~color~space,~ - but~no~\\ \\ - \iow_indent:n { name~=~ } - \\ \\ - key~was~given~with~the~correct~information. - } -\__kernel_msg_new:nnnn { color } { unknown-color } - { Unknown~color~'#1'. } - { - LaTeX~has~been~asked~to~use~a~color~named~'#1',~ - but~this~has~never~been~defined. - } -\__kernel_msg_new:nnnn { color } { unknown-alternative-model } - { Separation~color~space~'#1'~require~an~valid~alternative~space. } - { - LaTeX~has~been~asked~to~create~a~separation~color~space,~ - but~the~model~given~as\\ \\ - \iow_indent:n { alternative-model~=~ } - \\ \\ - is~unknown. - } -\__kernel_msg_new:nnnn { color } { unknown-export-format } - { Unknown~export~format~'#1'. } - { - LaTeX~has~been~asked~to~export~a~color~in~format~'#1',~ - but~this~has~never~been~defined. - } -\__kernel_msg_new:nnnn { color } { unknown-CIELAB-illuminant } - { Unknown~illuminant~model~'#1'. } - { - LaTeX~has~been~asked~to~use~create~a~color~space~using~CIELAB~ - illuminant~'#1',~but~this~does~not~exist. - } -\__kernel_msg_new:nnnn { color } { unknown-model } - { Unknown~color~model~'#1'. } - { - LaTeX~has~been~asked~to~use~a~color~model~called~'#1',~ - but~this~model~is~not~set~up. - } -\__kernel_msg_new:nnnn { color } { unknown-model-type } - { Unknown~color~model~type~'#1'. } - { - LaTeX~has~been~asked~to~create~a~new~color~model~called~'#1',~ - but~this~type~of~model~was~never~set~up. - } -% \end{macrocode} -% -% \begin{macrocode} -\__kernel_msg_new:nnn { color } { show } - { - The~color~#1~ - \tl_if_empty:nTF {#2} - { is~undefined. } - { has~the~properties: #2 } - } -% \end{macrocode} -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \end{implementation} -% -% \PrintIndex diff --git a/macros/latex/contrib/l3experimental/l3color.ins b/macros/latex/contrib/l3experimental/l3color.ins deleted file mode 100644 index e1704a9715..0000000000 --- a/macros/latex/contrib/l3experimental/l3color.ins +++ /dev/null @@ -1,58 +0,0 @@ -\iffalse meta-comment - -File: l3color.ins - -Copyright (C) 2017-2021 The LaTeX Project - -It may be distributed and/or modified under the conditions of the -LaTeX Project Public License (LPPL), either version 1.3c of this -license or (at your option) any later version. The latest version -of this license is in the file - - http://www.latex-project.org/lppl.txt - -This file is part of the "l3experimental bundle" (The Work in LPPL) -and all files in that bundle must be distributed together. - ------------------------------------------------------------------------ - -The development version of the bundle can be found at - - https://github.com/latex3/latex3 - -for those people who are interested. - ------------------------------------------------------------------------ - -Any modification of this file should ensure that the copyright and -license information is placed in the derived files. - -\fi - -\input l3docstrip.tex -\askforoverwritefalse - -\preamble - -Copyright (C) 2017-2021 The LaTeX Project - -It may be distributed and/or modified under the conditions of -the LaTeX Project Public License (LPPL), either version 1.3c of -this license or (at your option) any later version. The latest -version of this license is in the file: - - http://www.latex-project.org/lppl.txt - -This file is part of the "l3experimental bundle" (The Work in LPPL) -and all files in that bundle must be distributed together. - -\endpreamble -% stop docstrip adding \endinput -\postamble -\endpostamble - -\keepsilent - -\generate{\file{l3color.sty}{\from{l3color.dtx}{package}}} - -\endbatchfile diff --git a/macros/latex/contrib/l3experimental/l3color.pdf b/macros/latex/contrib/l3experimental/l3color.pdf deleted file mode 100644 index aacda29a30..0000000000 Binary files a/macros/latex/contrib/l3experimental/l3color.pdf and /dev/null differ diff --git a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx index 29103416ee..64bc0cfa64 100644 --- a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-code.pdf b/macros/latex/contrib/l3experimental/l3draw-code.pdf index c52386b2b1..38889a0dc3 100644 Binary files a/macros/latex/contrib/l3experimental/l3draw-code.pdf and b/macros/latex/contrib/l3experimental/l3draw-code.pdf differ diff --git a/macros/latex/contrib/l3experimental/l3draw-layers.dtx b/macros/latex/contrib/l3experimental/l3draw-layers.dtx index 0ed23162fd..f193ceb4d6 100644 --- a/macros/latex/contrib/l3experimental/l3draw-layers.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-layers.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-paths.dtx b/macros/latex/contrib/l3experimental/l3draw-paths.dtx index bfad9e14a3..a846d4046a 100644 --- a/macros/latex/contrib/l3experimental/l3draw-paths.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-paths.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-points.dtx b/macros/latex/contrib/l3experimental/l3draw-points.dtx index 8c170eeb27..70e088d0cf 100644 --- a/macros/latex/contrib/l3experimental/l3draw-points.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-points.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-scopes.dtx b/macros/latex/contrib/l3experimental/l3draw-scopes.dtx index 4b28b10397..60792f27ed 100644 --- a/macros/latex/contrib/l3experimental/l3draw-scopes.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-scopes.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx index 2bda7e3c2d..9d70d5d7e2 100644 --- a/macros/latex/contrib/l3experimental/l3draw-softpath.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-softpath.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-state.dtx b/macros/latex/contrib/l3experimental/l3draw-state.dtx index 42709122b7..105120a391 100644 --- a/macros/latex/contrib/l3experimental/l3draw-state.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-state.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw-transforms.dtx b/macros/latex/contrib/l3experimental/l3draw-transforms.dtx index 880fff8b1a..839fce91a6 100644 --- a/macros/latex/contrib/l3experimental/l3draw-transforms.dtx +++ b/macros/latex/contrib/l3experimental/l3draw-transforms.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3experimental/l3draw.dtx b/macros/latex/contrib/l3experimental/l3draw.dtx index 68f83903ec..1b6cdd8ab9 100644 --- a/macros/latex/contrib/l3experimental/l3draw.dtx +++ b/macros/latex/contrib/l3experimental/l3draw.dtx @@ -110,7 +110,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -231,7 +231,7 @@ % \begin{syntax} % \cs{draw_linewidth:n} \Arg{width} % \end{syntax} -% Sets the width to be used for stroking to the \meta{width} (an +% Sets the width to be used for stroking to the \meta{width} (an % \meta{fp expr}). % \end{function} % @@ -268,7 +268,7 @@ % \draw_end: % \end{demo} % Setting an empty pattern will produce a solid line. -% +% % Note the \meta{pattern} interface here is different from that in \pkg{pgf}: % the list is comma-separated not given in brace groups. % \end{function} @@ -410,7 +410,7 @@ % Gives the co-ordinates of the point at \meta{angle} (an \meta{fp expr} in % \emph{degrees}) and \meta{radius}. The three-argument version accepts % two radii of different lengths. -% +% % Note the interface here is somewhat different from that in \pkg{pgf}: % the one- and two-radii versions in \pkg{l3draw} use separate functions, % whilst in \pkg{pgf} they use the same function and a keyword. @@ -470,7 +470,7 @@ % \emph{degrees}) and \meta{radius}, relative to the prevailing % $x$- and $y$-vectors. The three-argument version accepts two radii of % different lengths. -% +% % Note the interface here is somewhat different from that in \pkg{pgf}: % the one- and two-radii versions in \pkg{l3draw} use separate functions, % whilst in \pkg{pgf} they use the same function and a keyword. @@ -795,7 +795,7 @@ % \begin{syntax} % \cs{draw_path_circle:nn} \Arg{center} \Arg{radius} % \end{syntax} -% Appends a circle of \meta{radius} at \meta{center} to the current path. +% Appends a circle of \meta{radius} at \meta{center} to the current path. % This is a shortcut for \cs{draw_path_ellipse:nnn}. % \end{function} % @@ -1136,14 +1136,10 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3draw}{2021-02-06}{} +\ProvidesExplPackage{l3draw}{2021-02-18}{} {L3 Experimental core drawing support} % \end{macrocode} % -% \begin{macrocode} -\RequirePackage { l3color } -% \end{macrocode} -% % \subsection{Internal auxiliaries} % % \begin{variable}{\s_@@_mark,\s_@@_stop} diff --git a/macros/latex/contrib/l3experimental/l3draw.pdf b/macros/latex/contrib/l3experimental/l3draw.pdf index c93d56a3e6..d0eb491882 100644 Binary files a/macros/latex/contrib/l3experimental/l3draw.pdf and b/macros/latex/contrib/l3experimental/l3draw.pdf differ diff --git a/macros/latex/contrib/l3experimental/l3galley.dtx b/macros/latex/contrib/l3experimental/l3galley.dtx index 2209ce8d9e..1c7c9bd941 100644 --- a/macros/latex/contrib/l3experimental/l3galley.dtx +++ b/macros/latex/contrib/l3experimental/l3galley.dtx @@ -61,7 +61,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -686,7 +686,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3galley}{2021-02-06}{} +\ProvidesExplPackage{l3galley}{2021-02-18}{} {L3 Experimental galley code} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3galley.pdf b/macros/latex/contrib/l3experimental/l3galley.pdf index 4e836f86ad..743d8ac6f2 100644 Binary files a/macros/latex/contrib/l3experimental/l3galley.pdf and b/macros/latex/contrib/l3experimental/l3galley.pdf differ diff --git a/macros/latex/contrib/l3experimental/l3graphics.dtx b/macros/latex/contrib/l3experimental/l3graphics.dtx index c244ad7258..5b4144c062 100644 --- a/macros/latex/contrib/l3experimental/l3graphics.dtx +++ b/macros/latex/contrib/l3experimental/l3graphics.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -240,7 +240,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3graphics}{2021-02-06}{} +\ProvidesExplPackage{l3graphics}{2021-02-18}{} {L3 Experimental graphics inclusion support} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3graphics.pdf b/macros/latex/contrib/l3experimental/l3graphics.pdf index 835fc34762..2ae274ac53 100644 Binary files a/macros/latex/contrib/l3experimental/l3graphics.pdf and b/macros/latex/contrib/l3experimental/l3graphics.pdf differ diff --git a/macros/latex/contrib/l3experimental/l3pdf-code.pdf b/macros/latex/contrib/l3experimental/l3pdf-code.pdf deleted file mode 100644 index cc3e9f9c5e..0000000000 Binary files a/macros/latex/contrib/l3experimental/l3pdf-code.pdf and /dev/null differ diff --git a/macros/latex/contrib/l3experimental/l3pdf-code.tex b/macros/latex/contrib/l3experimental/l3pdf-code.tex deleted file mode 100644 index db2a7d5bf0..0000000000 --- a/macros/latex/contrib/l3experimental/l3pdf-code.tex +++ /dev/null @@ -1,56 +0,0 @@ -\iffalse meta-comment - -File: l3pdf-code.tex - -Copyright (C) 2019,2021 The LaTeX Project - -It may be distributed and/or modified under the conditions of the -LaTeX Project Public License (LPPL), either version 1.3c of this -license or (at your option) any later version. The latest version -of this license is in the file - - https://www.latex-project.org/lppl.txt - -This file is part of the "l3experimental bundle" (The Work in LPPL) -and all files in that bundle must be distributed together. - -The released version of this bundle is available from CTAN. - ------------------------------------------------------------------------ - -The development version of the bundle can be found at - - https://github.com/latex3/latex3 - -for those people who are interested. - -\fi - -\documentclass{l3doc} - -\begin{document} - -\makeatletter -\let\DelayPrintIndex\PrintIndex -\let\PrintIndex\@empty -\makeatother - -\ExplSyntaxOn -\clist_gput_right:Nn \g_docinput_clist - { - l3pdf.dtx , - } -\ExplSyntaxOff - -\part{Implementation} - -\def\maketitle{} -\EnableImplementation -\DisableDocumentation -\DocInputAgain - -\clearpage - -\DelayPrintIndex - -\end{document} diff --git a/macros/latex/contrib/l3experimental/l3pdf.dtx b/macros/latex/contrib/l3experimental/l3pdf.dtx deleted file mode 100644 index f5a5c72cfe..0000000000 --- a/macros/latex/contrib/l3experimental/l3pdf.dtx +++ /dev/null @@ -1,442 +0,0 @@ -% \iffalse meta-comment -% -%% File: l3pdf.dtx -% -% Copyright(C) 2019-2021 The LaTeX Project -% -% It may be distributed and/or modified under the conditions of the -% LaTeX Project Public License (LPPL), either version 1.3c of this -% license or (at your option) any later version. The latest version -% of this license is in the file -% -% http://www.latex-project.org/lppl.txt -% -% This file is part of the "l3experimental bundle" (The Work in LPPL) -% and all files in that bundle must be distributed together. -% -% ----------------------------------------------------------------------- -% -% The development version of the bundle can be found at -% -% https://github.com/latex3/latex3 -% -% for those people who are interested. -% -%<*driver|package> -\RequirePackage{expl3} -% -%<*driver> -\documentclass[full]{l3doc} -\begin{document} - \DocInput{\jobname.dtx} -\end{document} -% -% \fi -% -% \title{^^A -% The \pkg{l3pdf} package\\ Core PDF support^^A -% } -% -% \author{^^A -% The \LaTeX{} Project\thanks -% {^^A -% E-mail: -% \href{mailto:latex-team@latex-project.org} -% {latex-team@latex-project.org}^^A -% }^^A -% } -% -% \date{Released 2021-02-06} -% -% \maketitle -% -% \begin{documentation} -% -% \section{\pkg{l3pdf} documentation} -% -% \subsection{Objects} -% -% \begin{function}[added = 2019-06-02]{\pdf_object_new:nn} -% \begin{syntax} -% \cs{pdf_object_new:nn} \Arg{object} \Arg{type} -% \end{syntax} -% Declares \meta{object} as a PDF object of \meta{type}, which should be -% one of -% \begin{itemize} -% \item \texttt{array} -% \item \texttt{dict} -% \item \texttt{fstream} -% \item \texttt{stream} -% \end{itemize} -% The object may be referenced from this point on, and written later -% using \cs{pdf_object_write:nn}. -% \end{function} -% \begin{function}[EXP, pTF, added=2020-05-15]{\pdf_object_if_exist:n} -% \begin{syntax} -% \cs{pdf_object_if_exist_p:n} \Arg{object} -% \cs{pdf_object_if_exist:nTF} \Arg{object} -% \end{syntax} -% Tests whether an object with name \Arg{object} has been defined. -% \end{function} -% \begin{function}[added = 2019-06-02] -% {\pdf_object_write:nn, \pdf_object_write:nx} -% \begin{syntax} -% \cs{pdf_object_write:nn} \Arg{object} \Arg{content} -% \end{syntax} -% Writes the \meta{content} as content of the \meta{object}. Depending on the -% \meta{type} declared for the object, the format required for the -% \meta{data} will vary -% \begin{itemize} -% \item[\texttt{array}] A space-separated list of values -% \item[\texttt{dict}] Key--value pairs in the form -% \texttt{/\meta{key} \meta{value}} -% \item[\texttt{fstream}] Two brace groups: \meta{file name} and -% \meta{file content} -% \item[\texttt{stream}] Two brace groups: \meta{attributes (dictionary)} -% and \meta{stream contents} -% \end{itemize} -% \end{function} -% -% \begin{function}[EXP, added = 2019-06-02]{\pdf_object_ref:n} -% \begin{syntax} -% \cs{pdf_object_ref:n} \Arg{object} -% \end{syntax} -% Inserts the appropriate information to reference the \meta{object} -% in for example page resource allocation -% \end{function} -% -% \begin{function}[added = 2019-06-02] -% {\pdf_object_now:nn, \pdf_object_now:nx} -% \begin{syntax} -% \cs{pdf_object_now:nn} \Arg{type} \Arg{content} -% \end{syntax} -% Writes the \meta{content} as content of an anonymous object. Depending on the -% \meta{type}, the format required for the \meta{data} will vary -% \begin{itemize} -% \item[\texttt{array}] A space-separated list of values -% \item[\texttt{dict}] Key--value pairs in the form -% \texttt{/\meta{key} \meta{value}} -% \item[\texttt{fstream}] Two brace groups: \meta{file name} and -% \meta{file content} -% \item[\texttt{stream}] Two brace groups: \meta{attributes (dictionary)} -% and \meta{stream contents} -% \end{itemize} -% \end{function} -% -% \begin{function}[EXP, added = 2019-06-02]{\pdf_object_last:} -% \begin{syntax} -% \cs{pdf_object_last:} -% \end{syntax} -% Inserts the appropriate information to reference the last \meta{object} -% created. This is particularly useful for anonymous objects. -% \end{function} -% -% \subsection{Version} -% -% \begin{function}[pTF, EXP, added = 2019-06-02]{\pdf_version_compare:Nn} -% \begin{syntax} -% \cs{pdf_version_compare:NnTF} \meta{comparator} \Arg{version} \Arg{true code} \Arg{false code} -% \end{syntax} -% Compares the version of the PDF being created with the \meta{version} -% string specified, using the \meta{comparator}. Either the \meta{true code} -% or \meta{false code} will be left in the output stream. -% \end{function} -% -% \begin{function}[added = 2019-06-02] -% {\pdf_version_gset:n, \pdf_version_min_gset:n} -% \begin{syntax} -% \cs{pdf_version_gset:n} \Arg{version} -% \end{syntax} -% Sets the \meta{version} of the PDF being created. The |min| version will -% not alter the output version unless it is currently lower than the -% \meta{version} requested. -% -% This function may only be used up to the point where the PDF file is -% initialised. -% \end{function} -% -% \begin{function}[EXP, added = 2019-06-02] -% {\pdf_version:, \pdf_version_major:, \pdf_version_minor:} -% \begin{syntax} -% \cs{pdf_version:} -% \end{syntax} -% Expands to the currently-active PDF version. -% \end{function} -% -% \subsection{Compression} -% -% \begin{function}[added = 2019-06-02]{\pdf_uncompress:} -% \begin{syntax} -% \cs{pdf_uncompress:} -% \end{syntax} -% Disables any compression of the PDF, where possible. -% -% This function may only be used up to the point where the PDF file is -% initialised. -% \end{function} -% -% \subsection{Destinations} -% -% Destinations are the places a link jumped too. -% Unlike the name may suggest they don't described -% an exact location in the PDF. Instead a destination contains a reference to -% a page along with an instruction how to display this page. -% The normally used \enquote{XYZ \textit{top left zoom}} for example instructs -% the viewer to show the page with the given \textit{zoom} and -% the top left corner at the \textit{top left} coordinates---which then gives -% the impression that there is an anchor at this position. -% -% If an instruction takes a coordinate, it is calculated by the following -% commands relative to the location the command is issued. -% So to get a specific coordinate one has to move the command to the right place. -% -% \begin{function}[added = 2021-01-03] -% {\pdf_destination:nn} -% \begin{syntax} -% \cs{pdf_destination:nn} \Arg{name} \Arg{type or integer} -% \end{syntax} -% This creates a destination. \Arg{type or integer} can be one of |fit|, |fith|, -% |fitv|, |fitb|, |fitbh|, |fitbv|, |fitr|, |xyz| -% or an integer representing a scale factor in percent. -% |fitr| here gives only a lightweight version of |/FitR|: -% The backend code defines |fitr| so that it will with pdf\LaTeX{} and -% Lua\LaTeX{} use the coordinates of the surrounding box, -% with \texttt{dvips} and \texttt{dvipdfmx} it falls back to |fit|. -% For full control use \cs{pdf_destination:nnnn}. -% -% The keywords match to the PDF names as described in the following tabular. -% -% \medskip -% \noindent\begin{tabular}{ll>{\raggedright\arraybackslash}p{6cm}} -% \toprule -% Keyword & PDF & Remarks \\ \midrule -% |fit| & |/Fit| -% & Fits the page to the window\\ -% |fith| & |/FitH| \textit{top} -% & Fits the width of the page to the window \\ -% |fitv| & |/FitV| \textit{left} -% & Fits the height of the page to the window \\ -% |fitb| & |/FitB| -% & Fits the page bounding box to the window \\ -% |fitbh|& |/FitBH| \textit{top} -% & Fits the width of the page bounding box to the window. \\ -% |fitbv|& |/FitBV| \textit{left} -% & Fits the height of the page bounding box to the window. \\ -% |fitr| & |/FitR| \textit{left bottom right top} -% & Fits the rectangle specified by the four coordinates to the window -% (see above for the restrictions)\\ -% |xyz| & |/XYZ| \textit{left top} null -% & Sets a coordinate but doesn't change the zoom.\\ -% \Arg{integer} & |/XYZ| \textit{left top zoom} -% & Sets a coordinate and a zoom meaning \Arg{integer}\%. -% \\\bottomrule -% \end{tabular} -% -% \end{function} -% -% \begin{function}[added = 2021-01-17] -% {\pdf_destination:nnnn} -% \begin{syntax} -% \cs{pdf_destination:nnnn} \Arg{name} \Arg{width} \Arg{height} \Arg{depth} -% \end{syntax} -% This creates a destination with |/FitR| type with the given dimensions relative -% to the current location. The destination is in a box of size zero, but it doesn't -% switch to horizontal mode. -% \end{function} -% \end{documentation} -% -% \begin{implementation} -% -% \section{\pkg{l3pdf} implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \begin{macrocode} -%<@@=pdf> -% \end{macrocode} -% -% \begin{macrocode} -\ProvidesExplPackage{l3pdf}{2021-02-06}{} - {L3 Experimental core PDF support} -% \end{macrocode} -% -% \begin{variable}{\s_@@_stop} -% Internal scan marks. -% \begin{macrocode} -\scan_new:N \s_@@_stop -% \end{macrocode} -% \end{variable} -% -% \begin{variable}{\g_@@_init_bool} -% A flag so we have some chance of avoiding setting things we are not -% allowed to. -% \begin{macrocode} -\bool_new:N \g_@@_init_bool -%<*package> -\cs_if_exist:NT \documentclass - { - \AtBeginDocument - { \bool_gset_true:N \g_@@_init_bool } - } -% -% \end{macrocode} -% \end{variable} -% -% \subsection{Compression} -% -% \begin{macro}{\pdf_uncompress:} -% Simple to do. -% \begin{macrocode} -\cs_new_protected:Npn \pdf_uncompress: - { - \bool_if:NF \g_@@_init_bool - { - \@@_backend_compresslevel:n { 0 } - \@@_backend_compress_objects:n { \c_false_bool } - } - } -% \end{macrocode} -% \end{macro} -% -% \subsection{Objects} -% -% \begin{macro}{\pdf_object_new:nn, \pdf_object_write:nn, \pdf_object_write:nx} -% \begin{macro}[pTF]{\pdf_object_if_exist:n} -% \begin{macro}{\pdf_object_ref:n} -% \begin{macro}{\pdf_object_now:nn, \pdf_object_now:nx} -% \begin{macro}{\pdf_object_last:} -% Simple to do. -% \begin{macrocode} -\cs_new_protected:Npn \pdf_object_new:nn #1#2 - { \@@_backend_object_new:nn {#1} {#2} } -\prg_new_conditional:Npnn \pdf_object_if_exist:n #1 { p , T , F , TF } - { - \int_if_exist:cTF { c__pdf_backend_object_ \tl_to_str:n {#1} _int } - { \prg_return_true: } - { \prg_return_false:} - } -\cs_new_protected:Npn \pdf_object_write:nn #1#2 - { \@@_backend_object_write:nn {#1} {#2} } -\cs_generate_variant:Nn \pdf_object_write:nn { nx } -\cs_new:Npn \pdf_object_ref:n #1 { \@@_backend_object_ref:n {#1} } -\cs_new_protected:Npn \pdf_object_now:nn #1#2 - { \@@_backend_object_now:nn {#1} {#2} } -\cs_generate_variant:Nn \pdf_object_now:nn { nx } -\cs_new:Npn \pdf_object_last: { \@@_backend_object_last: } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% \subsection{Version} -% -% \begin{macro}{\pdf_version_compare:Nn} -% \begin{macro} -% { -% @@_version_compare_=:w , -% @@_version_compare_<:w , -% @@_version_compare_>:w -% } -% \begin{macrocode} -% To compare version, we need to split the given value then deal with both -% major and minor version -\prg_new_conditional:Npnn \pdf_version_compare:Nn #1#2 { p , T , F , TF } - { \use:c { @@_version_compare_ #1 :w } #2 . . \s_@@_stop } -\cs_new:cpn { @@_version_compare_=:w } #1 . #2 . #3 \s_@@_stop - { - \bool_lazy_and:nnTF - { \int_compare_p:nNn \@@_backend_version_major: = {#1} } - { \int_compare_p:nNn \@@_backend_version_minor: = {#2} } - { \prg_return_true: } - { \prg_return_false: } - } -\cs_new:cpn { @@_version_compare_<:w } #1 . #2 . #3 \s_@@_stop - { - \bool_lazy_or:nnTF - { \int_compare_p:nNn \@@_backend_version_major: < {#1} } - { - \bool_lazy_and_p:nn - { \int_compare_p:nNn \@@_backend_version_major: = {#1} } - { \int_compare_p:nNn \@@_backend_version_minor: < {#2} } - } - { \prg_return_true: } - { \prg_return_false: } - } -\cs_new:cpn { @@_version_compare_>:w } #1 . #2 . #3 \s_@@_stop - { - \bool_lazy_or:nnTF - { \int_compare_p:nNn \@@_backend_version_major: > {#1} } - { - \bool_lazy_and_p:nn - { \int_compare_p:nNn \@@_backend_version_major: = {#1} } - { \int_compare_p:nNn \@@_backend_version_minor: > {#2} } - } - { \prg_return_true: } - { \prg_return_false: } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\pdf_version_gset:n, \pdf_version_min_gset:n} -% \begin{macro}{\@@_version_gset:w} -% Split the version and set. -% \begin{macrocode} -\cs_new_protected:Npn \pdf_version_gset:n #1 - { \@@_version_gset:w #1 . . \s_@@_stop } -\cs_new_protected:Npn \pdf_version_min_gset:n #1 - { - \pdf_version_compare:NnT < {#1} - { \@@_version_gset:w #1 . . \s_@@_stop } - } -\cs_new_protected:Npn \@@_version_gset:w #1 . #2 . #3\s_@@_stop - { - \bool_if:NF \g_@@_init_bool - { - \@@_backend_version_major_gset:n {#1} - \@@_backend_version_minor_gset:n {#2} - } - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}[EXP]{\pdf_version:, \pdf_version_major:, \pdf_version_minor:} -% Wrappers. -% \begin{macrocode} -\cs_new:Npn \pdf_version: - { \@@_backend_version_major: . \@@_backend_version_minor: } -\cs_new:Npn \pdf_version_major: { \@@_backend_version_major: } -\cs_new:Npn \pdf_version_minor: { \@@_backend_version_minor: } -% \end{macrocode} -% \end{macro} -% -% \subsection{Destinations} -% -% \begin{macro}{\pdf_destination:nn} -% \begin{macrocode} -\cs_new_protected:Npn \pdf_destination:nn #1 #2 - { \@@_backend_destination:nn {#1}{#2} } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pdf_destination:nnnn} -% \begin{macrocode} -\cs_new_protected:Npn \pdf_destination:nnnn #1 #2 #3 #4 - { - \hbox_to_zero:n - { \@@_backend_destination:nnnn {#1} {#2} {#3} {#4} } - } -% \end{macrocode} -% \end{macro} -% \begin{macrocode} -% -% \end{macrocode} -% -% \end{implementation} -% -% \PrintIndex diff --git a/macros/latex/contrib/l3experimental/l3pdf.ins b/macros/latex/contrib/l3experimental/l3pdf.ins deleted file mode 100644 index e422ceb995..0000000000 --- a/macros/latex/contrib/l3experimental/l3pdf.ins +++ /dev/null @@ -1,60 +0,0 @@ -\iffalse meta-comment - -File: l3pdf.ins - -Copyright (C) 2019-2021 The LaTeX Project - -It may be distributed and/or modified under the conditions of the -LaTeX Project Public License (LPPL), either version 1.3c of this -license or (at your option) any later version. The latest version -of this license is in the file - - http://www.latex-project.org/lppl.txt - -This file is part of the "l3experimental bundle" (The Work in LPPL) -and all files in that bundle must be distributed together. - ------------------------------------------------------------------------ - -The development version of the bundle can be found at - - https://github.com/latex3/latex3 - -for those people who are interested. - ------------------------------------------------------------------------ - -Any modification of this file should ensure that the copyright and -license information is placed in the derived files. - -\fi - -\input l3docstrip.tex -\askforoverwritefalse - -\preamble - -Copyright (C) 2019-2021 The LaTeX Project - -It may be distributed and/or modified under the conditions of -the LaTeX Project Public License (LPPL), either version 1.3c of -this license or (at your option) any later version. The latest -version of this license is in the file: - - http://www.latex-project.org/lppl.txt - -This file is part of the "l3pdf bundle" (The Work in LPPL) -and all files in that bundle must be distributed together. - -\endpreamble -% stop docstrip adding \endinput -\postamble -\endpostamble - -\keepsilent - -\generate{\file{l3pdf.sty} - {\from{l3pdf.dtx}{package}} -} - -\endbatchfile diff --git a/macros/latex/contrib/l3experimental/l3pdf.pdf b/macros/latex/contrib/l3experimental/l3pdf.pdf deleted file mode 100644 index 38b9038f82..0000000000 Binary files a/macros/latex/contrib/l3experimental/l3pdf.pdf and /dev/null differ diff --git a/macros/latex/contrib/l3experimental/l3str-format.dtx b/macros/latex/contrib/l3experimental/l3str-format.dtx index e39f2e7e03..9b0cf4a5a4 100644 --- a/macros/latex/contrib/l3experimental/l3str-format.dtx +++ b/macros/latex/contrib/l3experimental/l3str-format.dtx @@ -48,7 +48,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -166,7 +166,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3str-format}{2021-02-06}{} +\ProvidesExplPackage{l3str-format}{2021-02-18}{} {L3 Experimental string formatting} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3str-format.pdf b/macros/latex/contrib/l3experimental/l3str-format.pdf index df1b4600dc..b0b07a632e 100644 Binary files a/macros/latex/contrib/l3experimental/l3str-format.pdf and b/macros/latex/contrib/l3experimental/l3str-format.pdf differ diff --git a/macros/latex/contrib/l3experimental/l3sys-shell.dtx b/macros/latex/contrib/l3experimental/l3sys-shell.dtx index 2e1d15d8db..9a7920fe3f 100644 --- a/macros/latex/contrib/l3experimental/l3sys-shell.dtx +++ b/macros/latex/contrib/l3experimental/l3sys-shell.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -135,7 +135,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{l3sys-shell}{2021-02-06}{} +\ProvidesExplPackage{l3sys-shell}{2021-02-18}{} {L3 Experimental system shell functions} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/l3sys-shell.pdf b/macros/latex/contrib/l3experimental/l3sys-shell.pdf index a2de0baee3..44d84d1d9b 100644 Binary files a/macros/latex/contrib/l3experimental/l3sys-shell.pdf and b/macros/latex/contrib/l3experimental/l3sys-shell.pdf differ diff --git a/macros/latex/contrib/l3experimental/xcoffins.dtx b/macros/latex/contrib/l3experimental/xcoffins.dtx index 37ef1c2cfe..86d3add8ae 100644 --- a/macros/latex/contrib/l3experimental/xcoffins.dtx +++ b/macros/latex/contrib/l3experimental/xcoffins.dtx @@ -53,7 +53,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -672,7 +672,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xcoffins}{2021-02-06}{} +\ProvidesExplPackage{xcoffins}{2021-02-18}{} {L3 Experimental design level coffins} % \end{macrocode} % diff --git a/macros/latex/contrib/l3experimental/xcoffins.pdf b/macros/latex/contrib/l3experimental/xcoffins.pdf index 6c76fdd7b2..cb1e4bd9ad 100644 Binary files a/macros/latex/contrib/l3experimental/xcoffins.pdf and b/macros/latex/contrib/l3experimental/xcoffins.pdf differ diff --git a/macros/latex/contrib/l3experimental/xgalley.dtx b/macros/latex/contrib/l3experimental/xgalley.dtx index 9292de0889..680e288fe3 100644 --- a/macros/latex/contrib/l3experimental/xgalley.dtx +++ b/macros/latex/contrib/l3experimental/xgalley.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -731,7 +731,7 @@ % \end{macrocode} % % \begin{macrocode} -\ProvidesExplPackage{xgalley}{2021-02-06}{} +\ProvidesExplPackage{xgalley}{2021-02-18}{} {L3 Experimental galley} \RequirePackage{xtemplate,l3galley} % \end{macrocode} diff --git a/macros/latex/contrib/l3experimental/xgalley.pdf b/macros/latex/contrib/l3experimental/xgalley.pdf index 3d8a23cec1..b882769cf5 100644 Binary files a/macros/latex/contrib/l3experimental/xgalley.pdf and b/macros/latex/contrib/l3experimental/xgalley.pdf differ diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md index 2f39d7d20d..9663dc0551 100644 --- a/macros/latex/contrib/l3kernel/CHANGELOG.md +++ b/macros/latex/contrib/l3kernel/CHANGELOG.md @@ -7,6 +7,17 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2021-02-18] + +### Added +- `l3color`: Moved from `l3experimental` +- `l3pdf`: Moved from `l3experimental` +- `default` alias to str_convert + +### Changed +- Re-ordered `interface3` documentation +- Moved `msg_show:nn(nnnn)` to stable + ## [2021-02-06] ### Changed @@ -755,35 +766,35 @@ this project uses date-based 'snapshot' version identifiers. ## [2018-05-13] ### Fixed -- Cor­rect date string in `ex­pl3.dtx` -- Cor­rect `\c_sys_en­gine_ver­sion_str` when using XeTeX +- Correct date string in `expl3.dtx` +- Correct `\c_sys_engine_version_str` when using XeTeX ## [2018-05-12] ### Added - Define `\c_zero_int` and `\c_one_int` -- Im­ple­ment `\c_sys_en­gine_ver­sion_str` -- Im­ple­ment `\seq_in­dexed_map_func­tion/in­line` -- Im­ple­ment `\in­tar­ray_gzero:N` -- Im­ple­ment `\in­tar­ray_const_from_clist:Nn` -- Im­ple­ment `\bool_set_in­verse:N` -- Im­ple­ment `\bool_xor:nnTF` in­stead of just `\bool_xor_p:nn` -- Im­ple­ment can­di­date `\int_rand:n` -- Im­ple­ment `\in­tar­ray_gset_rand:Nnn` -- Im­ple­ment can­di­date `l3f­par­ray` mod­ule +- Implement `\c_sys_engine_version_str` +- Implement `\seq_indexed_map_function/inline` +- Implement `\intarray_gzero:N` +- Implement `\intarray_const_from_clist:Nn` +- Implement `\bool_set_inverse:N` +- Implement `\bool_xor:nnTF` instead of just `\bool_xor_p:nn` +- Implement candidate `\int_rand:n` +- Implement `\intarray_gset_rand:Nnn` +- Implement candidate `l3fparray` module ## Changed -- Up­date min­i­mal re­quired ver­sions of XeTeX and LuaTeX -- Dep­re­cate named in­te­ger con­stants `\c_zero`. etc. -- Move all prim­i­tives to `\tex_...:D names­pace`, - dep­re­cat­ing older en­gine-de­pen­dent pre­fixes +- Update minimal required versions of XeTeX and LuaTeX +- Deprecate named integer constants `\c_zero`. etc. +- Move all primitives to `\tex_...:D namespace`, + deprecating older engine-dependent prefixes - Several internal optimisations ### Fixed -- Ex­pand boolean ex­pres­sion be­fore call­ing `\chardef` (fixes #461) +- Expand boolean expression before calling `\chardef` (fixes #461) ### Removed -- Re­move un­doc­u­mented `\fp_func­tion:Nw` and `\fp_new_func­tion:Npn` +- Remove undocumented `\fp_function:Nw` and `\fp_new_function:Npn` ## [2018-04-30] @@ -833,10 +844,11 @@ this project uses date-based 'snapshot' version identifiers. ### Added - Tuple support in fp expressions -- Step func­tions have been added for dim vari­ables, - e.g. `\dim_step_in­line:nnnn` +- Step functions have been added for dim variables, + e.g. `\dim_step_inline:nnnn` -[Unreleased]: https://github.com/latex3/latex3/compare/2021-02-06...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2021-02-18...HEAD +[2021-02-18]: https://github.com/latex3/latex3/compare/2021-02-06...2021-02-18 [2021-02-06]: https://github.com/latex3/latex3/compare/2021-02-02...2021-02-06 [2021-02-02]: https://github.com/latex3/latex3/compare/2021-01-09...2021-02-02 [2021-01-09]: https://github.com/latex3/latex3/compare/2020-12-07...2021-01-09 diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md index 5e74712262..42b975abcc 100644 --- a/macros/latex/contrib/l3kernel/README.md +++ b/macros/latex/contrib/l3kernel/README.md @@ -1,7 +1,7 @@ LaTeX3 Programming Conventions ============================== -Release 2021-02-06 +Release 2021-02-18 Overview -------- diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx index bf589f7c8c..23bbb5a808 100644 --- a/macros/latex/contrib/l3kernel/expl3.dtx +++ b/macros/latex/contrib/l3kernel/expl3.dtx @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> % -\def\ExplFileDate{2021-02-06}% +\def\ExplFileDate{2021-02-18}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf index cf1c397ce1..14921ac34f 100644 Binary files a/macros/latex/contrib/l3kernel/expl3.pdf and b/macros/latex/contrib/l3kernel/expl3.pdf differ diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf index 62ac1b4490..f07ab43a0b 100644 Binary files a/macros/latex/contrib/l3kernel/interface3.pdf and b/macros/latex/contrib/l3kernel/interface3.pdf differ diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex index 3243a6e00e..10449fd474 100644 --- a/macros/latex/contrib/l3kernel/interface3.tex +++ b/macros/latex/contrib/l3kernel/interface3.tex @@ -1,6 +1,6 @@ \iffalse meta-comment -File: interfaces3.tex +File: interface3.tex Copyright (C) 1990-2011,2017-2021 The LaTeX Project @@ -54,7 +54,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2021-02-06} +\date{Released 2021-02-18} \pagenumbering{roman} \maketitle diff --git a/macros/latex/contrib/l3kernel/l3.ins b/macros/latex/contrib/l3kernel/l3.ins index d9ecef35e0..91c471e75e 100644 --- a/macros/latex/contrib/l3kernel/l3.ins +++ b/macros/latex/contrib/l3kernel/l3.ins @@ -99,7 +99,8 @@ and all files in that bundle must be distributed together. \from{l3tl-analysis.dtx}{package} \from{l3regex.dtx} {package} \from{l3box.dtx} {package} - \from{l3color-base.dtx} {package} + \from{l3color.dtx} {package} + \from{l3pdf.dtx} {package} \from{l3coffins.dtx} {package} \from{l3luatex.dtx} {package,tex} \from{l3unicode.dtx} {package} diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx index 535226f9b4..9a82102634 100644 --- a/macros/latex/contrib/l3kernel/l3basics.dtx +++ b/macros/latex/contrib/l3kernel/l3basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx index 2849deda77..81fb06a579 100644 --- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx +++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx index 0247deaf42..5dcf864f73 100644 --- a/macros/latex/contrib/l3kernel/l3box.dtx +++ b/macros/latex/contrib/l3kernel/l3box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx index a19ed84dd3..aa0f4e1f8a 100644 --- a/macros/latex/contrib/l3kernel/l3candidates.dtx +++ b/macros/latex/contrib/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -86,8 +86,6 @@ % % \section{Additions to \pkg{l3box}} % -% \subsection{Viewing part of a box} -% % \begin{function}[updated = 2019-01-23] % {\box_clip:N, \box_clip:c, \box_gclip:N, \box_gclip:c} % \begin{syntax} @@ -254,8 +252,6 @@ % This is not available in older versions of \XeTeX{}. % \end{function} % -% \subsection{Working with contents of integer arrays} -% % \begin{function}[added = 2018-05-04, rEXP]{\intarray_to_clist:N} % \begin{syntax} % \cs{intarray_to_clist:N} \meta{intarray~var} @@ -279,32 +275,6 @@ % |1+2| then this logs |> 1+2=3.| % \end{function} % -% \begin{function}[added = 2017-12-04] -% { -% \msg_show:nnnnnn , -% \msg_show:nnnnn , -% \msg_show:nnnn , -% \msg_show:nnn , -% \msg_show:nn , -% \msg_show:nnxxxx , -% \msg_show:nnxxx , -% \msg_show:nnxx , -% \msg_show:nnx -% } -% \begin{syntax} -% \cs{msg_show:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} -% \end{syntax} -% Issues \meta{module} information \meta{message}, passing \meta{arg -% one} to \meta{arg four} to the text-creating functions. The -% information text is shown on the terminal and the \TeX{} run is -% interrupted in a manner similar to \cs{tl_show:n}. This is used in -% conjunction with \cs{msg_show_item:n} and similar functions to print -% complex variable contents completely. If the formatted text does -% not contain |>~| at the start of a line, an additional line |>~.| -% will be put at the end. In addition, a final period is added if not -% present. -% \end{function} -% % \begin{function}[EXP, added = 2017-12-04] % {\msg_show_item:n, \msg_show_item_unbraced:n, \msg_show_item:nn, \msg_show_item_unbraced:nn} % \begin{syntax} diff --git a/macros/latex/contrib/l3kernel/l3cctab.dtx b/macros/latex/contrib/l3kernel/l3cctab.dtx index 6e9d1c240c..46d682bd54 100644 --- a/macros/latex/contrib/l3kernel/l3cctab.dtx +++ b/macros/latex/contrib/l3kernel/l3cctab.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx index 05b2ca2255..02064b80ea 100644 --- a/macros/latex/contrib/l3kernel/l3clist.dtx +++ b/macros/latex/contrib/l3kernel/l3clist.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx index 6dc7ab596e..ae2e660caa 100644 --- a/macros/latex/contrib/l3kernel/l3coffins.dtx +++ b/macros/latex/contrib/l3kernel/l3coffins.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -2247,34 +2247,6 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\@@_color:n} -% Calls \tn{color}, and otherwise does nothing if \tn{color} is not defined. -% As this is relatively rarely used, we have it self-define rather than delay -% using a hook. -% \begin{macrocode} -\cs_new_protected:Npn \@@_color:n #1 {#1} -\bool_lazy_and:nnT - { \cs_if_exist_p:N \fmtname } - { \str_if_eq_p:Vn \fmtname { LaTeX2e } } - { - \cs_gset_protected:Npn \@@_color:n - { - \cs_gset_protected:Npx \@@_color:n - { - \cs_if_exist:NTF \color_select:n - { \color_select:n } - { - \cs_if_exist:NTF \color - { \exp_not:N \color } - { \exp_not:N \use_none:n } - } - } - \@@_color:n - } - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_rule:nn} % Abstract out creation of rules here until there is a higher-level interface. % \begin{macrocode} @@ -2298,14 +2270,14 @@ { \hcoffin_set:Nn \l_@@_display_pole_coffin { - \@@_color:n {#4} + \color_select:n {#4} \@@_rule:nn { 1pt } { 1pt } } \@@_attach_mark:NnnNnnnn #1 {#2} {#3} \l_@@_display_pole_coffin { hc } { vc } { 0pt } { 0pt } \hcoffin_set:Nn \l_@@_display_coord_coffin { - \@@_color:n {#4} + \color_select:n {#4} \l_@@_display_font_tl ( \tl_to_str:n { #2 , #3 } ) } @@ -2357,7 +2329,7 @@ { \hcoffin_set:Nn \l_@@_display_pole_coffin { - \@@_color:n {#2} + \color_select:n {#2} \@@_rule:nn { 1pt } { 1pt } } \prop_set_eq:Nc \l_@@_display_poles_prop @@ -2398,7 +2370,7 @@ { 0pt } { 0pt } \hcoffin_set:Nn \l_@@_display_coord_coffin { - \@@_color:n {#6} + \color_select:n {#6} \l_@@_display_font_tl ( \tl_to_str:n { #1 , ##1 } ) } diff --git a/macros/latex/contrib/l3kernel/l3color-base.dtx b/macros/latex/contrib/l3kernel/l3color-base.dtx deleted file mode 100644 index 497f7fbe78..0000000000 --- a/macros/latex/contrib/l3kernel/l3color-base.dtx +++ /dev/null @@ -1,183 +0,0 @@ -% \iffalse meta-comment -% -%% File: l3color-base.dtx -% -% Copyright (C) 2011,2012,2014,2016-2021 The LaTeX Project -% -% It may be distributed and/or modified under the conditions of the -% LaTeX Project Public License (LPPL), either version 1.3c of this -% license or (at your option) any later version. The latest version -% of this license is in the file -% -% https://www.latex-project.org/lppl.txt -% -% This file is part of the "l3kernel bundle" (The Work in LPPL) -% and all files in that bundle must be distributed together. -% -% ----------------------------------------------------------------------- -% -% The development version of the bundle can be found at -% -% https://github.com/latex3/latex3 -% -% for those people who are interested. -% -%<*driver> -\documentclass[full,kernel]{l3doc} -\begin{document} - \DocInput{\jobname.dtx} -\end{document} -% -% \fi -% -% \title{^^A -% The \textsf{l3color-base} package\\ Color support^^A -% } -% -% \author{^^A -% The \LaTeX{} Project\thanks -% {^^A -% E-mail: -% \href{mailto:latex-team@latex-project.org} -% {latex-team@latex-project.org}^^A -% }^^A -% } -% -% \date{Released 2021-02-06} -% -% \maketitle -% -% \begin{documentation} -% -% This module provides support for color in \LaTeX3{}. At present, the -% material here is mainly intended to support a small number of low-level -% requirements in other \pkg{l3kernel} modules. -% -% \section{Color in boxes} -% -% Controlling the color of text in boxes requires a small number of control -% functions, so that the boxed material uses the color at the point where -% it is set, rather than where it is used. -% -% \begin{function}[added = 2011-09-03]{\color_group_begin:, \color_group_end:} -% \begin{syntax} -% \cs{color_group_begin:} -% \ldots -% \cs{color_group_end:} -% \end{syntax} -% Creates a color group: one used to \enquote{trap} color settings. -% This grouping is built in to for example \cs{hbox_set:Nn}. -% \end{function} -% -% \begin{function}[added = 2011-09-03]{\color_ensure_current:} -% \begin{syntax} -% \cs{color_ensure_current:} -% \end{syntax} -% Ensures that material inside a box uses the foreground color -% at the point where the box is set, rather than that in force when the -% box is used. This function should usually be used within a -% \cs{color_group_begin:} \ldots \cs{color_group_end:} group. -% \end{function} -% -% \end{documentation} -% -% \begin{implementation} -% -% \section{\pkg{l3color-base} Implementation} -% -% \begin{macrocode} -%<*package> -% \end{macrocode} -% -% \begin{macrocode} -%<@@=color> -% \end{macrocode} -% -% \begin{variable} -% {\l_@@_current_tl} -% The color currently active for foreground (text, \emph{etc.}) material. -% This is stored in the form of a color model followed by one or more -% values. There are four pre-defined models, three of which take numerical -% values in the range $[0,1]$: -% \begin{itemize} -% \item \texttt{gray \meta{gray}} Grayscale color with the \meta{gray} -% value running from $0$ (fully black) to $1$ (fully white) -% \item \texttt{cmyk \meta{cyan} \meta{magenta} \meta{yellow} \meta{black}} -% \item \texttt{rgb \meta{red} \meta{green} \meta{blue}} -% \end{itemize} -% Notice that the value are separated by spaces. There is a fourth pre-defined -% model using a string value and a numerical one: -% \begin{itemize} -% \item \texttt{spot \meta{name} \meta{tint}} A pre-defined spot color, -% where the \meta{name} should be a pre-defined string color name and the -% \meta{tint} should be in the range $[0,1]$. -% \end{itemize} -% -% Additional models may be created to allow mixing of spot colors. The -% number of data entries these require will depend on the number of -% colors to be mixed. -% \begin{texnote} -% The content of \cs{l_@@_current_tl} comprises two brace groups, the -% first containing the color model and the second containing the value(s) -% applicable in that model. -% \end{texnote} -% \end{variable} -% -% \begin{macro}{\color_group_begin:, \color_group_end:} -% Grouping for color is the same as using the basic \cs{group_begin:} -% and \cs{group_end:} functions. However, for semantic reasons, they -% are renamed here. -% \begin{macrocode} -\cs_new_eq:NN \color_group_begin: \group_begin: -\cs_new_eq:NN \color_group_end: \group_end: -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\color_ensure_current:} -% A driver-independent wrapper for setting the foreground color to the -% current color \enquote{now}. -% \begin{macrocode} -\cs_new_protected:Npn \color_ensure_current: - { - \@@_backend_pickup:N \l_@@_current_tl - \@@_select:N \l_@@_current_tl - } -% \end{macrocode} -% \end{macro} -% -% \begin{variable}{\s_@@_stop} -% Internal scan marks. -% \begin{macrocode} -\scan_new:N \s_@@_stop -% \end{macrocode} -% \end{variable} -% -% \begin{macro}{\@@_select:N} -% \begin{macro}{\@@_select:nn} -% Take an internal color specification and pass it to the driver. This code -% is needed to ensure the current color but will also be used by the -% higher-level experimental material. -% \begin{macrocode} -\cs_new_protected:Npn \@@_select:N #1 - { \exp_after:wN \@@_select:nn #1 } -\cs_new_protected:Npn \@@_select:nn #1#2 - { \use:c { @@_backend_select_ #1 :n } {#2} } -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{variable}{\l_@@_current_tl} -% The current color, with the model and -% \begin{macrocode} -\tl_new:N \l_@@_current_tl -\tl_set:Nn \l_@@_current_tl { { gray } { 0 } } -% \end{macrocode} -% \end{variable} -% -% \begin{macrocode} -% -% \end{macrocode} -% -% \end{implementation} -% -% \PrintIndex diff --git a/macros/latex/contrib/l3kernel/l3color.dtx b/macros/latex/contrib/l3kernel/l3color.dtx new file mode 100644 index 0000000000..b3fd3cfa7a --- /dev/null +++ b/macros/latex/contrib/l3kernel/l3color.dtx @@ -0,0 +1,2655 @@ +% \iffalse meta-comment +% +%% File: l3color.dtx +% +% Copyright (C) 2017-2021 The LaTeX Project +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% http://www.latex-project.org/lppl.txt +% +% This file is part of the "l3kernel bundle" (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/latex3/latex3 +% +% for those people who are interested. +% +%<*driver> +\documentclass[full]{l3doc} +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +% \title{^^A +% The \textsf{l3color} package\\ Color support^^A +% } +% +% \author{^^A +% The \LaTeX{} Project\thanks +% {^^A +% E-mail: +% \href{mailto:latex-team@latex-project.org} +% {latex-team@latex-project.org}^^A +% }^^A +% } +% +% \date{Released 2021-02-18} +% +% \maketitle +% +% \begin{documentation} +% +% \section{Color in boxes} +% +% Controlling the color of text in boxes requires a small number of control +% functions, so that the boxed material uses the color at the point where +% it is set, rather than where it is used. +% +% \begin{function}[added = 2011-09-03]{\color_group_begin:, \color_group_end:} +% \begin{syntax} +% \cs{color_group_begin:} +% \ldots +% \cs{color_group_end:} +% \end{syntax} +% Creates a color group: one used to \enquote{trap} color settings. +% This grouping is built in to for example \cs{hbox_set:Nn}. +% \end{function} +% +% \begin{function}[added = 2011-09-03]{\color_ensure_current:} +% \begin{syntax} +% \cs{color_ensure_current:} +% \end{syntax} +% Ensures that material inside a box uses the foreground color +% at the point where the box is set, rather than that in force when the +% box is used. This function should usually be used within a +% \cs{color_group_begin:} \ldots \cs{color_group_end:} group. +% \end{function} +% +% \section{Color models} +% +% A color \emph{model} is a way to represent sets of colors. Different models +% are particularly suitable for different output methods, \emph{e.g.}~screen +% or print. Parameter-based models can describe a very large number of unique +% colors, and have a varying number of \emph{axes} which define a color +% space. In contrast, various proprietary models are available which define +% \emph{spot} colors (more formally separations). +% +% Core models are used to pass color information to output; these are +% \enquote{native} to \pkg{l3color}. Core models use real numbers in the range +% $[0,1]$ to represent values. The core models supported here are +% \begin{itemize} +% \item \texttt{gray} Grayscale color, with a single axis running from +% $0$ (fully black) to $1$ (fully white) +% \item \texttt{rgb} Red-green-blue color, with three axes, one for each of +% the components +% \item \texttt{cmyk} Cyan-magenta-yellow-black color, with four axes, one for +% each of the components +% \end{itemize} +% There are also interface models: these are convenient for users but have +% to be manipulated before storing/passing to the backend. Interface models +% are primarily integer-based: see below for more detail. The supported +% interface models are +% \begin{itemize} +% \item \texttt{Gray} Grayscale color, with a single axis running from +% $0$ (fully black) to $15$ (fully white) +% \item \texttt{hsb} Hue-saturation-brightness color, with three axes,all +% real values in the range $[0,1]$ for hue saturation and brightness +% \item \texttt{Hsb} Hue-saturation-brightness color, with three axes, integer +% in the range $[0,360]$ for hue, real values in the range $[0,1]$ for +% saturation and brightness +% \item \texttt{HSB} Hue-saturation-brightness color, with three axes, integers +% in the range $[0,240]$ for hue, saturation and brightness +% \item \texttt{HTML} HTML format representation of RGB color given as a +% single six-digit hexadecimal number +% \item \texttt{RGB} Red-green-blue color, with three axes, one for each of +% the components, values as integers from $0$ to $255$ +% \item \texttt{wave} Light wavelength, a real number in the range +% $380$ to $780$ (nanometres) +% \end{itemize} +% All interface models are internally stored as |rgb|. +% +% To allow parsing of data from \pkg{xcolor}, any leading model up the first +% \texttt{:} will be discarded; the approach of selecting an internal form +% for data is \emph{not} used in \pkg{l3color}. +% +% Additional models may be created to allow mixing of separation colors +% with each other or with those from other models. See +% Section~\ref{l3color:sec:new-models} for more detail of color support +% for additional models. +% +% When color is selected by model, the \meta{values} given are specified as +% a comma-separated list. The length of the list will therefore be determined +% by the detail of the model involved. +% +% Color models (and interconversion) are complex, and more details are given +% in the manual to the \LaTeXe{} \pkg{xcolor} package and in the +% \emph{PostScript Language Reference Manual}, published by Addison--Wesley. +% +% \section{Color expressions} +% +% In addition to allowing specification of color by model and values, +% \pkg{l3color} also supports color expressions. These are created +% by combining one or more color names, with the amount of each specified +% as a percentage. The latter is given between |!| symbols in the expression. +% Thus for example +% \begin{verbatim} +% red!50!green +% \end{verbatim} +% is a mixture of $50\,\%$ red and $50\,\%$ green. A trailing percentage is +% interpreted as implicitly followed by |white|, and so +% \begin{verbatim} +% red!25 +% \end{verbatim} +% specifies $25\,\%$ red mixed with $75\,\%$ white. +% +% Where the models for the mixed colors are different, the model of the first +% color is used. Thus +% \begin{verbatim} +% red!50!cyan +% \end{verbatim} +% will result in a color specification using the |rgb| model, made up of +% $50\,\%$ red and $50\,\%$ of cyan \emph{expressed in \texttt{rgb}}. As color +% model interconversion is not exact. +% +% The one exception to the above is where the first model in an expression is +% |gray|. In this case, the order of mixing is \enquote{swapped} internally, so +% that for example +% \begin{verbatim} +% black!50!red +% \end{verbatim} +% has the same result as +% \begin{verbatim} +% red!50!black +% \end{verbatim} +% (the predefined colors |black| and |white| use the |gray| model). +% +% Where more than two colors are mixed in an expression, evaluation takes place +% in a stepwise fashion. Thus in +% \begin{verbatim} +% cyan!50!magenta!10!yellow +% \end{verbatim} +% the sub-expression +% \begin{verbatim} +% cyan!50!magenta +% \end{verbatim} +% is first evaluated to give an intermediate color specification, before +% the second step +% \begin{verbatim} +% !10!yellow +% \end{verbatim} +% where || represents this transitory calculated value. +% +% Within a color expression, |.| may be used to represent the color active +% for typesetting (the current color). This allows for example +% \begin{verbatim} +% .!50 +% \end{verbatim} +% to mean a mixture of $50\,\%$ of current color with white. +% +% (Color expressions supported here are a subset of those provided by +% the \LaTeXe{} \pkg{xcolor} package. At present, only such features as are +% clearly useful have been added here.) +% +% \section{Named colors} +% +% Color names are stored in a single namespace, which makes them accessible +% as part of color expressions. Whilst they are not reserved in a technical +% sense, the names |black|, |white|, |red|, |green|, |blue|, |cyan|, |magenta| +% and |yellow| have special meaning and should not be redefined. Color names +% should be made up of letters, numbers and spaces only: other characters are +% reserved for use in color expressions. In particular, |.| represents the +% current color at the start of a color expression. +% +% \begin{function}{\color_set:nn} +% \begin{syntax} +% \cs{color_set:nn} \Arg{name} \Arg{color expression} +% \end{syntax} +% Evaluates the \meta{color expression} and stores the resulting +% color specification as the \meta{name}. +% \end{function} +% +% \begin{function}{\color_set:nnn} +% \begin{syntax} +% \cs{color_set:nnn} \Arg{name} \Arg{model(s)} \Arg{value(s)} +% \end{syntax} +% Stores the color specification equivalent to the \meta{model(s)} and +% \meta{values} as the \meta{name}. +% \end{function} +% +% \begin{function}{\color_set_eq:nn} +% \begin{syntax} +% \cs{color_set_eq:nn} \Arg{name1} \Arg{name2} +% \end{syntax} +% Copies the color specification in \meta{name2} to \meta{name1}. The +% special name |.| may be used to represent the current color, allowing +% it to be saved to a name. +% \end{function} +% +% \begin{function}{\color_show:n} +% \begin{syntax} +% \cs{color_show:n} \Arg{name} +% \end{syntax} +% Displays the color specification stored in the \meta{name} on the +% terminal. +% \end{function} +% +% \section{Selecting colors} +% +% General selection of color is safe when split across pages: a stack is +% used to ensure that the correct color is re-selected on the new page. +% +% \begin{function}{\color_select:n} +% \begin{syntax} +% \cs{color_select:n} \Arg{color expression} +% \end{syntax} +% Parses the \meta{color expression} and then activates the resulting +% color specification for typeset material. +% \end{function} +% +% \begin{function}{\color_select:nn} +% \begin{syntax} +% \cs{color_select:nn} \Arg{model(s)} \Arg{value(s)} +% \end{syntax} +% Activates the color specification equivalent to the \meta{model(s)} and +% \meta{value(s)} for typeset material. +% \end{function} +% +% \begin{variable}{\l_color_fixed_model_tl} +% When this is set to a non-empty value, colors will be converted to +% the specified model when they are selected. Note that included images +% and similar are not influenced by this setting. +% \end{variable} +% +% \section{Colors for fills and strokes} +% +% Colors for drawing operations and so forth are split into strokes and fills +% (the latter may also be referred to as non-stroke color). The fill color is +% used for text under normal circumstances. Depending on the backend, stroke +% color may use a \emph{stack}, in which case it exhibits the same page breaking +% behavior as general color. However, \texttt{dvips}/\texttt{dvisvgm} do not +% support this, and so color will need to be contained within a scope, such +% as \cs{draw_begin:}/\cs{draw_end:}. +% +% Note that the \emph{current color} is the fill color, as this is used for +% running text. +% +% \begin{function}{\color_fill:n, \color_stroke:n} +% \begin{syntax} +% \cs{color_fill:n} \Arg{color expression} +% \end{syntax} +% Parses the \meta{color expression} and then activates the resulting +% color specification for filling or stroking. +% \end{function} +% +% \begin{function}{\color_fill:nn, \color_stroke:nn} +% \begin{syntax} +% \cs{color_fill:nn} \Arg{model(s)} \Arg{value(s)} +% \end{syntax} +% Activates the color specification equivalent to the \meta{model(s)} and +% \meta{value(s)} for filling or stroking. +% \end{function} +% +% \begin{variable}{color.sc} +% When using \texttt{dvips}, this PostScript variables hold the stroke color. +% \end{variable} +% +% \section{Multiple color models} +% +% When selecting or setting a color with an explicit model, it is possible +% to give values for more than one model at one time. This is particularly +% useful where automated conversion between models does not give the desired +% outcome. To do this, the list of models and list of values are both subdivided +% using |/| characters (as for the similar function in \pkg{xcolor}). For +% example, to save a color with explicit |cmyk| and |rgb| values, one could +% use +% \begin{verbatim} +% \color_set:nnn { foo } { cmyk / rgb } +% { 0.1 , 0.2 , 0.3 , 0.4 / 0.1, 0.2 , 0.3 } +% \end{verbatim} +% The manually-specified conversion will be used in preference to automated +% calculation whenever the model(s) listed are used: both in expressions and +% when a fixed model is active. +% +% Similarly, the same syntax can be applied to directly selecting a color. +% \begin{verbatim} +% \color_select:nn { cmyk / rgb } +% { 0.1 , 0.2 , 0.3 , 0.4 / 0.1, 0.2 , 0.3 } +% \end{verbatim} +% Again, this list is used when a fixed model is active: the first entry is used +% unless there is a fixed model matching one of the other entries. +% +% \section{Exporting color specifications} +% +% The major use of color expressions is in setting typesetting output, but there +% are other places in which some form of color information is required. These +% may need data in a different format or using a different model to the internal +% representation. Thus a set of functions are available to export colors in +% different formats. +% +% Valid export targets are +% \begin{itemize} +% \item \texttt{backend} Two brace groups: the first containing the +% model, the second containing space-separated values appropriate +% for the model; this is the format required by backend functions +% of \pkg{expl3} +% \item \texttt{HTML} Uppercase two-digit hexadecimal values, expressing +% a red-green-blue color; the digits are \emph{not} separated +% \item \texttt{space-sep-cmyk} Space-separated cyan-magenta-yellow-black +% values +% \item \texttt{space-sep-rgb} Space-separated red-green-blue values +% suitable for use as a PDF annotation color +% \end{itemize} +% +% \begin{function}{\color_export:nnN} +% \begin{syntax} +% \cs{color_export:nnN} \Arg{color expression} \Arg{format} \Arg{tl} +% \end{syntax} +% Parses the \meta{color expression} as described earlier, +% then converts to the \meta{format} specified and assigns the data to the +% \meta{tl}. +% \end{function} +% +% \begin{function}{\color_export:nnnN} +% \begin{syntax} +% \cs{color_export:nnnN} \Arg{model} \Arg{value(s)} \Arg{format} \Arg{tl} +% \end{syntax} +% Expresses the combination of \meta{model} and \meta{value(s)} in an +% internal representation, then converts to the \meta{format} specified and +% assigns the data to the \meta{tl}. +% \end{function} +% +% \section{Creating new color models} +% \label{l3color:sec:new-models} +% +% Additional color models are required to support specialist workflows, for +% example those involving separations (see +% \url{https://helpx.adobe.com/indesign/using/spot-process-colors.html} +% for details of the use of separations in print). Color models may be split +% into families; for the standard device-based color models (\texttt{DeviceCMYK}, +% \texttt{DeviceRGB}, \texttt{DeviceGray}), these are synonymous. This +% is not generally the case: see the PDF reference for more details. (Note that +% \pkg{l3color} uses the shorter names \texttt{cmyk}, etc.) +% +% \begin{function}{\color_model_new:nnn} +% \begin{syntax} +% \cs{color_model_new:nnn} \Arg{model} \Arg{family} \Arg{params} +% \end{syntax} +% Creates a new \meta{model} which is derived from the color model \meta{family}. +% The latter should be one of +% \begin{itemize} +% \item \texttt{DeviceN} +% \item \texttt{Separation} +% \end{itemize} +% (The \meta{family} may be given in mixed case as-in the PDF reference: +% internally, case of these strings is folded.) +% Depending on the \meta{family}, one or more \meta{params} are mandatory or +% optional. +% \end{function} +% +% For a \texttt{Separation} space, there are three \emph{compulsory} keys. +% \begin{itemize} +% \item \texttt{name} The name of the Separation, for example the formal +% name of a spot color ink. Such a \meta{name} may contain spaces, etc., +% which are not permitted in the \meta{model}. +% \item \texttt{alternative-model} An alternative device colorspace, one of +% \texttt{cmyk}, \texttt{rgb}, \texttt{gray} or \texttt{CIELAB}. The three +% parameter-based models work as described above; see below for +% details of CIELAB colors. +% \item \texttt{alternative-values} A comma-separated list of values +% appropriate to the \texttt{alternative-model}. This information is used by +% the PDF application if the \texttt{Separation} is not available. +% \end{itemize} +% +% CIELAB color separations are created using the +% \texttt{alternative-model = CIELAB} setting. These colors must also have an +% \texttt{illuminant} key, one of \texttt{a}, \texttt{c}, \texttt{e}, +% \texttt{d50}, \texttt{d55}, \texttt{d65} or \texttt{d75}. The +% \texttt{alternative-values} in this case are the three parameters $L*$, $a*$ +% and $b*$ of the CIELAB model. Full details of this device-independent color +% approach are given in the documentation to the \pkg{colorspace} package. +% +% CIELAB colors \emph{cannot} be converted into other device-dependent color +% spaces, and as such, mixing can only occur if colors set up using the CIELAB +% model are also given with an alternative parameter-based model. If that is +% not the case, \pkg{l3color} will fallback to using black as the colorant in +% any mixing. +% +% For a \texttt{DeviceN} space, there is one \emph{compulsory} key. +% \begin{itemize} +% \item \texttt{names} The names of the components of the \texttt{DeviceN} +% space. Each should be either the \meta{name} of a \texttt{Separation} model, +% a process color name (\texttt{cyan}, etc.) or the special name \texttt{none}. +% \end{itemize} +% +% \end{documentation} +% +% \begin{implementation} +% +% \section{\pkg{l3color} Implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macrocode} +%<@@=color> +% \end{macrocode} +% +% \subsection{Basics} +% +% \begin{variable} +% {\l_@@_current_tl} +% The color currently active for foreground (text, \emph{etc.}) material. +% This is stored in the form of a color model followed by one or more +% values. There are four pre-defined models, three of which take numerical +% values in the range $[0,1]$: +% \begin{itemize} +% \item \texttt{gray \meta{gray}} Grayscale color with the \meta{gray} +% value running from $0$ (fully black) to $1$ (fully white) +% \item \texttt{cmyk \meta{cyan} \meta{magenta} \meta{yellow} \meta{black}} +% \item \texttt{rgb \meta{red} \meta{green} \meta{blue}} +% \end{itemize} +% Notice that the value are separated by spaces. There is a fourth pre-defined +% model using a string value and a numerical one: +% \begin{itemize} +% \item \texttt{spot \meta{name} \meta{tint}} A pre-defined spot color, +% where the \meta{name} should be a pre-defined string color name and the +% \meta{tint} should be in the range $[0,1]$. +% \end{itemize} +% +% Additional models may be created to allow mixing of spot colors. The +% number of data entries these require will depend on the number of +% colors to be mixed. +% \begin{texnote} +% The content of \cs{l_@@_current_tl} comprises two brace groups, the +% first containing the color model and the second containing the value(s) +% applicable in that model. +% \end{texnote} +% \end{variable} +% +% \begin{macro}{\color_group_begin:, \color_group_end:} +% Grouping for color is the same as using the basic \cs{group_begin:} +% and \cs{group_end:} functions. However, for semantic reasons, they +% are renamed here. +% \begin{macrocode} +\cs_new_eq:NN \color_group_begin: \group_begin: +\cs_new_eq:NN \color_group_end: \group_end: +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\color_ensure_current:} +% A driver-independent wrapper for setting the foreground color to the +% current color \enquote{now}. +% \begin{macrocode} +\cs_new_protected:Npn \color_ensure_current: + { + \@@_backend_pickup:N \l_@@_current_tl + \@@_select:N \l_@@_current_tl + } +% \end{macrocode} +% \end{macro} +% +% \begin{variable}{\s_@@_stop} +% Internal scan marks. +% \begin{macrocode} +\scan_new:N \s_@@_stop +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_select:N} +% \begin{macro}{\@@_select:nn} +% Take an internal color specification and pass it to the driver. This code +% is needed to ensure the current color but will also be used by the +% higher-level experimental material. +% \begin{macrocode} +\cs_new_protected:Npn \@@_select:N #1 + { \exp_after:wN \@@_select:nn #1 } +\cs_new_protected:Npn \@@_select:nn #1#2 + { \use:c { @@_backend_select_ #1 :n } {#2} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{variable}{\l_@@_current_tl} +% The current color, with the model and +% \begin{macrocode} +\tl_new:N \l_@@_current_tl +\tl_set:Nn \l_@@_current_tl { { gray } { 0 } } +% \end{macrocode} +% \end{variable} + +% +% \subsection{Predefined color names} +% +% The ability to predefine colors with a name is a key part of this module and +% means there has to be a method for storing the results. At first sight, it +% seems natural to follow the usual \pkg{expl3} model and create a +% \texttt{color} variable type for the process. That would then allow both +% local and global colors, constant colors and the like. However, these names +% need to be accessible in some form at the user level, for selection of colors +% either simply by name or as part of a more complex expression. This does not +% require that the full name is exposed but does require that they can be +% looked up in a predictable way. As such, it is more useful to expose just the +% color names as part of the interface, with the result that only local color +% names can be created. (This is also seen for example in key creation in +% \pkg{l3keys}.) As a result, color names are declarative (no \texttt{new} +% functions). +% +% Since there is no need to manipulate colors \emph{en masse}, each is stored +% in a two-part structure: a \texttt{prop} for the colors themselves, and a +% \texttt{tl} for the default model for each color. +% +% \subsection{Setup} +% +% \begin{variable}{\l_@@_internal_int, \l_@@_internal_tl} +% \begin{macrocode} +\int_new:N \l_@@_internal_int +\tl_new:N \l_@@_internal_tl +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\s_@@_mark} +% Internal scan marks. \cs{s_@@_stop} is already defined in \pkg{l3color-base}. +% \begin{macrocode} +\scan_new:N \s_@@_mark +% \end{macrocode} +% \end{variable} +% +% \subsection{Utility functions} +% +% \begin{macro}[int, TF, EXP]{\@@_if_defined:n} +% A simple wrapper to avoid needing to have the lookup repeated in too many +% places. +% \begin{macrocode} +\prg_new_conditional:Npnn \@@_if_defined:n #1 { T, F, TF } + { + \prop_if_exist:cTF { l_@@_named_ #1 _prop } + \prg_return_true: + \prg_return_false: + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}[EXP]{\@@_model:N, \@@_values:N} +% Simple abstractions. +% \begin{macrocode} +\cs_new:Npn \@@_model:N #1 { \exp_after:wN \use_i:nn #1 } +\cs_new:Npn \@@_values:N #1 { \exp_after:wN \use_ii:nn #1 } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_extract:nNN, \@@_extract:VNN} +% Recover the values for the standard model for a color. +% \begin{macrocode} +\cs_new_protected:Npn \@@_extract:nNN #1#2#3 + { + \tl_set_eq:Nc #2 { l_@@_named_ #1 _tl } + \prop_get:cVN { l_@@_named_ #1 _prop } #2 #3 + } +\cs_generate_variant:Nn \@@_extract:nNN { V } +% \end{macrocode} +% \end{macro} +% +% \subsection{Model conversion} +% +% \begin{macro}{\@@_convert:nnN, \@@_convert:VVN} +% \begin{macro}{\@@_convert:nnnN, \@@_convert:nVnN, \@@_convert:nnVN} +% \begin{macro}[aux, EXP] +% { +% \@@_convert_gray_rgb:w +% \@@_convert_gray_cmyk:w +% \@@_convert_cmyk_gray:w +% \@@_convert_cmyk_rgb:w +% \@@_convert_rgb_gray:w +% \@@_convert_rgb_cmyk:w +% } +% \begin{macro}[aux, EXP]{\@@_convert_rgb_cmyk:nnnn} +% Model conversion is carried out using standard formulae, as described in +% the manual for \pkg{xcolor} (see also the \emph{PostScript Language +% Reference Manual}). +% \begin{macrocode} +\cs_new_protected:Npn \@@_convert:nnN #1#2#3 + { \@@_convert:nnVN {#1} {#2} #3 #3 } +\cs_generate_variant:Nn \@@_convert:nnN { VV } +\cs_new_protected:Npn \@@_convert:nnnN #1#2#3#4 + { + \tl_set:Nx #4 + { + \cs_if_exist:cTF { @@_convert_ #1 _ #2 :w } + { \use:c { @@_convert_ #1 _ #2 :w } #3 ~ 0 ~ 0 ~ 0 \s_@@_stop } + { \use:c { c_@@_fallback_ #2 _tl } } + } + } +\cs_generate_variant:Nn \@@_convert:nnnN { nV , nnV } +\cs_new:Npn \@@_convert_gray_rgb:w #1 ~ #2 \s_@@_stop + { #1 ~ #1 ~ #1 } +\cs_new:Npn \@@_convert_gray_cmyk:w #1 ~ #2 \s_@@_stop + { 0 ~ 0 ~ 0 ~ \fp_eval:n { 1 - #1 } } +% \end{macrocode} +% These rather odd values are based on \textsc{ntsc} television: the set are +% used for the |cmyk| conversion. +% \begin{macrocode} +\cs_new:Npn \@@_convert_rgb_gray:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop + { \fp_eval:n { 0.3 * #1 + 0.59 * #2 + 0.11 * #3 } } +% \end{macrocode} +% The conversion from |rgb| to |cmyk| is the most complex: a two-step +% procedure which requires \emph{black generation} and \emph{undercolor +% removal} functions. The PostScript reference describes them as +% device-dependent, but following \pkg{xcolor} we assume they are linear. +% Moreover, as the likelihood of anyone using a non-unitary matrix here is +% tiny, we simplify and treat those two concepts as no-ops. +% \begin{macrocode} +\cs_new:Npn \@@_convert_rgb_cmyk:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop + { + \exp_args:Nf \@@_convert_rgb_cmyk:nnnn + { \fp_eval:n { min ( 1 - #1 , 1 - #2 , 1 - #3 ) } } {#1} {#2} {#3} + } +\cs_new:Npn \@@_convert_rgb_cmyk:nnnn #1#2#3#4 + { + \fp_eval:n { min ( 1 , max ( 0 , 1 - #2 - #1 ) ) } \c_space_tl + \fp_eval:n { min ( 1 , max ( 0 , 1 - #3 - #1 ) ) } \c_space_tl + \fp_eval:n { min ( 1 , max ( 0 , 1 - #4 - #1 ) ) } \c_space_tl + #1 + } +\cs_new:Npn \@@_convert_cmyk_gray:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop + { \fp_eval:n { 1 - min ( 1 , 0.3 * #1 + 0.59 * #2 + 0.11 * #3 + #4 ) } } +\cs_new:Npn \@@_convert_cmyk_rgb:w #1 ~ #2 ~ #3 ~ #4 ~ #5 \s_@@_stop + { + \fp_eval:n { 1 - min ( 1 , #1 + #4 ) } \c_space_tl + \fp_eval:n { 1 - min ( 1 , #2 + #4 ) } \c_space_tl + \fp_eval:n { 1 - min ( 1 , #3 + #4 ) } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Color expressions} +% +% \begin{variable} +% {\l_@@_model_tl, \l_@@_value_tl, \l_@@_next_model_tl, \l_@@_next_value_tl} +% Working space to store the color data whilst doing calculations: keeping +% it on the stack is attractive but gets tricky (return is non-trivial). +% \begin{macrocode} +\tl_new:N \l_@@_model_tl +\tl_new:N \l_@@_value_tl +\tl_new:N \l_@@_next_model_tl +\tl_new:N \l_@@_next_value_tl +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_parse:nN} +% \begin{macro}{\@@_parse_aux:nN} +% \begin{macro}{\@@_parse_eq:Nn} +% \begin{macro}{\@@_parse_eq:nNn} +% \begin{macro}{\@@_parse:Nw} +% \begin{macro}{\@@_parse_loop_init:Nnn} +% \begin{macro}{\@@_parse_loop:w} +% \begin{macro}{\@@_parse_loop:nn} +% \begin{macro}{\@@_parse_gray:n, \@@_parse_std:n} +% \begin{macro}{\@@_parse_break:w} +% \begin{macro}{\@@_parse_end:} +% \begin{macro}[aux, EXP]{\@@_parse_mix:Nnnn, \@@_parse_mix:NVVn} +% \begin{macro}[aux, EXP]{\@@_parse_mix:nNnn} +% \begin{macro}[aux, EXP] +% { +% \@@_parse_mix_gray:nw , +% \@@_parse_mix_rgb:nw , +% \@@_parse_mix_cmyk:nw +% } +% The main function for parsing color expressions removes actives but +% otherwise expands, then starts working through the expression itself. +% At the end, we apply the payload. +% \begin{macrocode} +\cs_new_protected:Npx \@@_parse:nN #1#2 + { + \exp_not:N \@@_backend_pickup:N \exp_not:N \l_@@_current_tl + \tl_set:Nx \exp_not:c { l_@@_named_ . _tl } + { \exp_not:N \@@_model:N \exp_not:N \l_@@_current_tl } + \prop_put:NVx \exp_not:c { l_@@_named_ . _prop } + \exp_not:c { l_@@_named_ . _tl } + { \exp_not:N \@@_values:N \exp_not:N \l_@@_current_tl } + \exp_not:N \exp_args:Ne \exp_not:N \@@_parse_aux:nN + { \exp_not:N \tl_to_str:n {#1} } #2 + } +% \end{macrocode} +% Before going to all of the effort of parsing an expression, these two +% precursor functions look for a pre-defined name, either on its own or +% with a trailing |!| (which is the same thing). +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_aux:nN #1#2 + { + \tl_if_exist:cTF { l_@@_named_ #1 _prop } + { \@@_parse_set_eq:Nn #2 {#1} } + { \@@_parse:Nw #2#1 ! \s_@@_stop } + \@@_check_model:N #2 + } +\cs_new_protected:Npn \@@_parse_set_eq:Nn #1#2 + { + \tl_if_empty:NTF \l_color_fixed_model_tl + { \exp_args:Nv \@@_parse_set_eq:nNn { l_@@_named_ #2 _tl } } + { \exp_args:NV \@@_parse_set_eq:nNn \l_color_fixed_model_tl } + #1 {#2} + } +% \end{macrocode} +% Here, we have to allow for the case where there is a fixed model: +% that can't be swept up by generic conversion as we are dealing with a +% named color. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_set_eq:nNn #1#2#3 + { + \prop_get:cnNTF + { l_@@_named_ #3 _prop } {#1} + \l_@@_value_tl + { \tl_set:Nx #2 { {#1} { \l_@@_value_tl } } } + { + \tl_set_eq:Nc \l_@@_model_tl { l_@@_named_ #3 _tl } + \prop_get:cVN { l_@@_named_ #3 _prop } \l_@@_model_tl + \l_@@_value_tl + \@@_convert:nnN + \l_@@_model_tl {#1} \l_@@_value_tl + \tl_set:Nx #2 + { + {#1} + { \l_@@_value_tl } + } + } + } +\cs_new_protected:Npn \@@_parse:Nw #1#2 ! #3 \s_@@_stop + { + \@@_if_defined:nTF {#2} + { + \tl_if_blank:nTF {#3} + { \@@_parse_set_eq:Nn #1 {#2} } + { \@@_parse_loop_init:Nnn #1 {#2} {#3} } + } + { + \__kernel_msg_error:nnn { color } { unknown-color } {#2} + \tl_set:Nn \l_@@_current_tl { { gray } { 0 } } + } + } +% \end{macrocode} +% Once we establish that a full parse is needed, the next job is to get the +% detail of the first color. That will determine the model we use for the +% calculation: splitting here makes checking that a bit easier. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_loop_init:Nnn #1#2#3 + { + \group_begin: + \@@_extract:nNN {#2} \l_@@_model_tl \l_@@_value_tl + \@@_parse_loop:w #3 ! ! ! ! \s_@@_stop + \tl_set:Nx \l_@@_internal_tl + { { \l_@@_model_tl } { \l_@@_value_tl } } + \exp_args:NNNV \group_end: + \tl_set:Nn #1 \l_@@_internal_tl + } +% \end{macrocode} +% This is the loop proper: there can be an open-ended set of colors to parse, +% separated by |!| tokens. There are a few cases to look out for. At the end +% of the expression and with we find a mix of $100$ then we simply skip the +% next color entirely (we can't stop the loop as there might be a further +% valid color to mix in). On the other hand, if we get a mix of $0$ then +% drop everything so far and start again. There is also a trailing +% |white| to \enquote{read in} if the final explicit data is a mix. +% Those conditions are separate from actually looping, which is therefore +% sorted out by checking if we have further data to process: in contrast +% to \pkg{xcolor}, we don't allow |!!| so the test can be simplified. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_loop:w #1 ! #2 ! #3 ! #4 ! #5 \s_@@_stop + { + \bool_lazy_or:nnF + { \tl_if_blank_p:n {#1} } + { \int_compare_p:nNn {#1} = { 100 } } + { + \int_compare:nNnTF {#1} = { 0 } + { + \tl_if_blank:nTF {#2} + { \@@_extract:nNN { white } } + { \@@_extract:nNN {#2} } + \l_@@_model_tl \l_@@_value_tl + } + { + \use:x + { + \@@_parse_loop:nn {#1} + { \tl_if_blank:nTF {#2} { white } {#2} } + } + } + } + \tl_if_blank:nF {#3} + { \@@_parse_loop:w #3 ! #4 ! #5 \s_@@_stop } + \@@_parse_end: + } +% \end{macrocode} +% The \enquote{payload} of calculation in the loop first. If the model for +% the upcoming color is different from that of the existing (partial) color, +% convert the model. For |gray| the two are flipped round so that the outcome +% is something with \enquote{real} color. We are then in a position to do the +% actual calculation itself. The two auxiliaries here give us a way to break +% the loop should an invalid name be found. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_loop:nn #1#2 + { + \@@_if_defined:nTF {#2} + { + \@@_extract:nNN {#2} \l_@@_next_model_tl \l_@@_next_value_tl + \tl_if_eq:NNF \l_@@_model_tl \l_@@_next_model_tl + { + \str_if_eq:VnTF \l_@@_model_tl { gray } + { \@@_parse_gray:n {#2} } + { \@@_parse_std:n {#2} } + } + \tl_set:Nx \l_@@_value_tl + { + \@@_parse_mix:NVVn + \l_@@_model_tl \l_@@_value_tl \l_@@_next_value_tl {#1} + } + } + { + \__kernel_msg_error:nnn { color } { unknown-color } {#2} + \@@_extract:nNN { black } \l_@@_model_tl \l_@@_value_tl + \@@_parse_break:w + } + } +% \end{macrocode} +% The \texttt{gray} model needs special handling: the models need to be +% swapped: we do that using a dedicated function. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_gray:n #1 + { + \tl_set_eq:NN \l_@@_model_tl \l_@@_next_model_tl + \tl_set:Nn \l_@@_next_model_tl { gray } + \exp_args:NnV \@@_convert:nnN { gray } \l_@@_model_tl + \l_@@_value_tl + \prop_get:cVN { l_@@_named_ #1 _prop } \l_@@_model_tl + \l_@@_next_value_tl + } +\cs_new_protected:Npn \@@_parse_std:n #1 + { + \prop_get:cVNF { l_@@_named_ #1 _prop } + \l_@@_model_tl + \l_@@_next_value_tl + { + \@@_convert:VVN + \l_@@_next_model_tl + \l_@@_model_tl + \l_@@_next_value_tl + } + } +\cs_new_protected:Npn \@@_parse_break:w #1 \@@_parse_end: { } +\cs_new_protected:Npn \@@_parse_end: { } +% \end{macrocode} +% Do the vector arithmetic: mainly a question of shuffling input, along +% with one pre-calculation to keep down the use of division. +% \begin{macrocode} +\cs_new:Npn \@@_parse_mix:Nnnn #1#2#3#4 + { + \exp_args:Nf \@@_parse_mix:nNnn + { \fp_eval:n { #4 / 100 } } + #1 {#2} {#3} + } +\cs_generate_variant:Nn \@@_parse_mix:Nnnn { NVV } +\cs_new:Npn \@@_parse_mix:nNnn #1#2#3#4 + { + \use:c { @@_parse_mix_ #2 :nw } {#1} + #3 \s_@@_mark #4 \s_@@_stop + } +\cs_new:Npn \@@_parse_mix_gray:nw #1#2 \s_@@_mark #3 \s_@@_stop + { \fp_eval:n { #2 * #1 + #3 * ( 1 - #1 ) } } +\cs_new:Npn \@@_parse_mix_rgb:nw + #1#2 ~ #3 ~ #4 \s_@@_mark #5 ~ #6 ~ #7 \s_@@_stop + { + \fp_eval:n { #2 * #1 + #5 * ( 1 - #1 ) } \c_space_tl + \fp_eval:n { #3 * #1 + #6 * ( 1 - #1 ) } \c_space_tl + \fp_eval:n { #4 * #1 + #7 * ( 1 - #1 ) } + } +\cs_new:Npn \@@_parse_mix_cmyk:nw + #1#2 ~ #3 ~ #4 ~ #5 \s_@@_mark #6 ~ #7 ~ #8 ~ #9 \s_@@_stop + { + \fp_eval:n { #2 * #1 + #6 * ( 1 - #1 ) } \c_space_tl + \fp_eval:n { #3 * #1 + #7 * ( 1 - #1 ) } \c_space_tl + \fp_eval:n { #4 * #1 + #8 * ( 1 - #1 ) } \c_space_tl + \fp_eval:n { #5 * #1 + #9 * ( 1 - #1 ) } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP] +% { +% \@@_parse_model_gray:w, \@@_parse_model_rgb:w, +% \@@_parse_model_cmyk:w +% } +% \begin{macro}[EXP]{\@@_parse_number:n} +% \begin{macro}[EXP]{\@@_parse_number:w} +% Turn the input into internal form, also tidying up the number quickly. +% \begin{macrocode} +\cs_new:Npn \@@_parse_model_gray:w #1 , #2 \s_@@_stop + { { gray } { \@@_parse_number:n {#1} } } +\cs_new:Npn \@@_parse_model_rgb:w #1 , #2 , #3 , #4 \s_@@_stop + { + { rgb } + { + \@@_parse_number:n {#1} ~ + \@@_parse_number:n {#2} ~ + \@@_parse_number:n {#3} + } + } +\cs_new:Npn \@@_parse_model_cmyk:w #1 , #2 , #3 , #4 , #5 \s_@@_stop + { + { cmyk } + { + \@@_parse_number:n {#1} ~ + \@@_parse_number:n {#2} ~ + \@@_parse_number:n {#3} ~ + \@@_parse_number:n {#4} + } + } +\cs_new:Npn \@@_parse_number:n #1 + { \@@_parse_number:w #1 . 0 . \s_@@_stop } +\cs_new:Npn \@@_parse_number:w #1 . #2 . #3 \s_@@_stop + { \tl_if_blank:nTF {#1} { 0 } {#1} . #2 } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP] +% { +% \@@_parse_model_Gray:w, \@@_parse_model_hsb:w, +% \@@_parse_model_Hsb:w, \@@_parse_model_HSB:w, +% \@@_parse_model_HTML:w, \@@_parse_model_RGB:w +% } +% \begin{macro}[EXP]{\@@_parse_model_hsb:nnn, \@@_parse_model_hsb_aux:nnn} +% \begin{macro}[EXP]{\@@_parse_model_hsb:nnnn} +% \begin{macro}[EXP]{\@@_parse_model_hsb:nnnnn} +% \begin{macro}[EXP] +% { +% \@@_parse_model_hsb_0:nnnn , +% \@@_parse_model_hsb_1:nnnn , +% \@@_parse_model_hsb_2:nnnn , +% \@@_parse_model_hsb_3:nnnn , +% \@@_parse_model_hsb_4:nnnn , +% \@@_parse_model_hsb_5:nnnn +% } +% \begin{macro}[EXP]{\@@_parse_model_wave:w} +% \begin{macro}[EXP] +% {\@@_parse_model_wave_auxi:nn, \@@_parse_model_wave_auxii:nn} +% \begin{macro}[EXP]{\@@_parse_model_wave_rho:n} +% \begin{macrocode} +\cs_new:Npn \@@_parse_model_Gray:w #1 , #2 \s_@@_stop + { { gray } { \fp_eval:n { #1 / 15 } } } +\cs_new:Npn \@@_parse_model_hsb:w #1 , #2 , #3 , #4 \s_@@_stop + { \@@_parse_model_hsb:nnn {#1} {#2} {#3} } +\cs_new:Npn \@@_parse_model_Hsb:w #1 , #2 , #3 , #4 \s_@@_stop + { + \exp_args:Ne \@@_parse_model_hsb:nnn { \fp_eval:n { #1 / 360 } } + {#2} {#3} + } +% \end{macrocode} +% The conversion here is non-trivial but is described at length +% in the \pkg{xcolor} manual. For ease, we calculate the integer +% and fractional parts of the hue first, then use them to work out the +% possible values for $r$, $g$ and $b$ before putting them in the correct +% places. +% \begin{macrocode} +\cs_new:Npn \@@_parse_model_hsb:nnn #1#2#3 + { + { rgb } + { + \exp_args:Ne \@@_parse_model_hsb_aux:nnn + { \fp_eval:n { 6 * #1 } } {#2} {#3} + } + } +\cs_new:Npn \@@_parse_model_hsb_aux:nnn #1#2#3 + { + \exp_args:Nee \@@_parse_model_hsb_aux:nnnn + { \fp_eval:n { floor(#1) } } { \fp_eval:n { #1 - floor(#1) } } + {#2} {#3} + } +\cs_new:Npn \@@_parse_model_hsb_aux:nnnn #1#2#3#4 + { + \use:e + { + \exp_not:N \@@_parse_model_hsb_aux:nnnnn + { \@@_parse_number:n {#4} } + { \fp_eval:n { round(#4 * (1 - #3) ,5) } } + { \fp_eval:n { round(#4 * ( 1 - #3 * #2 ) ,5) } } + { \fp_eval:n { round(#4 * ( 1 - #3 * (1 - #2) ) ,5) } } + {#1} + } + } +\cs_new:Npn \@@_parse_model_hsb_aux:nnnnn #1#2#3#4#5 + { \use:c { @@_parse_model_hsb_ #5 :nnnn } {#1} {#2} {#3} {#4} } +\cs_new:cpn { @@_parse_model_hsb_0:nnnn } #1#2#3#4 { #1 ~ #4 ~ #2 } +\cs_new:cpn { @@_parse_model_hsb_1:nnnn } #1#2#3#4 { #3 ~ #1 ~ #2 } +\cs_new:cpn { @@_parse_model_hsb_2:nnnn } #1#2#3#4 { #2 ~ #1 ~ #4 } +\cs_new:cpn { @@_parse_model_hsb_3:nnnn } #1#2#3#4 { #2 ~ #3 ~ #1 } +\cs_new:cpn { @@_parse_model_hsb_4:nnnn } #1#2#3#4 { #4 ~ #2 ~ #1 } +\cs_new:cpn { @@_parse_model_hsb_5:nnnn } #1#2#3#4 { #1 ~ #2 ~ #3 } +\cs_new:cpn { @@_parse_model_hsb_6:nnnn } #1#2#3#4 { #1 ~ #2 ~ #2 } +\cs_new:Npn \@@_parse_model_HSB:w #1 , #2 , #3 , #4 \s_@@_stop + { + \exp_args:Neee \@@_parse_model_hsb:nnn + { \fp_eval:n {#1 / 240} } + { \fp_eval:n {#2 / 240} } + { \fp_eval:n {#3 / 240} } + } +\cs_new:Npn \@@_parse_model_HTML:w #1 , #2 \s_@@_stop + { \@@_parse_model_HTML_aux:w #1 0 0 0 0 0 0 \s_@@_stop } +\cs_new:Npn \@@_parse_model_HTML_aux:w #1#2#3#4#5#6#7 \s_@@_stop + { + { rgb } + { + \fp_eval:n { round(\int_from_hex:n {#1#2} / 255,5) } ~ + \fp_eval:n { round(\int_from_hex:n {#3#4} / 255,5) } ~ + \fp_eval:n { round(\int_from_hex:n {#5#6} / 255,5) } + } + } +\cs_new:Npn \@@_parse_model_RGB:w #1 , #2 , #3 , #4 \s_@@_stop + { + { rgb } + { + \fp_eval:n { round(#1 / 255,5) } ~ + \fp_eval:n { round(#2 / 255,5) } ~ + \fp_eval:n { round(#3 / 255,5) } + } + } +% \end{macrocode} +% Following the description in the \pkg{xcolor} manual. As we always use |rgb|, +% there is no need to find the sixth, we just pas the information straight +% to the |hsb| auxiliary defined earlier. +% \begin{macrocode} +\cs_new:Npn \@@_parse_model_wave:w #1 , #2 \s_@@_stop + { + { rgb } + { + \fp_compare:nNnTF {#1} < { 420 } + { \@@_parse_model_wave_auxi:nn {#1} { 0.3 + 0.7 * (#1 - 380) / 40 } + } + { + \fp_compare:nNnTF {#1} > { 700 } + { \@@_parse_model_wave_auxi:nn {#1} { 0.3 + 0.7 * (#1 - 780) / -80 } } + { \@@_parse_model_wave_auxi:nn {#1} { 1 } } + } + } + } +\cs_new:Npn \@@_parse_model_wave_auxi:nn #1#2 + { + \fp_compare:nNnTF {#1} < { 440 } + { + \@@_parse_model_wave_auxii:nn + { 4 + \@@_parse_model_wave_rho:n { (#1 - 440) / -60 } } + {#2} + } + { + \fp_compare:nNnTF {#1} < { 490 } + { + \@@_parse_model_wave_auxii:nn + { 4 - \@@_parse_model_wave_rho:n { (#1 - 440) / 50 } } + {#2} + } + { + \fp_compare:nNnTF {#1} < { 510 } + { + \@@_parse_model_wave_auxii:nn + { 2 + \@@_parse_model_wave_rho:n { (#1 - 510) / -20 } } + {#2} + } + { + \fp_compare:nNnTF {#1} < { 580 } + { + \@@_parse_model_wave_auxii:nn + { 2 - \@@_parse_model_wave_rho:n { (#1 - 510) / 70 } } + {#2} + } + { + \fp_compare:nNnTF {#1} < { 645 } + { + \@@_parse_model_wave_auxii:nn + { \@@_parse_model_wave_rho:n { (#1 - 645) / -65 } } + {#2} + } + { \@@_parse_model_wave_auxii:nn { 0 } {#2} } + } + } + } + } + } +\cs_new:Npn \@@_parse_model_wave_auxii:nn #1#2 + { + \exp_args:Neee \@@_parse_model_hsb_aux:nnn + { \fp_eval:n {#1} } + { 1 } + { \@@_parse_model_wave_rho:n {#2} } + } +\cs_new:Npn \@@_parse_model_wave_rho:n #1 + { \fp_eval:n { min(1, max(0,#1) ) } } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Selecting colors (and color models)} +% +% \begin{variable}{\l_color_fixed_model_tl} +% For selecting a single fixed model. +% \begin{macrocode} +\tl_new:N \l_color_fixed_model_tl +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_check_model:N} +% \begin{macro}{\@@_check_model:nn} +% Check that the model in use is the one required. +% \begin{macrocode} +\cs_new_protected:Npn \@@_check_model:N #1 + { + \tl_if_empty:NF \l_color_fixed_model_tl + { + \exp_after:wN \@@_check_model:nn #1 + \tl_if_eq:NNF \l_@@_model_tl \l_color_fixed_model_tl + { + \@@_convert:VVN \l_@@_model_tl \l_color_fixed_model_tl + \l_@@_value_tl + } + \tl_set:Nx #1 + { { \l_color_fixed_model_tl } { \l_@@_value_tl } } + } + } +\cs_new_protected:Npn \@@_check_model:nn #1#2 + { + \tl_set:Nn \l_@@_model_tl {#1} + \tl_set:Nn \l_@@_value_tl {#2} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_select:} +% A backend-neutral location for \enquote{last minute} manipulations before +% handing off to the backend code. We set the special |.| syntax here: this +% will therefore always be available. The finalisation is separate from the +% main function so it can also be applied to \emph{e.g.}~page color. +% \begin{macrocode} +\cs_new_protected:Npx \@@_select: + { + \tl_set:Nx \exp_not:c { l_@@_named_ . _tl } + { \exp_not:N \@@_model:N \exp_not:N \l_@@_current_tl } + \prop_clear:N \exp_not:c { l_@@_named_ . _prop } + \prop_put:NVx \exp_not:c { l_@@_named_ . _prop } + \exp_not:c { l_@@_named_ . _tl } + { \exp_not:N \@@_values:N \exp_not:N \l_@@_current_tl } + \@@_select:N \exp_not:N \l_@@_current_tl + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\color_select:n} +% \begin{macro}{\color_select:nn} +% \begin{macro}{\@@_select_main:Nw, \@@_select_loop:Nw} +% \begin{macro}{\@@_select:nnN} +% \begin{macro}{\@@_select_swap:Nnn} +% Parse the input expressions then get the backend to actually activate +% them. The main complexity here is the need to check through multiple models. +% That is done \enquote{locally} here as the approach is subtly different to +% when different models are being stored. +% \begin{macrocode} +\cs_new_protected:Npn \color_select:n #1 + { + \@@_parse:nN {#1} \l_@@_current_tl + \@@_select: + } +\cs_new_protected:Npn \color_select:nn #1#2 + { + \@@_select_main:Nw \l_@@_current_tl + #1 / / \s_@@_mark #2 / / \s_@@_stop + \@@_select: + } +% \end{macrocode} +% If the first color model is the fixed one, or if there is no fixed +% model, we don't need most of the data: just set up and apply the backend +% function. +% \begin{macrocode} +\cs_new_protected:Npn \@@_select_main:Nw + #1 #2 / #3 / #4 \s_@@_mark #5 / #6 / #7 \s_@@_stop + { + \@@_select:nnN {#2} {#5} #1 + \bool_lazy_or:nnF + { \tl_if_empty_p:N \l_color_fixed_model_tl } + { \str_if_eq_p:nV {#2} \l_color_fixed_model_tl } + { \@@_select_loop:Nw #1 #3 / #4 \s_@@_mark #6 / #7 \s_@@_stop } + } +% \end{macrocode} +% If a fixed model applies, we need to check each possible value in order. +% If there is no hit at all, fall back on the generic formula-based +% interchange. +% \begin{macrocode} +\cs_new_protected:Npn \@@_select_loop:Nw + #1 #2 / #3 \s_@@_mark #4 / #5 \s_@@_stop + { + \str_if_eq:nVTF {#2} \l_color_fixed_model_tl + { \@@_select:nnN {#2} {#4} #1 } + { + \tl_if_blank:nTF {#2} + { \exp_after:wN \@@_select_swap:Nnn \exp_after:wN #1 #1 } + { \@@_select_loop:Nw #1 #3 \s_@@_mark #5 \s_@@_stop } + } + } +\cs_new_protected:Npn \@@_select:nnN #1#2#3 + { + \cs_if_exist:cTF { @@_parse_model_ #1 :w } + { + \tl_set:Nx #3 + { \use:c { @@_parse_model_ #1 :w } #2 , 0 , 0 , 0 , 0 \s_@@_stop } + } + { \__kernel_msg_error:nnn { color } { unknown-model } {#1} } + } +\cs_new_protected:Npn \@@_select_swap:Nnn #1#2#3 + { + \@@_convert:nVnN {#2} \l_color_fixed_model_tl {#3} \l_@@_value_tl + \tl_set:Nx #1 + { { \l_color_fixed_model_tl } { \l_@@_value_tl } } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Fill and stroke color} +% +% \begin{macro}{\color_fill:n, \color_stroke:n} +% \begin{macro}{\color_fill:nn, \color_stroke:nn} +% \begin{macro}{\@@_draw:nnn} +% \begin{macrocode} +\cs_new_protected:Npn \color_fill:n #1 + { + \@@_parse:nN {#1} \l_@@_current_tl + \exp_after:wN \@@_draw:nnn \l_@@_current_tl { fill } + } +\cs_new_protected:Npn \color_stroke:n #1 + { + \@@_parse:nN {#1} \l_@@_current_tl + \exp_after:wN \@@_draw:nnn \l_@@_current_tl { stroke } + } +\cs_new_protected:Npn \color_fill:nn #1#2 + { + \@@_select_main:Nw \l_@@_current_tl + #1 / / \s_@@_mark #2 / / \s_@@_stop + \exp_after:wN \@@_draw:nnn \l_@@_current_tl { fill } + } +\cs_new_protected:Npn \color_stroke:nn #1#2 + { + \@@_select_main:Nw \l_@@_current_tl + #1 / / \s_@@_mark #2 / / \s_@@_stop + \exp_after:wN \@@_draw:nnn \l_@@_current_tl { stroke } + } +\cs_new_protected:Npn \@@_draw:nnn #1#2#3 + { \use:c { @@_backend_ #3 _ #1 :n } {#2} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Defining named colors} +% +% \begin{variable}{\l_@@_named_tl} +% Space to store the detail of the named color. +% \begin{macrocode} +\tl_new:N \l_@@_named_tl +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\color_set:nn} +% \begin{macro}{\@@_set:nnn} +% \begin{macro}{\@@_set:nn} +% \begin{macro}{\@@_set:nnw} +% \begin{macro}{\color_set:nnn} +% \begin{macro}{\@@_set_colon:nnw} +% \begin{macro}{\@@_set_loop:nw} +% \begin{macro}{\color_set_eq:nn} +% Defining named colors means working through the model list and saving +% both the \enquote{main} color and any equivalents in other models. Even +% if there is only one model, we store a |prop| as well as a |tl|, as there +% could be grouping weirdness, etc. When setting using an expression, +% we need to avoid any fixed model issues, which is done without a group as +% in \pkg{l3keys}. +% \begin{macrocode} +\cs_new_protected:Npn \color_set:nn #1#2 + { + \exp_args:NV \@@_set:nnn + \l_color_fixed_model_tl {#1} {#2} + } +\cs_new_protected:Npn \@@_set:nnn #1#2#3 + { + \tl_clear:N \l_color_fixed_model_tl + \@@_set:nn {#2} {#3} + \tl_set:Nn \l_color_fixed_model_tl {#1} + } +\cs_new_protected:Npn \@@_set:nn #1#2 + { + \str_if_eq:nnF {#1} { . } + { + \@@_parse:nN {#2} \l_@@_named_tl + \tl_clear_new:c { l_@@_named_ #1 _tl } + \tl_set:cx { l_@@_named_ #1 _tl } + { \@@_model:N \l_@@_named_tl } + \prop_clear_new:c { l_@@_named_ #1 _prop } + \prop_put:cvx { l_@@_named_ #1 _prop } { l_@@_named_ #1 _tl } + { \@@_values:N \l_@@_named_tl } + \@@_set:nnw {#1} {#2} #2 ! \s_@@_stop + } + } +% \end{macrocode} +% When setting an expression-based color, there could be multiple model +% data available for one or more of the input colors. Where that is true for +% the \emph{first} named color in an expression, we re-parse the expression +% when they are also parameter-based: only |cmyk|, |gray| and |rgb| make +% any sense here. There is a bit of a performance hit but this should be +% rare and taking place during set-up. +% \begin{macrocode} +\cs_new_protected:Npn \@@_set:nnw #1#2#3 ! #4 \s_@@_stop + { + \clist_map_inline:nn { cmyk , gray , rgb } + { + \prop_get:cnNT { l_@@_named_ #3 _prop } {##1} \l_@@_internal_tl + { + \prop_if_in:cnF { l_@@_named_ #1 _prop } {##1} + { + \group_begin: + \tl_set:cn { l_@@_named_ #3 _tl } {##1} + \@@_parse:nN {#2} \l_@@_internal_tl + \exp_args:NNNV \group_end: + \tl_set:Nn \l_@@_internal_tl \l_@@_internal_tl + \prop_put:cxx { l_@@_named_ #1 _prop } + { \@@_model:N \l_@@_internal_tl } + { \@@_values:N \l_@@_internal_tl } + } + } + } + } +\cs_new_protected:Npx \color_set:nnn #1#2#3 + { + \exp_not:N \str_if_eq:nnF {#1} { . } + { + \tl_clear_new:c { l_@@_named_ #1 _tl } + \prop_clear_new:c { l_@@_named_ #1 _prop } + \exp_not:N \@@_set_colon:nnw {#1} {#3} + #2 \c_colon_str \c_colon_str \exp_not:N \s_@@_stop + } + } +\use:x + { + \cs_new_protected:Npn \exp_not:N \@@_set_colon:nnw + ##1##2 ##3 \c_colon_str ##4 \c_colon_str + ##5 \exp_not:N \s_@@_stop + } + { + \tl_if_blank:nTF {#4} + { \@@_set_loop:nw {#1} #3 } + { \@@_set_loop:nw {#1} #4 } + / / \s_@@_mark #2 / / \s_@@_stop + } +\cs_new_protected:Npn \@@_set_loop:nw + #1#2 / #3 \s_@@_mark #4 / #5 \s_@@_stop + { + \tl_if_blank:nF {#2} + { + \@@_select:nnN {#2} {#4} \l_@@_named_tl + \tl_set:Nx \l_@@_internal_tl { \@@_model:N \l_@@_named_tl } + \tl_if_empty:cT { l_@@_named_ #1 _tl } + { \tl_set_eq:cN { l_@@_named_ #1 _tl } \l_@@_internal_tl } + \prop_put:cVx { l_@@_named_ #1 _prop } \l_@@_internal_tl + { \@@_values:N \l_@@_named_tl } + \@@_set_loop:nw {#1} #3 \s_@@_mark #5 \s_@@_stop + } + } +\cs_new_protected:Npn \color_set_eq:nn #1#2 + { + \@@_if_defined:nTF {#2} + { + \tl_clear_new:c { l_@@_named_ #1 _tl } + \prop_clear_new:c { l_@@_named_ #1 _prop } + \str_if_eq:nnTF {#2} { . } + { + \tl_set:cx { l_@@_named_ #1 _tl } + { \@@_model:N \l_@@_current_tl } + \prop_put:cvx { l_@@_named_ #1 _prop } { l_@@_named_ #1 _tl } + { \@@_values:N \l_@@_current_tl } + } + { + \tl_set_eq:cc { l_@@_named_ #1 _tl } { l_@@_named_ #2 _tl } + \prop_set_eq:cc { l_@@_named_ #1 _prop } { l_@@_named_ #2 _prop } + } + } + { + \__kernel_msg_error:nnn { color } { unknown-color } {#2} + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% A small set of colors are always defined. +% \begin{macrocode} +\color_set:nnn { black } { gray } { 0 } +\color_set:nnn { white } { gray } { 1 } +\color_set:nnn { cyan } { cmyk } { 1 , 0 , 0 , 0 } +\color_set:nnn { magenta } { cmyk } { 0 , 1 , 0 , 0 } +\color_set:nnn { yellow } { cmyk } { 0 , 0 , 1 , 0 } +\color_set:nnn { red } { rgb } { 1 , 0 , 0 } +\color_set:nnn { green } { rgb } { 0 , 1 , 0 } +\color_set:nnn { blue } { rgb } { 0 , 0 , 1 } +% \end{macrocode} +% +% \begin{variable}{\l_@@_named_._prop, \l_@@_named_._tl} +% A special named color: this is always defined though not fixed in +% definition. +% \begin{macrocode} +\prop_new:c { l_@@_named_._prop } +\tl_new:c { l_@@_named_._tl } +\tl_set:cx { l_@@_named_._tl } { \@@_model:N \l_@@_current_tl } +% \end{macrocode} +% \end{variable} +% +% \subsection{Exporting colors} +% +% \begin{macro}{\color_export:nnN} +% \begin{macro}{\color_export:nnnN} +% \begin{macro}{\@@_export:nN} +% \begin{macro}{\@@_export:nnnN} +% \begin{macrocode} +\cs_new_protected:Npn \color_export:nnN #1#2#3 + { + \group_begin: + \tl_if_exist:cT { c_@@_export_ #2 _tl } + { \tl_set_eq:Nc \l_color_fixed_model_tl { c_@@_export_ #2 _tl } } + \@@_parse:nN {#1} #3 + \@@_export:nN {#2} #3 + \exp_args:NNNV \group_end: + \tl_set:Nn #3 #3 + } +\cs_new_protected:Npn \color_export:nnnN #1#2#3#4 + { + \@@_select_main:Nw #4 + #1 / / \s_@@_mark #2 / / \s_@@_stop + \@@_export:nN {#3} #4 + } +\cs_new_protected:Npn \@@_export:nN #1#2 + { \exp_after:wN \@@_export:nnnN #2 {#1} #2 } +\cs_new:Npn \@@_export:nnnN #1#2#3#4 + { + \cs_if_exist_use:cF { @@_export_format_ #3 :nnN } + { + \__kernel_msg_error:nnn { color } { unknown-export-format } {#3} + \use_none:nnn + } + {#1} {#2} #4 + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_export_format_backend:nnN} +% Simple. +% \begin{macrocode} +\cs_new_protected:Npn \@@_export_format_backend:nnN #1#2#3 + { \tl_set:Nn #3 { {#1} {#2} } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_export:nnnNN} +% A generic auxiliary for cases where only one model is appropriate. +% \begin{macrocode} +\cs_new_protected:Npn \@@_export:nnnNN #1#2#3#4#5 + { + \str_if_eq:nnTF {#2} {#1} + { #5 #4 #3 \s_@@_stop } + { + \@@_convert:nnnN {#2} {#1} {#3} #4 + \exp_after:wN #5 \exp_after:wN #4 + #4 \s_@@_stop + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{variable} +% { +% \c_@@_export_HTML_tl , +% \c_@@_export_space-sep-cmyk_tl , +% \c_@@_export_space-sep-rgb_tl +% } +% \begin{macrocode} +\tl_const:Nn \c_@@_export_HTML_tl { rgb } +\tl_const:cn { c_@@_export_space-sep-cmyk_tl } { cmyk } +\tl_const:cn { c_@@_export_space-sep-rgb_tl } { rgb } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_export_format_space-sep-cmyk:nnN} +% \begin{macro}{\@@_export_space-sep-cmyk:Nw} +% \begin{macrocode} +\cs_new_protected:cpx { @@_export_format_space-sep-cmyk:nnN } #1#2#3 + { + \exp_not:N \@@_export:nnnNN { cmyk } {#1} {#2} #3 + \exp_not:c { @@_export_space-sep-cmyk:Nw } + } +\cs_new_protected:cpn { @@_export_space-sep-cmyk:Nw } #1#2 \s_@@_stop + { \tl_set:Nx #1 {#2} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro} +% { +% \@@_export_format_HTML:nnN , +% \@@_export_format_space-sep-rgb:nnN +% } +% \begin{macro} +% { +% \@@_export_HTML:Nw , +% \@@_export_space-sep-rgb:Nw +% } +% \begin{macro}[EXP]{\@@_export_HTML:n} +% \textsc{html} values must be given in |rgb|: we force conversion if +% required, then do some simple maths. +% \begin{macrocode} +\cs_new_protected:Npn \@@_export_format_HTML:nnN #1#2#3 + { \@@_export:nnnNN { rgb } {#1} {#2}#3 \@@_export_HTML:Nw } +\cs_new_protected:cpx { @@_export_format_space-sep-rgb:nnN } #1#2#3 + { + \exp_not:N \@@_export:nnnNN { rgb } {#1} {#2} #3 + \exp_not:c { @@_export_space-sep-rgb:Nw } + } +\cs_new_protected:Npn \@@_export_HTML:Nw #1#2 ~ #3 ~ #4 \s_@@_stop + { + \tl_set:Nx #1 + { + \@@_export_HTML:n {#2} + \@@_export_HTML:n {#3} + \@@_export_HTML:n {#4} + } + } +\cs_new:Npn \@@_export_HTML:n #1 + { + \fp_compare:nNnTF {#1} = { 0 } + { 00 } + { \int_to_Hex:n { \fp_to_int:n { #1 * 255 } } } + } +\cs_new_protected:cpn { @@_export_space-sep-rgb:Nw } #1#2 \s_@@_stop + { \tl_set:Nx #1 {#2} } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Additional color models} +% +% \begin{variable}{\l_@@_internal_prop} +% \begin{macrocode} +\prop_new:N \l_@@_internal_prop +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\g_@@_model_int} +% A tracker for the total number of new models. +% \begin{macrocode} +\int_new:N \g_@@_model_int +% \end{macrocode} +% \end{variable} +% +% \begin{variable} +% {\c_@@_fallback_cmyk_tl, \c_@@_fallback_gray_tl, \c_@@_fallback_rgb_tl} +% Conversion from Separation or DeviceN spaces may not be possible; have +% a fallback to black. +% \begin{macrocode} +\tl_const:Nn \c_@@_fallback_cmyk_tl { 0 ~ 0 ~ 0 ~ 1 } +\tl_const:Nn \c_@@_fallback_gray_tl { 1 } +\tl_const:Nn \c_@@_fallback_rgb_tl { 1 ~ 1 ~ 1 } +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\g_@@_colorants_prop} +% Mapping from names to colorants. +% \begin{macrocode} +\prop_new:N \g_@@_colorants_prop +\prop_gput:Nnn \g_@@_colorants_prop { black } { Black } +\prop_gput:Nnn \g_@@_colorants_prop { blue } { Blue } +\prop_gput:Nnn \g_@@_colorants_prop { cyan } { Cyan } +\prop_gput:Nnn \g_@@_colorants_prop { green } { Green } +\prop_gput:Nnn \g_@@_colorants_prop { magenta } { Magenta } +\prop_gput:Nnn \g_@@_colorants_prop { none } { None } +\prop_gput:Nnn \g_@@_colorants_prop { red } { Red } +\prop_gput:Nnn \g_@@_colorants_prop { yellow } { Yellow } +% \end{macrocode} +% \end{variable} +% +% \begin{variable} +% { +% \c_@@_model_whitepoint_CIELAB_a_tl , +% \c_@@_model_whitepoint_CIELAB_b_tl , +% \c_@@_model_whitepoint_CIELAB_e_tl , +% \c_@@_model_whitepoint_CIELAB_d50_tl , +% \c_@@_model_whitepoint_CIELAB_d55_tl , +% \c_@@_model_whitepoint_CIELAB_d65_tl , +% \c_@@_model_whitepoint_CIELAB_d75_tl +% } +% Whitepoint data for the CIELAB profiles. +% \begin{macrocode} +\tl_const:Nn \c_@@_model_whitepoint_CIELAB_a_tl { 1.0985 ~ 1 ~ 0.3558 } +\tl_const:Nn \c_@@_model_whitepoint_CIELAB_b_tl { 0.9807 ~ 1 ~ 1.1822 } +\tl_const:Nn \c_@@_model_whitepoint_CIELAB_e_tl { 1 ~ 1 ~ 1 } +\tl_const:cn { c_@@_model_whitepoint_CIELAB_d50_tl } { 0.9642 ~ 1 ~ 0.8251 } +\tl_const:cn { c_@@_model_whitepoint_CIELAB_d55_tl } { 0.9568 ~ 1 ~ 0.9214 } +\tl_const:cn { c_@@_model_whitepoint_CIELAB_d65_tl } { 0.9504 ~ 1 ~ 1.0888 } +\tl_const:cn { c_@@_model_whitepoint_CIELAB_d75_tl } { 0.9497 ~ 1 ~ 1.2261 } +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\c_@@_model_range_CIELAB_tl} +% The range for CIELAB color spaces. +% \begin{macrocode} +\tl_const:Nn \c_@@_model_range_CIELAB_tl { 0 ~ 100 ~ -128 ~ 127 ~ -128 ~ 127 } +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\g_@@_alternative_model_prop} +% For tracking the alternative model set up for separations, etc. +% \begin{macrocode} +\prop_new:N \g_@@_alternative_model_prop +\clist_map_inline:nn { cyan , magenta , yellow , black } + { \prop_gput:Nnn \g_@@_alternative_model_prop {#1} { cmyk } } +\clist_map_inline:nn { red , green , blue } + { \prop_gput:Nnn \g_@@_alternative_model_prop {#1} { rgb } } +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\g_@@_alternative_values_prop} +% Same for the values: a bit more involved. +% \begin{macrocode} +\prop_new:N \g_@@_alternative_values_prop +\prop_gput:Nnn \g_@@_alternative_values_prop { cyan } { 1 , 0 , 0 , 0 } +\prop_gput:Nnn \g_@@_alternative_values_prop { magenta } { 0 , 1 , 0 , 0 } +\prop_gput:Nnn \g_@@_alternative_values_prop { yellow } { 0 , 0 , 1 , 0 } +\prop_gput:Nnn \g_@@_alternative_values_prop { black } { 0 , 0 , 0 , 1 } +\prop_gput:Nnn \g_@@_alternative_values_prop { red } { 1 , 0 , 0 } +\prop_gput:Nnn \g_@@_alternative_values_prop { green } { 0 , 1 , 0 } +\prop_gput:Nnn \g_@@_alternative_values_prop { blue } { 0 , 0 , 1 } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\color_model_new:nnn, \@@_model_new:nnn} +% Set up a new model: in general this has to be handled by a family-dependent +% function. To avoid some \enquote{interesting} questions with casing, we +% fold the case of the family name. The key--value list should always be +% present, so we convert it up-front to a |prop|, then deal with the detail +% on a per-family basis. +% \begin{macrocode} +\cs_new_protected:Npn \color_model_new:nnn #1#2#3 + { + \exp_args:Nee \@@_model_new:nnn + { \tl_to_str:n {#1} } + { \str_foldcase:n {#2} } {#3} + } +\cs_new_protected:Npn \@@_model_new:nnn #1#2#3 + { + \cs_if_exist:cTF { @@_parse_model_ #1 :w } + { + \__kernel_msg_error:nnn { color } { model-already-defined } {#1} + } + { + \cs_if_exist:cTF { @@_model_ #2 :n } + { + \prop_set_from_keyval:Nn \l_@@_internal_prop {#3} + \use:c { @@_model_ #2 :n } {#1} + } + { + \__kernel_msg_error:nnn { color } { unknown-model-type } {#2} + } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_model_separation:n} +% \begin{macro}{\@@_model_separation:nn} +% \begin{macro}{\@@_model_separation:nnn} +% \begin{macro}{\@@_model_separation:w} +% \begin{macro} +% { +% \@@_model_separation_cmyk:nnnnnn , +% \@@_model_separation_gray:nnnnnn , +% \@@_model_separation_rgb:nnnnnn +% } +% \begin{macro}{\@@_model_convert:nnn} +% \begin{macro}{\@@_model_separation_CIELAB:nnnnnn} +% \begin{macro}{\@@_model_separation_CIELAB:nnnnnnn} +% Separations must have a \enquote{real} name, which is pretty easy to find. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_separation:n #1 + { + \prop_get:NnNTF \l_@@_internal_prop { name } + \l_@@_internal_tl + { + \exp_args:NV \@@_model_separation:nn + \l_@@_internal_tl {#1} + } + { + \__kernel_msg_error:nnn { color } + { separation-requires-name } {#1} + } + } +% \end{macrocode} +% We have two keys to find at this stage: the alternative space model +% and linked values. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_separation:nn #1#2 + { + \prop_get:NnNTF \l_@@_internal_prop { alternative-model } + \l_@@_internal_tl + { + \exp_args:NV \@@_model_separation:nnn + \l_@@_internal_tl {#2} {#1} + } + { + \__kernel_msg_error:nnn { color } + { separation-alternative-model } {#2} + } + } +\cs_new_protected:Npn \@@_model_separation:nnn #1#2#3 + { + \cs_if_exist:cTF { @@_model_separation_ #1 :nnnnnn } + { + \prop_get:NnNTF \l_@@_internal_prop { alternative-values } + \l_@@_internal_tl + { + \exp_after:wN \@@_model_separation:w \l_@@_internal_tl + , 0 , 0 , 0 , 0 \s_@@_stop {#2} {#3} {#1} + } + { + \__kernel_msg_error:nnn { color } + { separation-alternative-values } {#2} + } + } + { + \__kernel_msg_error:nnn { color } + { unknown-alternative-model } {#1} + } + } +% \end{macrocode} +% As each alternative space leads to a different requirement for conversion, +% and as there are only a small number of choices, we manually split the data +% and then set up. Notice that mixing tints is really just the same +% as mixing \texttt{gray}. The \texttt{white} color is special, as it allows +% tints to be adjusted without an additional color space. To make sure the +% data is set for that at all group levels, we need to work on a per-level +% basis. Within the output, only the set-up needs the \enquote{real} name +% of the colorspace: we use a simple tracking number for general usage +% as this is a clear namespace without issues of escaping chars. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_separation:w + #1 , #2 , #3 , #4 , #5 \s_@@_stop #6#7#8 + { + \int_gincr:N \g_@@_model_int + \tl_const:cn { c_@@_fallback_ #6 _tl } { 1 } + \cs_new_eq:cN { @@_parse_mix_ #6 :nw } \@@_parse_mix_gray:nw + \cs_new:cpn { @@_parse_model_ #6 :w } ##1 , ##2 \s_@@_stop + { {#6} { \@@_parse_number:n {##1} } } + \clist_map_inline:nn { fill , stroke , select } + { + \cs_new_protected:cpx { @@_backend_ ##1 _ #6 :n } ####1 + { + \exp_not:c { @@_backend_ ##1 _ separation:nn } + { color \int_use:N \g_@@_model_int } {####1} + } + } + \use:c { @@_model_separation_ #8 :nnnnnn } + {#6} {#7} {#1} {#2} {#3} {#4} + \prop_gput:Nnn \g_@@_alternative_model_prop {#6} {#8} + \prop_gput:Nnx \g_@@_colorants_prop {#6} + { \str_convert_pdfname:n {#7} } + \cs_new_protected:cpx { @@_model_ #6 _white: } + { + \prop_put:Nnn \exp_not:N \l_@@_named_white_prop {#6} { 0 } + \exp_not:N \int_compare:nNnF { \tex_currentgrouplevel:D } = 0 + { \group_insert_after:N \exp_not:c { @@_model_ #6 _ white: } } + } + \use:c { @@_model_ #6 _white: } + } +\cs_new_protected:Npn \@@_model_separation_cmyk:nnnnnn #1#2#3#4#5#6 + { + \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop + { + \fp_eval:n {##1 * #3} ~ + \fp_eval:n {##1 * #4} ~ + \fp_eval:n {##1 * #5} ~ + \fp_eval:n {##1 * #6} + } + \@@_model_convert:nnn {#1} { cmyk } { rgb } + \@@_model_convert:nnn {#1} { cmyk } { gray } + \prop_gput:Nnn \g_@@_alternative_values_prop {#1} { #3 , #4 , #5 , #6 } + \@@_backend_separation_init:nnnnn {#2} { /DeviceCMYK } { } + { 0 ~ 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 ~ #6 } + } +\cs_new_protected:Npn \@@_model_separation_rgb:nnnnnn #1#2#3#4#5#6 + { + \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop + { + \fp_eval:n {##1 * #3} ~ + \fp_eval:n {##1 * #4} ~ + \fp_eval:n {##1 * #5} + } + \@@_model_convert:nnn {#1} { rgb } { cmyk } + \@@_model_convert:nnn {#1} { rgb } { gray } + \prop_gput:Nnn \g_@@_alternative_values_prop {#1} { #3 , #4 , #5 } + \@@_backend_separation_init:nnnnn {#2} { /DeviceRGB } { } + { 0 ~ 0 ~ 0 } { #3 ~ #4 ~ #5 } + } +\cs_new_protected:Npn \@@_model_separation_gray:nnnnnn #1#2#3#4#5#6 + { + \cs_new:cpn { @@_convert_ #1 _cmyk:w } ##1 ~ ##2 \s_@@_stop + { + \fp_eval:n {##1 * #3} ~ + \fp_eval:n {##1 * #3} ~ + \fp_eval:n {##1 * #3} ~ + \fp_eval:n {##1 * #3} + } + \cs_new:cpn { @@_convert_ #1 _gray:w } ##1 ~ ##2 \s_@@_stop + { \fp_eval:n {##1 * #3} } + \cs_new:cpn { @@_convert_ #1 _rgb:w } ##1 ~ ##2 \s_@@_stop + { + \fp_eval:n {##1 * #3} ~ + \fp_eval:n {##1 * #3} ~ + \fp_eval:n {##1 * #3} + } + \prop_gput:Nnn \g_@@_alternative_values_prop {#1} {#3} + \@@_backend_separation_init:nnnnn {#2} { /DeviceGray } { } { 0 } {#3} + } +% \end{macrocode} +% Generic model conversion \emph{via} an alternative intermediate. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_convert:nnn #1#2#3 + { + \cs_new:cpx { @@_convert_ #1 _ #3 :w } ##1 ~ ##2 \s_@@_stop + { + \exp_not:N \exp_args:NNe \exp_not:N \use:nn + \exp_not:c { @@_convert_ #2 _ #3 :w } + { \exp_not:c { @@_convert_ #1 _ #2 :w } ##1 ~ ##2 \s_@@_stop } + \c_space_tl \exp_not:N \s_@@_stop + } + } +% \end{macrocode} +% Setting up for CIELAB needs a bit more work: there is the illuminant and +% the need for an appropriate object. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_separation_CIELAB:nnnnnn #1#2#3#4#5#6 + { + \prop_get:NnNF \l_@@_internal_prop { illuminant } + \l_@@_internal_tl + { + \__kernel_msg_error:nnn { color } + { CIELAB-requires-illuminant } {#1} + \tl_set:Nn \l_@@_internal_tl { d50 } + } + \exp_args:NV \@@_model_separation_CIELAB:nnnnnnn + \l_@@_internal_tl {#1} {#2} {#3} {#4} {#5} {#6} + } +% \end{macrocode} +% If a CIELAB space is being set up, we need the illuminant, then create +% the appropriate set up. At present, this doesn't include \texttt{BlackPoint} +% or \texttt{Range} data, but that may be added later. As CIELAB colors +% cannot be converted to anything else, we fallback to producing black: the +% user should set up a second model for colors set up this way. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_separation_CIELAB:nnnnnnn #1#2#3#4#5#6#7 + { + \tl_if_exist:cTF { c_@@_model_whitepoint_CIELAB_ #1 _tl } + { + \@@_backend_separation_init_CIELAB:nnn {#1} {#3} { #4 ~ #5 ~ #6 } + \cs_new:cpn { @@_convert_ #2 _cmyk:w } ##1 ~ ##2 \s_@@_stop + { 0 ~ 0 ~ 0 ~ 1 } + \cs_new:cpn { @@_convert_ #2 _rgb:w } ##1 ~ ##2 \s_@@_stop + { 1 ~ 1 ~ 1 } + \cs_new:cpn { @@_convert_ #2 _gray:w } ##1 ~ ##2 \s_@@_stop + { 1 } + } + { + \__kernel_msg_error:nnn { color } + { unknown-CIELAB-illuminant } {#1} + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@@_model_devicen:n} +% \begin{macro}{\@@_model_devicen:nn} +% \begin{macro}{\@@_model_devicen:nnn} +% \begin{macro}{\@@_model_devicen:nnnn} +% \begin{macro} +% { +% \@@_model_devicen_parse_1:nn , +% \@@_model_devicen_parse_2:nn , +% \@@_model_devicen_parse_3:nn , +% \@@_model_devicen_parse_4:nn , +% \@@_model_devicen_parse_generic:nn +% } +% \begin{macro}[EXP]{\@@_model_devicen_parse:nw} +% \begin{macro}[EXP]{\@@_model_devicen_mix:nw} +% \begin{macro}{\@@_model_devicen_init:nnn} +% \begin{macro}{\@@_model_devicen_init:nnnn} +% \begin{macro}{\@@_model_devicen_tranform:w} +% \begin{macro} +% { +% \@@_model_devicen_tranform_1:nnnnn , +% \@@_model_devicen_tranform_3:nnnnn , +% \@@_model_devicen_tranform_4:nnnnn , +% } +% \begin{macro}{\@@_model_devicen_tranform:nnn} +% \begin{macro}[EXP]{\@@_model_devicen_colorant:n} +% \begin{macro}{\@@_model_devicen_convert:nnn} +% \begin{macro} +% { +% \@@_model_devicen_convert_cmyk:n , +% \@@_model_devicen_convert_gray:n , +% \@@_model_devicen_convert_rgb:n +% } +% \begin{macro}{\@@_model_devicen_convert:nnnn} +% \begin{macro}[EXP]{\@@_model_devicen_convert:n, \@@_model_devicen_convert_aux:n} +% \begin{macro}[EXP]{\@@_model_devicen_convert:w} +% \begin{macro}[EXP]{\@@_convert_devicen_cmyk:nnnnw} +% \begin{macro}[EXP]{\@@_convert_devicen_cmyk:nnnnnnnnn} +% \begin{macro}[EXP]{\@@_convert_devicen_cmyk_aux:nnnnw} +% \begin{macro}[EXP]{\@@_convert_devicen_gray:nw} +% \begin{macro}[EXP]{\@@_convert_devicen_gray:nnn} +% \begin{macro}[EXP]{\@@_convert_devicen_gray_aux:nw} +% \begin{macro}[EXP]{\@@_convert_devicen_rgb:nnnw} +% \begin{macro}[EXP]{\@@_convert_devicen_rgb:nnnnnnn} +% \begin{macro}[EXP]{\@@_convert_devicen_rgb_aux:nnnw} +% We require a list of component names here: one might call them colorants, +% but it's convenient to use \TeX{} names instead so we slightly adjust the +% terminology. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_devicen:n #1 + { + \prop_get:NnNTF \l_@@_internal_prop { names } + \l_@@_internal_tl + { + \exp_args:NV \@@_model_devicen:nn + \l_@@_internal_tl {#1} + } + { + \__kernel_msg_error:nnn { color } + { DeviceN-requires-names } {#1} + } + } +% \end{macrocode} +% All valid models will have an alternative listed, either hard-coded for +% the core device ones, or dynamically added for Separations, etc. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_devicen:nn #1#2 + { + \tl_clear:N \l_@@_model_tl + \clist_map_inline:nn {#1} + { + \prop_get:NnNTF \g_@@_alternative_model_prop {##1} + \l_@@_internal_tl + { + \tl_if_empty:NTF \l_@@_model_tl + { \tl_set_eq:NN \l_@@_model_tl \l_@@_internal_tl } + { + \str_if_eq:VVF \l_@@_model_tl \l_@@_internal_tl + { + \__kernel_msg_error:nnn { color } + { DeviceN-inconsistent-alternative } + {#2} + \clist_map_break:n { \use_none:nnnn } + } + } + } + { + \str_if_eq:nnF {##1} { none } + { + \__kernel_msg_error:nnn { color } + { DeviceN-no-alternative } + {#2} + } + } + } + \tl_if_empty:NTF \l_@@_model_tl + { + \__kernel_msg_error:nnn { color } + { DeviceN-no-alternative } {#2} + } + { \exp_args:NV \@@_model_devicen:nnn \l_@@_model_tl {#1} {#2} } + } +% \end{macrocode} +% We now complete the data we require by first finding out how many +% colorants there are, then moving on to begin constructing the function +% required to map to the alternative color space. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_devicen:nnn #1#2#3 + { + \exp_args:Nx \@@_model_devicen:nnnn + { \clist_count:n {#2} } {#1} {#2} {#3} + } +% \end{macrocode} +% At this stage, we have checked everything is in place, so we can set up +% the \TeX{} and backend data structures. As for separations, it's not really +% possible in general to have a fallback, so we simply provide +% \enquote{black} for each element. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_devicen:nnnn #1#2#3#4 + { + \int_gincr:N \g_@@_model_int + \tl_const:cx { c_@@_fallback_ #4 _tl } + { \prg_replicate:nn {#1} { 1 ~ } } + \cs_if_exist_use:cF { @@_model_devicen_parse_ #1 :nn } + { \@@_model_devicen_parse_generic:nn } + {#4} {#1} + \clist_map_inline:nn { fill , stroke , select } + { + \cs_new_protected:cpx { @@_backend_ ##1 _ #4 :n } ####1 + { + \exp_not:c { @@_backend_ ##1 _ devicen:nn } + { color \int_use:N \g_@@_model_int } {####1} + } + } + \cs_new_protected:cpx { @@_model_ #4 _white: } + { + \prop_put:Nnn \exp_not:N \l_@@_named_white_prop {#4} + { \prg_replicate:nn {#1} { 0 ~ } } + \exp_not:N \int_compare:nNnF { \tex_currentgrouplevel:D } = 0 + { \group_insert_after:N \exp_not:c { @@_model_ #4 _ white: } } + } + \use:c { @@_model_ #4 _white: } + \@@_model_devicen_init:nnn {#1} {#2} {#3} + \@@_model_devicen_convert:nnn {#4} {#2} {#3} + } +% \end{macrocode} +% For short lists of DeviceN colors, wee can use hand-tuned parsing. This +% lines up with other models, where we allow for up to four components. For +% larger spaces,. rather than limit artificially, we use a somewhat slow +% approach based on open-ended commas-lists. +% \begin{macrocode} +\cs_new_protected:cpn { @@_model_devicen_parse_1:nn } #1#2 + { + \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 \s_@@_stop + { {#1} { \@@_parse_number:n {##1} } } + \cs_new_eq:cN { @@_parse_mix_ #1 :nw } \@@_parse_mix_gray:nw + } +\cs_new_protected:cpn { @@_model_devicen_parse_2:nn } #1#2 + { + \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 , ##3 \s_@@_stop + { {#1} { \@@_parse_number:n {##1} ~ \@@_parse_number:n {##2} } } + \cs_new:cpn { @@_parse_mix_ #1 :nw } + ##1##2 ~ ##3 \s_@@_mark ##4 ~ ##5 \s_@@_stop + { + \fp_eval:n { ##2 * ##1 + ##4 * ( 1 - ##1 ) } \c_space_tl + \fp_eval:n { ##3 * ##1 + ##5 * ( 1 - ##1 ) } + } + } +\cs_new_protected:cpn { @@_model_devicen_parse_3:nn } #1#2 + { + \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 , ##3 , ##4 \s_@@_stop + { + {#1} + { + \@@_parse_number:n {##1} ~ + \@@_parse_number:n {##2} ~ + \@@_parse_number:n {##3} + } + } + \cs_new_eq:cN { @@_parse_mix_ #1 :nw } \@@_parse_mix_rgb:nw + } +\cs_new_protected:cpn { @@_model_devicen_parse_4:nn } #1#2 + { + \cs_new:cpn { @@_parse_model_ #1 :w } + ##1 , ##2 , ##3 , ##4 , ##5 \s_@@_stop + { + {#1} + { + \@@_parse_number:n {##1} ~ + \@@_parse_number:n {##2} ~ + \@@_parse_number:n {##3} ~ + \@@_parse_number:n {##4} + } + } + \cs_new_eq:cN { @@_parse_mix_ #1 :nw } \@@_parse_mix_cmyk:nw + } +\cs_new_protected:Npn \@@_model_devicen_parse_generic:nn #1#2 + { + \cs_new:cpn { @@_parse_model_ #1 :w } ##1 , ##2 \s_@@_stop + { + {#1} + { \@@_model_devicen_parse:nw {#2} ##1 , ##2 , \q_nil , \s_@@_stop } + } + \cs_new:cpx { @@_parse_mix_ #1 :nw } + ##1 ##2 \s_@@_mark ##3 \s_@@_stop + { + \exp_not:N \@@_model_devicen_mix:nw {##1} + ##2 \c_space_tl \exp_not:N \q_nil \c_space_tl \exp_not:N \s_@@_mark + ##3 \c_space_tl \exp_not:N \q_nil \c_space_tl \exp_not:N \s_@@_stop + } + } +\cs_new:Npn \@@_model_devicen_parse:nw #1#2 , #3 \s_@@_stop + { + \int_compare:nNnT {#1} > 0 + { + \quark_if_nil:nTF {#2} + { \prg_replicate:nn {#1} { 0 ~ } } + { + \@@_parse_number:n {#2} + \int_compare:nNnT {#1} > 1 { ~ } + \exp_args:Nf \@@_model_devicen_parse:nw + { \int_eval:n { #1 - 1 } } #3 \s_@@_stop + } + } + } +\cs_new:Npn \@@_model_devicen_mix:nw #1#2 ~ #3 \s_@@_mark #4 ~ #5 \s_@@_stop + { + \fp_eval:n { #2 * #1 + #4 * ( 1 - #1 ) } + \quark_if_nil:oF { \tl_head:w #3 \q_stop } + { + \c_space_tl + \@@_model_devicen_mix:nw {#1} #3 \s_@@_mark #5 \s_@@_stop + } + } +% \end{macrocode} +% To construct the tint transformation, we have to use PostScript. The +% aim is to have the final tint for each device colorant as +% \[ +% 1 - \prod_{n} (1 - X_{n} D_{X_{n}}) +% \] +% where $X$ is a DeviceN colorant and $D$ is the amount of device colorant +% that the DeviceN colorant maps to. At the start of the process, the +% PostScript stack will contain the $X_{n}$ values, whilst we have the +% $D$ values on a per-DeviceN colorant basis. The more convenient approach +% for us is therefore to take each DeviceN colorant in turn and find the +% value $1 - X_{n} D_{X_{n}}$, multiplying as we go, and finalise with the +% subtraction. That contrasts to \pkg{colorspace}: it splits the process +% up by process color, which works better when you have a fixed list +% of colorants. (\pkg{colorspace} only supports up to $4$ DeviceN colors, +% and only \texttt{cmyk} as the alternative space.) To set this up, +% we first need to know the number of values in the target color space: +% this is easily handled as there are a very small range of possibles. +% Once we have that information, it's relatively easy to build the required +% PostScript using some generic code. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_devicen_init:nnn #1#2#3 + { + \exp_args:Ne \@@_model_devicen_init:nnnn + { + \str_case:nn {#2} + { + { cmyk } { 4 } + { gray } { 1 } + { rgb } { 3 } + } + } + {#1} {#2} {#3} + } +% \end{macrocode} +% As we always need to split the alternative values into parts, we use a +% shared auxiliary and only use a minimal difference between code paths. +% Construction of the tint transformation is as far as possible done using +% loops, which means there are some inefficiencies for device colors in +% the \texttt{DeviceN} space: we roll the stack one-at-a-time even if there +% is a potential shortcut. However, that way there is nothing to special-case. +% Once this is sorted, we can write the tint transform object, which will +% remain as the last object until we sort out the final step: the colorant +% list. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_devicen_init:nnnn #1#2#3#4 + { + \tl_set:Nx \l_@@_internal_tl + { \prg_replicate:nn {#1} { 1.0 ~ } } + \int_zero:N \l_@@_internal_int + \clist_map_inline:nn {#4} + { + \int_incr:N \l_@@_internal_int + \prop_get:NnN \g_@@_alternative_values_prop {##1} + \l_@@_value_tl + \exp_after:wN \@@_model_devicen_transform:w + \l_@@_value_tl , 0 , 0 , 0 \s_@@_stop {#1} {#2} + } + \tl_put_right:Nx \l_@@_internal_tl + { + \prg_replicate:nn {#1} + { neg ~ 1.0 ~ add ~ #1 ~ -1 ~ roll ~ } + \int_eval:n { #2 + 4 } ~ 4 ~ roll + \prg_replicate:nn {#2} { ~ pop } + } + \use:x + { + \@@_backend_devicen_init:nnn + { + \clist_map_function:nN {#4} + \@@_model_devicen_colorant:n + } + { + \str_case:nn {#3} + { + { cmyk } { /DeviceCMYK } + { gray } { /DeviceGray } + { rgb } { /DeviceRGB } + } + } + { \exp_not:V \l_@@_internal_tl } + } + } +\cs_new_protected:Npn \@@_model_devicen_transform:w + #1 , #2 , #3 , #4 , #5 \s_@@_stop #6#7 + { + \use:c { @@_model_devicen_transform_ #6 :nnnnn } + {#1} {#2} {#3} {#4} {#7} + } +\cs_new_protected:cpn { @@_model_devicen_transform_1:nnnnn } #1#2#3#4#5 + { \@@_model_devicen_transform:nnn {#5} { 1 } {#1} } +\cs_new_protected:cpn { @@_model_devicen_transform_3:nnnnn } #1#2#3#4#5 + { + \clist_map_inline { #1 , #2 , #3 } + { \@@_model_devicen_transform:nnn {#5} { 3 } {##1} } + } +\cs_new_protected:cpn { @@_model_devicen_transform_4:nnnnn } #1#2#3#4#5 + { + \clist_map_inline:nn { #1 , #2 , #3 , #4 } + { \@@_model_devicen_transform:nnn {#5} { 4 } {##1} } + } +\cs_new_protected:Npn \@@_model_devicen_transform:nnn #1#2#3 + { + \tl_put_right:Nx \l_@@_internal_tl + { + \fp_compare:nNnF {#3} = \c_zero_fp + { + \int_eval:n { #1 - \l_@@_internal_int + #2 } ~ index ~ + #3 ~ neg ~ mul ~ 1.0 ~ add ~ mul ~ + } + #2 ~ -1 ~ roll ~ + } + } +\cs_new:Npn \@@_model_devicen_colorant:n #1 + { + / \prop_item:Nn \g_@@_colorants_prop {#1} ~ + } +% \end{macrocode} +% Here we need to set up conversion from the DeviceN space to the alternative +% at the \TeX{} level. This also means supplying methods for inter-converting +% to other parameter-based spaces. Essentially the approach is exactly the same +% as the PostScript, just expressed in \TeX{} terms. +% \begin{macrocode} +\cs_new_protected:Npn \@@_model_devicen_convert:nnn #1#2#3 + { + \use:c { @@_model_devicen_convert_ #2 :nn } {#1} {#3} + } +\cs_new_protected:Npn \@@_model_devicen_convert_cmyk:nn #1#2 + { + \@@_model_convert:nnn {#1} { cmyk } { gray } + \@@_model_convert:nnn {#1} { cmyk } { rgb } + \@@_model_devicen_convert:nnnn {#1} { cmyk } { 4 } {#2} + } +\cs_new_protected:Npn \@@_model_devicen_convert_gray:nn #1#2 + { + \@@_model_convert:nnn {#1} { gray } { cmyk } + \@@_model_convert:nnn {#1} { gray } { rgb } + \@@_model_devicen_convert:nnnn {#1} { gray } { 1 } {#2} + } +\cs_new_protected:Npn \@@_model_devicen_convert_rgb:nn #1#2 + { + \@@_model_convert:nnn {#1} { rgb } { cmyk } + \@@_model_convert:nnn {#1} { rgb } { gray } + \@@_model_devicen_convert:nnnn {#1} { rgb } { 3 } {#2} + } +\cs_new_protected:Npn \@@_model_devicen_convert:nnnn #1#2#3#4 + { + \cs_new:cpx { @@_convert_ #1 _ #2 :w } ##1 \s_@@_stop + { + \exp_not:c { @@_convert_devicen_ #2 : \prg_replicate:nn {#3} { n } w } + \prg_replicate:nn {#3} { { 1 } } + ##1 \exp_not:N \s_@@_mark + \clist_map_function:nN {#4} \@@_model_devicen_convert:n + \exp_not:N \s_@@_stop + } + } +\cs_new:Npn \@@_model_devicen_convert:n #1 + { + { + \exp_args:Ne \@@_model_devicen_convert_aux:n + { \prop_item:Nn \g_@@_alternative_values_prop {#1} } + } + } +\cs_new:Npn \@@_model_devicen_convert_aux:n #1 + { \@@_model_devicen_convert_aux:w #1 , , , , \s_@@_stop } +\cs_new:Npn \@@_model_devicen_convert_aux:w #1 , #2 , #3 , #4 , #5 \s_@@_stop + { + {#1} + \tl_if_blank:nF {#2} + { + {#2} + \tl_if_blank:nF {#3} + { + {#3} + \tl_if_blank:nF {#4} { {#4} } + } + } + } +\cs_new:Npn \@@_convert_devicen_cmyk:nnnnw + #1#2#3#4#5 ~ #6 \s_@@_mark #7#8 \s_@@_stop + { + \@@_convert_devicen_cmyk:nnnnnnnnn {#5} {#1} {#2} {#3} {#4} #7 + #6 \s_@@_mark #8 \s_@@_stop + } +\cs_new:Npn \@@_convert_devicen_cmyk:nnnnnnnnn #1#2#3#4#5#6#7#8#9 + { + \use:e + { + \exp_not:N \@@_convert_devicen_cmyk_aux:nnnnw + { \fp_eval:n { #2 * (1 - (#1 * #6)) } } + { \fp_eval:n { #3 * (1 - (#1 * #7)) } } + { \fp_eval:n { #4 * (1 - (#1 * #8)) } } + { \fp_eval:n { #5 * (1 - (#1 * #9)) } } + } + } +\cs_new:Npn \@@_convert_devicen_cmyk_aux:nnnnw + #1#2#3#4 #5 \s_@@_mark #6 \s_@@_stop + { + \tl_if_blank:nTF {#5} + { + \fp_eval:n { 1 - #1 } ~ + \fp_eval:n { 1 - #2 } ~ + \fp_eval:n { 1 - #3 } ~ + \fp_eval:n { 1 - #4 } + } + { + \@@_convert_devicen_cmyk:nnnnw {#1} {#2} {#3} {#4} + #5 \s_@@_mark #6 \s_@@_stop + } + } +\cs_new:Npn \@@_convert_devicen_gray:nw + #1#2 ~ #3 \s_@@_mark #4#5 \s_@@_stop + { + \@@_convert_devicen_gray:nnn {#2} {#1} #4 + #3 \s_@@_mark #5 \s_@@_stop + } +\cs_new:Npn \@@_convert_devicen_gray:nnn #1#2#3 + { + \exp_arsgs:Ne \@@_convert_devicen_gray_aux:nw + { \fp_eval:n { #2 * (1 - (#1 * #3)) } } + } +\cs_new:Npn \@@_convert_devicen_gray_aux:nw + #1 #2 \s_@@_mark #3 \s_@@_stop + { + \tl_if_blank:nTF {#2} + { \fp_eval:n { 1 - #1 } } + { + \@@_convert_devicen_gray:nw {#1} + #2 \s_@@_mark #3 \s_@@_stop + } + } +\cs_new:Npn \@@_convert_devicen_rgb:nnnw + #1#2#3#4 ~ #5 \s_@@_mark #6#7 \s_@@_stop + { + \@@_convert_devicen_cmyk:nnnnnn {#4} {#1} {#2} {#3} #6 + #5 \s_@@_mark #7 \s_@@_stop + } +\cs_new:Npn \@@_convert_devicen_rgb:nnnnnnn #1#2#3#4#5#6#7 + { + \use:e + { + \exp_not:N \@@_convert_devicen_rgb_aux:nnnw + { \fp_eval:n { #2 * (1 - (#1 * #5)) } } + { \fp_eval:n { #3 * (1 - (#1 * #6)) } } + { \fp_eval:n { #4 * (1 - (#1 * #7)) } } + } + } +\cs_new:Npn \@@_convert_devicen_rgb_aux:nnnw + #1#2#3 #4 \s_@@_mark #5 \s_@@_stop + { + \tl_if_blank:nTF {#4} + { + \fp_eval:n { 1 - #1 } ~ + \fp_eval:n { 1 - #2 } ~ + \fp_eval:n { 1 - #3 } + } + { + \@@_convert_devicen_rgb:nnnw {#1} {#2} {#3} + #4 \s_@@_mark #5 \s_@@_stop + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Diagnostics} +% +% \begin{macro}{\color_show:n} +% \begin{macro}{\@@_show:n} +% Extract the information about a color and format for the user: the approach +% is similar to the keys module here. +% \begin{macrocode} +\cs_new_protected:Npn \color_show:n #1 + { + \msg_show:nnxxxx { LaTeX / color } { show } + {#1} + { + \@@_if_defined:nT {#1} + { + \exp_args:Nv \@@_show:n { l_@@_named_ #1 _tl } + \prop_map_function:cN + { l_@@_named_ #1 _prop } + \msg_show_item_unbraced:nn + } + } + { } + { } + } +\cs_new:Npn \@@_show:n #1 + { + \msg_show_item_unbraced:nn { model } {#1} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Messages} +% +% \begin{macrocode} +\__kernel_msg_new:nnnn { color } { CIELAB-requires-illuminant } + { CIELAB~color~space~'#1'~require~an~illuminant. } + { + LaTeX~has~been~asked~to~create~a~separation~color~space~using~ + CIELAB~specifications,~but~no~\\ \\ + \iow_indent:n { illuminant~=~ } + \\ \\ + key~was~given~with~the~correct~information.~LaTeX~will~use~illuminant~ + 'd50'~for~recovery. + } +\__kernel_msg_new:nnnn { color } { conversion-not-available } + { No~model~conversion~available~from~'#1'~to~'#2'. } + { + LaTeX~has~been~asked~to~convert~a~color~from~model~'#1'~ + to~model'#2',~but~there~is~no~method~available~to~do~that. + } +\__kernel_msg_new:nnnn { color } { DeviceN-inconsistent-alternative } + { DeviceN~color~spaces~require~a~single~alternative~space. } + { + LaTeX~has~been~asked~to~create~a~DeviceN~color~space~'#1',~ + but~the~constituent~colors~do~not~have~a~common~alternative~ + color. + } +\__kernel_msg_new:nnnn { color } { DeviceN-no-alternative } + { DeviceN~color~spaces~require~an~alternative~space. } + { + LaTeX~has~been~asked~to~create~a~DeviceN~color~space~'#1',~ + but~the~constituent~colors~do~not~all~have~a~device-based~alternative. + } +\__kernel_msg_new:nnnn { color } { DeviceN-requires-names } + { DeviceN~color~space~'#1'~require~a~list~of~names. } + { + LaTeX~has~been~asked~to~create~a~DeviceN~color~space,~ + but~no~\\ \\ + \iow_indent:n { names~=~ } + \\ \\ + key~was~given~with~the~correct~information. + } +\__kernel_msg_new:nnnn { color } { model-already-defined } + { Color~model~'#1'~already~defined. } + { + LaTeX~was~asked~to~define~a~new~color~model~called~'#1',~but~ + this~color~model~already~exists. + } +\__kernel_msg_new:nnnn { color } { separation-alternative-model } + { Separation~color~space~'#1'~require~an~alternative~model. } + { + LaTeX~has~been~asked~to~create~a~separation~color~space,~ + but~no~\\ \\ + \iow_indent:n { alternative-model~=~ } + \\ \\ + key~was~given~with~the~correct~information. + } +\__kernel_msg_new:nnnn { color } { separation-alternative-values } + { Separation~color~space~'#1'~require~values~for~the~alternative~space. } + { + LaTeX~has~been~asked~to~create~a~separation~color~space,~ + but~no~\\ \\ + \iow_indent:n { alternative-values~=~ } + \\ \\ + key~was~given~with~the~correct~information. + } +\__kernel_msg_new:nnnn { color } { separation-requires-name } + { Separation~color~space~'#1'~require~a~formal~name. } + { + LaTeX~has~been~asked~to~create~a~separation~color~space,~ + but~no~\\ \\ + \iow_indent:n { name~=~ } + \\ \\ + key~was~given~with~the~correct~information. + } +\__kernel_msg_new:nnnn { color } { unknown-color } + { Unknown~color~'#1'. } + { + LaTeX~has~been~asked~to~use~a~color~named~'#1',~ + but~this~has~never~been~defined. + } +\__kernel_msg_new:nnnn { color } { unknown-alternative-model } + { Separation~color~space~'#1'~require~an~valid~alternative~space. } + { + LaTeX~has~been~asked~to~create~a~separation~color~space,~ + but~the~model~given~as\\ \\ + \iow_indent:n { alternative-model~=~ } + \\ \\ + is~unknown. + } +\__kernel_msg_new:nnnn { color } { unknown-export-format } + { Unknown~export~format~'#1'. } + { + LaTeX~has~been~asked~to~export~a~color~in~format~'#1',~ + but~this~has~never~been~defined. + } +\__kernel_msg_new:nnnn { color } { unknown-CIELAB-illuminant } + { Unknown~illuminant~model~'#1'. } + { + LaTeX~has~been~asked~to~use~create~a~color~space~using~CIELAB~ + illuminant~'#1',~but~this~does~not~exist. + } +\__kernel_msg_new:nnnn { color } { unknown-model } + { Unknown~color~model~'#1'. } + { + LaTeX~has~been~asked~to~use~a~color~model~called~'#1',~ + but~this~model~is~not~set~up. + } +\__kernel_msg_new:nnnn { color } { unknown-model-type } + { Unknown~color~model~type~'#1'. } + { + LaTeX~has~been~asked~to~create~a~new~color~model~called~'#1',~ + but~this~type~of~model~was~never~set~up. + } +% \end{macrocode} +% +% \begin{macrocode} +\__kernel_msg_new:nnn { color } { show } + { + The~color~#1~ + \tl_if_empty:nTF {#2} + { is~undefined. } + { has~the~properties: #2 } + } +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \end{implementation} +% +% \PrintIndex diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx index 80a2cc426a..107601afe8 100644 --- a/macros/latex/contrib/l3kernel/l3debug.dtx +++ b/macros/latex/contrib/l3kernel/l3debug.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx index 96d386ecfe..e5a70436f6 100644 --- a/macros/latex/contrib/l3kernel/l3deprecation.dtx +++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx index e3fd13dab6..47f57dfb66 100644 --- a/macros/latex/contrib/l3kernel/l3doc.dtx +++ b/macros/latex/contrib/l3kernel/l3doc.dtx @@ -79,7 +79,7 @@ and all files in that bundle must be distributed together. % % \title{The \cls{l3doc} class} % \author{\Team} -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % \maketitle % \tableofcontents % diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx index a1f86a9c19..c0b1db0487 100644 --- a/macros/latex/contrib/l3kernel/l3docstrip.dtx +++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf index 9ad75d5745..887de46717 100644 Binary files a/macros/latex/contrib/l3kernel/l3docstrip.pdf and b/macros/latex/contrib/l3kernel/l3docstrip.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx index 0025d711d8..c4de266f4e 100644 --- a/macros/latex/contrib/l3kernel/l3expan.dtx +++ b/macros/latex/contrib/l3kernel/l3expan.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx index 01693e26dc..76c21c537e 100644 --- a/macros/latex/contrib/l3kernel/l3file.dtx +++ b/macros/latex/contrib/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx index 0e6892fc6d..c55b556453 100644 --- a/macros/latex/contrib/l3kernel/l3flag.dtx +++ b/macros/latex/contrib/l3kernel/l3flag.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx index 4e5c3d6b45..30d9cc9ad5 100644 --- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx index be4dec34c9..451f0952fc 100644 --- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx index 445ea0006d..0742eafffd 100644 --- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx index dbdee9f5b8..ccac4b8a42 100644 --- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx index 38e41cd8fa..09e0a27689 100644 --- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx index 549e9451ab..d3654cf4f5 100644 --- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx index b2060ef461..e6da23c805 100644 --- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx index c8c0ed52dd..ce534ca6c6 100644 --- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx index 5cf52ba78e..cf909120d9 100644 --- a/macros/latex/contrib/l3kernel/l3fp-random.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx index e2f868e939..c67804df2b 100644 --- a/macros/latex/contrib/l3kernel/l3fp-round.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx index 1e0524c092..c9d3d19deb 100644 --- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx index 287efa3d54..55460c8a8f 100644 --- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx index aabdf04924..476e7a8789 100644 --- a/macros/latex/contrib/l3kernel/l3fp.dtx +++ b/macros/latex/contrib/l3kernel/l3fp.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx index 8ed455c2df..9d4ca672ad 100644 --- a/macros/latex/contrib/l3kernel/l3fparray.dtx +++ b/macros/latex/contrib/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx index 9a96fb09eb..85da3a199e 100644 --- a/macros/latex/contrib/l3kernel/l3int.dtx +++ b/macros/latex/contrib/l3kernel/l3int.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx index 97185bab73..dc7b7fdee8 100644 --- a/macros/latex/contrib/l3kernel/l3intarray.dtx +++ b/macros/latex/contrib/l3kernel/l3intarray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx index 31484c0473..f0fd422707 100644 --- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx +++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx index 03e7b5210c..4c2b01526a 100644 --- a/macros/latex/contrib/l3kernel/l3keys.dtx +++ b/macros/latex/contrib/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx index 02b7e3037e..b3c3627c6f 100644 --- a/macros/latex/contrib/l3kernel/l3legacy.dtx +++ b/macros/latex/contrib/l3kernel/l3legacy.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx index d58eeb5010..e4aed9498c 100644 --- a/macros/latex/contrib/l3kernel/l3luatex.dtx +++ b/macros/latex/contrib/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx index 747d087bc9..e51d93a30e 100644 --- a/macros/latex/contrib/l3kernel/l3msg.dtx +++ b/macros/latex/contrib/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -444,6 +444,34 @@ % all (see the discussion of message redirection). % \end{function} % +% \subsection{Messages for showing material} +% +% \begin{function}[added = 2017-12-04] +% { +% \msg_show:nnnnnn , +% \msg_show:nnnnn , +% \msg_show:nnnn , +% \msg_show:nnn , +% \msg_show:nn , +% \msg_show:nnxxxx , +% \msg_show:nnxxx , +% \msg_show:nnxx , +% \msg_show:nnx +% } +% \begin{syntax} +% \cs{msg_show:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four} +% \end{syntax} +% Issues \meta{module} information \meta{message}, passing \meta{arg +% one} to \meta{arg four} to the text-creating functions. The +% information text is shown on the terminal and the \TeX{} run is +% interrupted in a manner similar to \cs{tl_show:n}. This is used in +% conjunction with \cs{msg_show_item:n} and similar functions to print +% complex variable contents completely. If the formatted text does +% not contain |>~| at the start of a line, an additional line |>~.| +% will be put at the end. In addition, a final period is added if not +% present. +% \end{function} +% % \subsection{Expandable error messages} % % In very rare cases it may be necessary to produce errors in an diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx index a456c295d3..bc7d4f1238 100644 --- a/macros/latex/contrib/l3kernel/l3names.dtx +++ b/macros/latex/contrib/l3kernel/l3names.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3news.pdf b/macros/latex/contrib/l3kernel/l3news.pdf index dd8b0b931e..8a9da28149 100644 Binary files a/macros/latex/contrib/l3kernel/l3news.pdf and b/macros/latex/contrib/l3kernel/l3news.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news01.pdf b/macros/latex/contrib/l3kernel/l3news01.pdf index f14be43327..aedb8f2b06 100644 Binary files a/macros/latex/contrib/l3kernel/l3news01.pdf and b/macros/latex/contrib/l3kernel/l3news01.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news02.pdf b/macros/latex/contrib/l3kernel/l3news02.pdf index e60449a772..36d2b99d43 100644 Binary files a/macros/latex/contrib/l3kernel/l3news02.pdf and b/macros/latex/contrib/l3kernel/l3news02.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news03.pdf b/macros/latex/contrib/l3kernel/l3news03.pdf index f4b9bbed9b..ba772dcdc3 100644 Binary files a/macros/latex/contrib/l3kernel/l3news03.pdf and b/macros/latex/contrib/l3kernel/l3news03.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news04.pdf b/macros/latex/contrib/l3kernel/l3news04.pdf index 3370183ddb..3f4fd28f64 100644 Binary files a/macros/latex/contrib/l3kernel/l3news04.pdf and b/macros/latex/contrib/l3kernel/l3news04.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news05.pdf b/macros/latex/contrib/l3kernel/l3news05.pdf index 7ce5287d25..2dd69516d7 100644 Binary files a/macros/latex/contrib/l3kernel/l3news05.pdf and b/macros/latex/contrib/l3kernel/l3news05.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news06.pdf b/macros/latex/contrib/l3kernel/l3news06.pdf index f894701058..d9b6818517 100644 Binary files a/macros/latex/contrib/l3kernel/l3news06.pdf and b/macros/latex/contrib/l3kernel/l3news06.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news07.pdf b/macros/latex/contrib/l3kernel/l3news07.pdf index 4d31b834ce..49696d137c 100644 Binary files a/macros/latex/contrib/l3kernel/l3news07.pdf and b/macros/latex/contrib/l3kernel/l3news07.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news08.pdf b/macros/latex/contrib/l3kernel/l3news08.pdf index 1bd8516026..83680088d1 100644 Binary files a/macros/latex/contrib/l3kernel/l3news08.pdf and b/macros/latex/contrib/l3kernel/l3news08.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news09.pdf b/macros/latex/contrib/l3kernel/l3news09.pdf index 0e9df261fc..8cb98e99b9 100644 Binary files a/macros/latex/contrib/l3kernel/l3news09.pdf and b/macros/latex/contrib/l3kernel/l3news09.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news10.pdf b/macros/latex/contrib/l3kernel/l3news10.pdf index dd97f75d0b..532a383802 100644 Binary files a/macros/latex/contrib/l3kernel/l3news10.pdf and b/macros/latex/contrib/l3kernel/l3news10.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news11.pdf b/macros/latex/contrib/l3kernel/l3news11.pdf index a0e9a272c6..3b74f69402 100644 Binary files a/macros/latex/contrib/l3kernel/l3news11.pdf and b/macros/latex/contrib/l3kernel/l3news11.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3news12.pdf b/macros/latex/contrib/l3kernel/l3news12.pdf index 13621d6f7c..c6701103dc 100644 Binary files a/macros/latex/contrib/l3kernel/l3news12.pdf and b/macros/latex/contrib/l3kernel/l3news12.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3pdf.dtx b/macros/latex/contrib/l3kernel/l3pdf.dtx new file mode 100644 index 0000000000..58f99438ac --- /dev/null +++ b/macros/latex/contrib/l3kernel/l3pdf.dtx @@ -0,0 +1,458 @@ +% \iffalse meta-comment +% +%% File: l3pdf.dtx +% +% Copyright(C) 2019-2021 The LaTeX Project +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% http://www.latex-project.org/lppl.txt +% +% This file is part of the "l3kernel bundle" (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/latex3/latex3 +% +% for those people who are interested. +% +%<*driver> +\documentclass[full]{l3doc} +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +% \title{^^A +% The \pkg{l3pdf} package\\ Core PDF support^^A +% } +% +% \author{^^A +% The \LaTeX{} Project\thanks +% {^^A +% E-mail: +% \href{mailto:latex-team@latex-project.org} +% {latex-team@latex-project.org}^^A +% }^^A +% } +% +% \date{Released 2021-02-18} +% +% \maketitle +% +% \begin{documentation} +% +% \section{\pkg{l3pdf} documentation} +% +% \subsection{Objects} +% +% \begin{function}[added = 2021-02-10]{\pdf_object_new:nn} +% \begin{syntax} +% \cs{pdf_object_new:nn} \Arg{object} \Arg{type} +% \end{syntax} +% Declares \meta{object} as a PDF object of \meta{type}, which should be +% one of +% \begin{itemize} +% \item \texttt{array} +% \item \texttt{dict} +% \item \texttt{fstream} +% \item \texttt{stream} +% \end{itemize} +% The object may be referenced from this point on, and written later +% using \cs{pdf_object_write:nn}. +% \end{function} +% \begin{function}[EXP, pTF, added=2020-05-15]{\pdf_object_if_exist:n} +% \begin{syntax} +% \cs{pdf_object_if_exist_p:n} \Arg{object} +% \cs{pdf_object_if_exist:nTF} \Arg{object} +% \end{syntax} +% Tests whether an object with name \Arg{object} has been defined. +% \end{function} +% \begin{function}[added = 2021-02-10] +% {\pdf_object_write:nn, \pdf_object_write:nx} +% \begin{syntax} +% \cs{pdf_object_write:nn} \Arg{object} \Arg{content} +% \end{syntax} +% Writes the \meta{content} as content of the \meta{object}. Depending on the +% \meta{type} declared for the object, the format required for the +% \meta{data} will vary +% \begin{itemize} +% \item[\texttt{array}] A space-separated list of values +% \item[\texttt{dict}] Key--value pairs in the form +% \texttt{/\meta{key} \meta{value}} +% \item[\texttt{fstream}] Two brace groups: \meta{file name} and +% \meta{file content} +% \item[\texttt{stream}] Two brace groups: \meta{attributes (dictionary)} +% and \meta{stream contents} +% \end{itemize} +% \end{function} +% +% \begin{function}[EXP, added = 2021-02-10]{\pdf_object_ref:n} +% \begin{syntax} +% \cs{pdf_object_ref:n} \Arg{object} +% \end{syntax} +% Inserts the appropriate information to reference the \meta{object} +% in for example page resource allocation +% \end{function} +% +% \begin{function}[added = 2021-02-10] +% {\pdf_object_unnamed_write:nn, \pdf_object_unnamed_write:nx} +% \begin{syntax} +% \cs{pdf_object_unnamed_write:nn} \Arg{type} \Arg{content} +% \end{syntax} +% Writes the \meta{content} as content of an anonymous object. Depending on the +% \meta{type}, the format required for the \meta{data} will vary +% \begin{itemize} +% \item[\texttt{array}] A space-separated list of values +% \item[\texttt{dict}] Key--value pairs in the form +% \texttt{/\meta{key} \meta{value}} +% \item[\texttt{fstream}] Two brace groups: \meta{file name} and +% \meta{file content} +% \item[\texttt{stream}] Two brace groups: \meta{attributes (dictionary)} +% and \meta{stream contents} +% \end{itemize} +% \end{function} +% +% \begin{function}[EXP, added = 2021-02-10]{\pdf_object_ref_last:} +% \begin{syntax} +% \cs{pdf_object_ref_last:} +% \end{syntax} +% Inserts the appropriate information to reference the last \meta{object} +% created. This is particularly useful for anonymous objects. +% \end{function} +% +% \begin{function}[EXP, added = 2021-02-10]{\pdf_pageobject_ref:n} +% \begin{syntax} +% \cs{pdf_pagobject_ref:n} \Arg{pageobject} +% \end{syntax} +% Inserts the appropriate information to reference the \meta{pageobject}. +% \end{function} +% +% \subsection{Version} +% +% \begin{function}[pTF, EXP, added = 2021-02-10]{\pdf_version_compare:Nn} +% \begin{syntax} +% \cs{pdf_version_compare:NnTF} \meta{comparator} \Arg{version} \Arg{true code} \Arg{false code} +% \end{syntax} +% Compares the version of the PDF being created with the \meta{version} +% string specified, using the \meta{comparator}. Either the \meta{true code} +% or \meta{false code} will be left in the output stream. +% \end{function} +% +% \begin{function}[added = 2021-02-10] +% {\pdf_version_gset:n, \pdf_version_min_gset:n} +% \begin{syntax} +% \cs{pdf_version_gset:n} \Arg{version} +% \end{syntax} +% Sets the \meta{version} of the PDF being created. The |min| version will +% not alter the output version unless it is currently lower than the +% \meta{version} requested. +% +% This function may only be used up to the point where the PDF file is +% initialised. +% \end{function} +% +% \begin{function}[EXP, added = 2021-02-10] +% {\pdf_version:, \pdf_version_major:, \pdf_version_minor:} +% \begin{syntax} +% \cs{pdf_version:} +% \end{syntax} +% Expands to the currently-active PDF version. +% \end{function} +% +% \subsection{Compression} +% +% \begin{function}[added = 2021-02-10]{\pdf_uncompress:} +% \begin{syntax} +% \cs{pdf_uncompress:} +% \end{syntax} +% Disables any compression of the PDF, where possible. +% +% This function may only be used up to the point where the PDF file is +% initialised. +% \end{function} +% +% \subsection{Destinations} +% +% Destinations are the places a link jumped too. +% Unlike the name may suggest they don't described +% an exact location in the PDF. Instead a destination contains a reference to +% a page along with an instruction how to display this page. +% The normally used \enquote{XYZ \textit{top left zoom}} for example instructs +% the viewer to show the page with the given \textit{zoom} and +% the top left corner at the \textit{top left} coordinates---which then gives +% the impression that there is an anchor at this position. +% +% If an instruction takes a coordinate, it is calculated by the following +% commands relative to the location the command is issued. +% So to get a specific coordinate one has to move the command to the right place. +% +% \begin{function}[added = 2021-01-03] +% {\pdf_destination:nn} +% \begin{syntax} +% \cs{pdf_destination:nn} \Arg{name} \Arg{type or integer} +% \end{syntax} +% This creates a destination. \Arg{type or integer} can be one of |fit|, |fith|, +% |fitv|, |fitb|, |fitbh|, |fitbv|, |fitr|, |xyz| +% or an integer representing a scale factor in percent. +% |fitr| here gives only a lightweight version of |/FitR|: +% The backend code defines |fitr| so that it will with pdf\LaTeX{} and +% Lua\LaTeX{} use the coordinates of the surrounding box, +% with \texttt{dvips} and \texttt{dvipdfmx} it falls back to |fit|. +% For full control use \cs{pdf_destination:nnnn}. +% +% The keywords match to the PDF names as described in the following tabular. +% +% \medskip +% \noindent\begin{tabular}{ll>{\raggedright\arraybackslash}p{6cm}} +% \toprule +% Keyword & PDF & Remarks \\ \midrule +% |fit| & |/Fit| +% & Fits the page to the window\\ +% |fith| & |/FitH| \textit{top} +% & Fits the width of the page to the window \\ +% |fitv| & |/FitV| \textit{left} +% & Fits the height of the page to the window \\ +% |fitb| & |/FitB| +% & Fits the page bounding box to the window \\ +% |fitbh|& |/FitBH| \textit{top} +% & Fits the width of the page bounding box to the window. \\ +% |fitbv|& |/FitBV| \textit{left} +% & Fits the height of the page bounding box to the window. \\ +% |fitr| & |/FitR| \textit{left bottom right top} +% & Fits the rectangle specified by the four coordinates to the window +% (see above for the restrictions)\\ +% |xyz| & |/XYZ| \textit{left top} null +% & Sets a coordinate but doesn't change the zoom.\\ +% \Arg{integer} & |/XYZ| \textit{left top zoom} +% & Sets a coordinate and a zoom meaning \Arg{integer}\%. +% \\\bottomrule +% \end{tabular} +% +% \end{function} +% +% \begin{function}[added = 2021-01-17] +% {\pdf_destination:nnnn} +% \begin{syntax} +% \cs{pdf_destination:nnnn} \Arg{name} \Arg{width} \Arg{height} \Arg{depth} +% \end{syntax} +% This creates a destination with |/FitR| type with the given dimensions relative +% to the current location. The destination is in a box of size zero, but it doesn't +% switch to horizontal mode. +% \end{function} +% \end{documentation} +% +% \begin{implementation} +% +% \section{\pkg{l3pdf} implementation} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \begin{macrocode} +%<@@=pdf> +% \end{macrocode} +% +% \begin{variable}{\s_@@_stop} +% Internal scan marks. +% \begin{macrocode} +\scan_new:N \s_@@_stop +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\g_@@_init_bool} +% A flag so we have some chance of avoiding setting things we are not +% allowed to. As we are potentially early in the format, we have to work +% a bit harder than ideal. +% \begin{macrocode} +\bool_new:N \g_@@_init_bool +\bool_lazy_and:nnT + { \str_if_eq_p:Vn \fmtname { LaTeX2e } } + { \tl_if_exist_p:N \@expl@finalise@setup@@@@ } + { + \tl_gput_right:Nn \@expl@finalise@setup@@@@ + { + \tl_gput_right:Nn \@kernel@after@begindocument + { \bool_gset_true:N \g_@@_init_bool } + } + } +% \end{macrocode} +% \end{variable} +% +% \subsection{Compression} +% +% \begin{macro}{\pdf_uncompress:} +% Simple to do. +% \begin{macrocode} +\cs_new_protected:Npn \pdf_uncompress: + { + \bool_if:NF \g_@@_init_bool + { + \@@_backend_compresslevel:n { 0 } + \@@_backend_compress_objects:n { \c_false_bool } + } + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Objects} +% +% \begin{macro}{\pdf_object_new:nn, \pdf_object_write:nn, \pdf_object_write:nx} +% \begin{macro}[pTF]{\pdf_object_if_exist:n} +% \begin{macro}{\pdf_object_ref:n} +% \begin{macro}{\pdf_object_unnamed_write:nn, \pdf_object_unnamed_write:nx} +% \begin{macro}{\pdf_object_ref_last:} +% Simple to do. +% \begin{macrocode} +\cs_new_protected:Npn \pdf_object_new:nn #1#2 + { \@@_backend_object_new:nn {#1} {#2} } +\prg_new_conditional:Npnn \pdf_object_if_exist:n #1 { p , T , F , TF } + { + \int_if_exist:cTF { c_@@_backend_object_ \tl_to_str:n {#1} _int } + { \prg_return_true: } + { \prg_return_false:} + } +\cs_new_protected:Npn \pdf_object_write:nn #1#2 + { + \@@_backend_object_write:nn {#1} {#2} + \bool_gset_true:N \g_@@_init_bool + } +\cs_generate_variant:Nn \pdf_object_write:nn { nx } +\cs_new:Npn \pdf_object_ref:n #1 { \@@_backend_object_ref:n {#1} } +\cs_new_protected:Npn \pdf_object_unnamed_write:nn #1#2 + { + \@@_backend_object_now:nn {#1} {#2} + \bool_gset_true:N \g_@@_init_bool + } +\cs_generate_variant:Nn \pdf_object_unnamed_write:nn { nx } +\cs_new:Npn \pdf_object_ref_last: { \@@_backend_object_last: } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\pdf_pageobject_ref:n} +% \begin{macrocode} +\cs_new:Npn \pdf_pageobject_ref:n #1 + { \@@_backend_pageobject_ref:n {#1} } +% \end{macrocode} +% \end{macro} +% +% \subsection{Version} +% +% \begin{macro}{\pdf_version_compare:Nn} +% \begin{macro} +% { +% @@_version_compare_=:w , +% @@_version_compare_<:w , +% @@_version_compare_>:w +% } +% To compare version, we need to split the given value then deal with both +% major and minor version +% \begin{macrocode} +\prg_new_conditional:Npnn \pdf_version_compare:Nn #1#2 { p , T , F , TF } + { \use:c { @@_version_compare_ #1 :w } #2 . . \s_@@_stop } +\cs_new:cpn { @@_version_compare_=:w } #1 . #2 . #3 \s_@@_stop + { + \bool_lazy_and:nnTF + { \int_compare_p:nNn \@@_backend_version_major: = {#1} } + { \int_compare_p:nNn \@@_backend_version_minor: = {#2} } + { \prg_return_true: } + { \prg_return_false: } + } +\cs_new:cpn { @@_version_compare_<:w } #1 . #2 . #3 \s_@@_stop + { + \bool_lazy_or:nnTF + { \int_compare_p:nNn \@@_backend_version_major: < {#1} } + { + \bool_lazy_and_p:nn + { \int_compare_p:nNn \@@_backend_version_major: = {#1} } + { \int_compare_p:nNn \@@_backend_version_minor: < {#2} } + } + { \prg_return_true: } + { \prg_return_false: } + } +\cs_new:cpn { @@_version_compare_>:w } #1 . #2 . #3 \s_@@_stop + { + \bool_lazy_or:nnTF + { \int_compare_p:nNn \@@_backend_version_major: > {#1} } + { + \bool_lazy_and_p:nn + { \int_compare_p:nNn \@@_backend_version_major: = {#1} } + { \int_compare_p:nNn \@@_backend_version_minor: > {#2} } + } + { \prg_return_true: } + { \prg_return_false: } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\pdf_version_gset:n, \pdf_version_min_gset:n} +% \begin{macro}{\@@_version_gset:w} +% Split the version and set. +% \begin{macrocode} +\cs_new_protected:Npn \pdf_version_gset:n #1 + { \@@_version_gset:w #1 . . \s_@@_stop } +\cs_new_protected:Npn \pdf_version_min_gset:n #1 + { + \pdf_version_compare:NnT < {#1} + { \@@_version_gset:w #1 . . \s_@@_stop } + } +\cs_new_protected:Npn \@@_version_gset:w #1 . #2 . #3\s_@@_stop + { + \bool_if:NF \g_@@_init_bool + { + \@@_backend_version_major_gset:n {#1} + \@@_backend_version_minor_gset:n {#2} + } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\pdf_version:, \pdf_version_major:, \pdf_version_minor:} +% Wrappers. +% \begin{macrocode} +\cs_new:Npn \pdf_version: + { \@@_backend_version_major: . \@@_backend_version_minor: } +\cs_new:Npn \pdf_version_major: { \@@_backend_version_major: } +\cs_new:Npn \pdf_version_minor: { \@@_backend_version_minor: } +% \end{macrocode} +% \end{macro} +% +% \subsection{Destinations} +% +% \begin{macro}{\pdf_destination:nn} +% \begin{macrocode} +\cs_new_protected:Npn \pdf_destination:nn #1#2 + { \@@_backend_destination:nn {#1} {#2} } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pdf_destination:nnnn} +% \begin{macrocode} +\cs_new_protected:Npn \pdf_destination:nnnn #1#2#3#4 + { + \hbox_to_zero:n + { \@@_backend_destination:nnnn {#1} {#2} {#3} {#4} } + } +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% +% \end{macrocode} +% +% \end{implementation} +% +% \PrintIndex diff --git a/macros/latex/contrib/l3kernel/l3prefixes.csv b/macros/latex/contrib/l3kernel/l3prefixes.csv index 4259c37c30..321f9c1799 100644 --- a/macros/latex/contrib/l3kernel/l3prefixes.csv +++ b/macros/latex/contrib/l3kernel/l3prefixes.csv @@ -4,6 +4,7 @@ GS,gs1,Markus Kohm,,,,2013-03-16,2013-03-16, MOdiagram,modiagram,Clemens Niederberger,https://bitbucket.org/cgnieder/modiagram/,git@bitbucket.org:cgnieder/modiagram.git,https://bitbucket.org/cgnieder/modiagram/issues,2013-03-16,2013-03-16, UFca,citeall,Ulrike Fischer,,,,2015-04-09,2016-02-26, acro,acro,Clemens Niederberger,https://github.com/cgnieder/acro/,https://github.com/cgnieder/acro.git,https://github.com/cgnieder/acro/issues,2013-03-16,2020-04-14, +affiliations,langsci-affiliations,Felix Kopecky,https://ctan.org/pkg/langsci-affiliations,https://github.com/langsci/langsci-affiliations,https://github.com/langsci/langsci-affiliations/issues,2021-02-18,2021-02-18, akshar,akshar,Vu Van Dung,https://github.com/joulev/akshar,https://github.com/joulev/akshar.git,https://github.com/joulev/akshar/issues,2020-05-27,2020-05-27, algobox,algobox,Julien Rivaud,,,,2018-06-13,2018-06-13, alignment,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2018-05-12,2018-05-12, diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf index ebb1745f91..b9bea84aa7 100644 Binary files a/macros/latex/contrib/l3kernel/l3prefixes.pdf and b/macros/latex/contrib/l3kernel/l3prefixes.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx index a8089df0b4..e75ab65899 100644 --- a/macros/latex/contrib/l3kernel/l3prg.dtx +++ b/macros/latex/contrib/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx index fe8ffaf588..d8c7410aaa 100644 --- a/macros/latex/contrib/l3kernel/l3prop.dtx +++ b/macros/latex/contrib/l3kernel/l3prop.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx index 3b7d7ea1c2..8177a2a589 100644 --- a/macros/latex/contrib/l3kernel/l3quark.dtx +++ b/macros/latex/contrib/l3kernel/l3quark.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx index c26c8c0dd0..ef7ab6becc 100644 --- a/macros/latex/contrib/l3kernel/l3regex.dtx +++ b/macros/latex/contrib/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -7033,6 +7033,13 @@ } % \end{macrocode} % +% Some escaped alphanumerics are not allowed everywhere. +% \begin{macrocode} +\__kernel_msg_new:nnnn { kernel } { backwards-quantifier } + { Quantifer~"{#1,#2}"~is~backwards. } + { The~values~given~in~a~quantifier~must~be~in~order. } +% \end{macrocode} +% % Used when showing a regex. % \begin{macrocode} \__kernel_msg_new:nnn { kernel } { show-regex } diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx index 134f3c57dc..046f42b8c5 100644 --- a/macros/latex/contrib/l3kernel/l3seq.dtx +++ b/macros/latex/contrib/l3kernel/l3seq.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx index fe5be582f5..97eaef163d 100644 --- a/macros/latex/contrib/l3kernel/l3skip.dtx +++ b/macros/latex/contrib/l3kernel/l3skip.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx index b55b2223da..13b94daf67 100644 --- a/macros/latex/contrib/l3kernel/l3sort.dtx +++ b/macros/latex/contrib/l3kernel/l3sort.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx index 9ea4c90166..4cc29c2d21 100644 --- a/macros/latex/contrib/l3kernel/l3str-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -106,6 +106,8 @@ % \midrule % \texttt{clist} & comma-list of integers \\ % \meta{empty} & native (Unicode) string \\ +% \texttt{default} & like \texttt{utf8} with 8-bit engines, +% and like native with unicode-engines \\ % \bottomrule % \end{tabular} % \end{table} @@ -317,6 +319,17 @@ \prop_gput:Nnn \g_@@_alias_prop { utf32le } { utf32 } \prop_gput:Nnn \g_@@_alias_prop { utf32be } { utf32 } \prop_gput:Nnn \g_@@_alias_prop { hexadecimal } { hex } +\bool_lazy_any:nTF + { + \sys_if_engine_luatex_p: + \sys_if_engine_xetex_p: + } + { + \prop_gput:Nnn \g_@@_alias_prop { default } { } + } + { + \prop_gput:Nnn \g_@@_alias_prop { default } { utf8 } + } % \end{macrocode} % \end{variable} % diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx index 00c26f5f45..2a0b175bfe 100644 --- a/macros/latex/contrib/l3kernel/l3str.dtx +++ b/macros/latex/contrib/l3kernel/l3str.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf index 484275928c..0ad0ba30d6 100644 Binary files a/macros/latex/contrib/l3kernel/l3styleguide.pdf and b/macros/latex/contrib/l3kernel/l3styleguide.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex index 645fe07fd9..c9a61be054 100644 --- a/macros/latex/contrib/l3kernel/l3styleguide.tex +++ b/macros/latex/contrib/l3kernel/l3styleguide.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-02-06} +\date{Released 2021-02-18} \begin{document} diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf index 0a29f62dc5..f119e34fdb 100644 Binary files a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf and b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex index 670bbd3e13..75bdfb87d2 100644 --- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex +++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-02-06} +\date{Released 2021-02-18} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx index 8761c5f4e7..9bcbee56a6 100644 --- a/macros/latex/contrib/l3kernel/l3sys.dtx +++ b/macros/latex/contrib/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf index 26c76842fd..7aa607d2bb 100644 Binary files a/macros/latex/contrib/l3kernel/l3term-glossary.pdf and b/macros/latex/contrib/l3kernel/l3term-glossary.pdf differ diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex index 97580c6b7c..23b05b09fd 100644 --- a/macros/latex/contrib/l3kernel/l3term-glossary.tex +++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2021-02-06} +\date{Released 2021-02-18} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3text-case.dtx b/macros/latex/contrib/l3kernel/l3text-case.dtx index 8ebc6e3ccb..19f6e85035 100644 --- a/macros/latex/contrib/l3kernel/l3text-case.dtx +++ b/macros/latex/contrib/l3kernel/l3text-case.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text-purify.dtx b/macros/latex/contrib/l3kernel/l3text-purify.dtx index 2495a89db0..f939085021 100644 --- a/macros/latex/contrib/l3kernel/l3text-purify.dtx +++ b/macros/latex/contrib/l3kernel/l3text-purify.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx index 2634fd0a4c..046bf68677 100644 --- a/macros/latex/contrib/l3kernel/l3text.dtx +++ b/macros/latex/contrib/l3kernel/l3text.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % @@ -107,6 +107,7 @@ % function name. The category code of letters are not changed by this % process (at least where they can be represented by the engine as a single % token: $8$-bit engines may require active characters). +% \end{function} % % Upper- and lowercase have the obvious meanings. Titlecasing may be regarded % informally as converting the first character of the \meta{tokens} to @@ -194,7 +195,6 @@ % \cs{l_text_titlecase_check_letter_bool} is \texttt{false}, the first % character is uppercased, and the rest lowercased, irrespective of the nature % of the character. -% \end{function} % % \subsection{Removing formatting from text} % diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx index 8bc8bb8652..51ad05c995 100644 --- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx +++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx index 5e11227e3c..c7038b08d1 100644 --- a/macros/latex/contrib/l3kernel/l3tl.dtx +++ b/macros/latex/contrib/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx index a0027a698b..31d4d7fcde 100644 --- a/macros/latex/contrib/l3kernel/l3token.dtx +++ b/macros/latex/contrib/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx index 8d4c2092ae..a52823c1a2 100644 --- a/macros/latex/contrib/l3kernel/l3unicode.dtx +++ b/macros/latex/contrib/l3kernel/l3unicode.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2021-02-06} +% \date{Released 2021-02-18} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf index 2c5c8920da..8cfe3b177f 100644 Binary files a/macros/latex/contrib/l3kernel/source3.pdf and b/macros/latex/contrib/l3kernel/source3.pdf differ diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex index 60ca616620..e3134302c7 100644 --- a/macros/latex/contrib/l3kernel/source3.tex +++ b/macros/latex/contrib/l3kernel/source3.tex @@ -53,7 +53,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2021-02-06} +\date{Released 2021-02-18} \pagenumbering{roman} \maketitle diff --git a/macros/latex/contrib/l3kernel/source3body.tex b/macros/latex/contrib/l3kernel/source3body.tex index 2f36e993ee..588dba1008 100644 --- a/macros/latex/contrib/l3kernel/source3body.tex +++ b/macros/latex/contrib/l3kernel/source3body.tex @@ -55,33 +55,14 @@ these conventions. However, in the main direct use of the primitives is not required or encouraged: the \pkg{expl3} modules define an independent low-level \LaTeX3 programming language. -At present, the \pkg{expl3} modules are designed to be loaded on top of -\LaTeXe{}. In time, a \LaTeX3 format will be produced based on this code. -This allows the code to be used in \LaTeXe{} packages \emph{now} while a -stand-alone \LaTeX3 is developed. - -\begin{bfseries} - While \pkg{expl3} is still experimental, the bundle is now regarded as - broadly stable. The syntax conventions and functions provided are now - ready for wider use. There may still be changes to some functions, but - these will be minor when compared to the scope of \pkg{expl3}. - - New modules will be added to the distributed version of \pkg{expl3} as - they reach maturity. -\end{bfseries} +The \pkg{expl3} modules are designed to be loaded on top of +\LaTeXe{}. With an up-to-date \LaTeXe{} kernel, this material is loaded +as part of the format. The fundamental programming code can also be loaded +with other \TeX{} formats, subject to restrictions on the full range of +functionality. \end{abstract} -\clearpage - -{% - \def\\{:}% fix "newlines" in the ToC - \tableofcontents -} - -\clearpage -\pagenumbering{arabic} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Each of the following \DocInput lines includes a file with extension @@ -97,15 +78,98 @@ stand-alone \LaTeX3 is developed. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \makeatletter +% l3doc is based on article, but for these very large documents we need +% chapters; the code is based on the standard classes but somewhat simplified +\renewcommand\part{% + \clearpage + \thispagestyle{plain}% + \@tempswafalse + \null\vfil + \secdef\@part\@spart} +\newcounter {chapter} +\numberwithin{section}{chapter} +\renewcommand \thechapter {\@arabic\c@chapter} +\renewcommand \thesection {\thechapter.\@arabic\c@section} +\newcommand*\chaptermark[1]{} +\setcounter{secnumdepth}{2} +\newcommand\@chapapp{\chaptername} +\newcommand\chaptername{Chapter} + \def\ps@headings{% + \let\@oddfoot\@empty + \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\chaptermark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \@chapapp\ \thechapter. \ % + \fi + ##1}}}} +\newcommand\chapter{\clearpage + \thispagestyle{plain}% + \global\@topnum\z@ + \@afterindentfalse + \secdef\@chapter\@schapter} +\def\@chapter[#1]#2{\refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \@makechapterhead{#2}% + \@afterheading} +\def\@makechapterhead#1{% + \vspace*{50\p@}% + {\parindent \z@ \raggedright \normalfont + \huge\bfseries \@chapapp\space \thechapter + \par\nobreak + \vskip 20\p@ + \interlinepenalty\@M + \Huge \bfseries #1\par\nobreak + \vskip 40\p@ + }} +\newcommand*\l@chapter[2]{% + \ifnum \c@tocdepth >\m@ne + \addpenalty{-\@highpenalty}% + \vskip 1.0em \@plus\p@ + \setlength\@tempdima{1.5em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth + \leavevmode \bfseries + \advance\leftskip\@tempdima + \hskip -\leftskip + #1\nobreak\hfil + \nobreak\hb@xt@\@pnumwidth{\hss #2% + \kern-\p@\kern\p@}\par + \penalty\@highpenalty + \endgroup + \fi} +\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.8em}} +\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}} +\renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}} \def\partname{Part} -\def\maketitle{\clearpage\part{\@title}} +\def\toclevel@part{-1} +\def\maketitle{\chapter{\@title}} \let\thanks\@gobble \let\DelayPrintIndex\PrintIndex \let\PrintIndex\@empty \providecommand*{\hexnum}[1]{\text{\texttt{\char`\"}#1}} \makeatother -\part{Introduction to \pkg{expl3} and this document} +\clearpage + +{% + \def\\{:}% fix "newlines" in the ToC + \tableofcontents +} + +\clearpage +\pagenumbering{arabic} + +\part{Introduction} + +\chapter{Introduction to \pkg{expl3} and this document} This document is intended to act as a comprehensive reference manual for the \pkg{expl3} language. A general guide to the \LaTeX3 @@ -441,27 +505,43 @@ used on top of \LaTeXe{} if \cs{outer} tokens are used in the arguments. \DisableImplementation +\part{Bootstrapping} + \DocInput{l3bootstrap.dtx} \DocInput{l3names.dtx} \ExplSyntaxOn \clist_gput_right:Nn \g_docinput_clist { l3kernel-functions.dtx } \ExplSyntaxOff + +\part{Programming Flow} + \DocInput{l3basics.dtx} \DocInput{l3expan.dtx} -\DocInput{l3quark.dtx} +\DocInput{l3sort.dtx} +\DocInput{l3tl-analysis.dtx} +\DocInput{l3regex.dtx} +\DocInput{l3prg.dtx} +\DocInput{l3sys.dtx} +\DocInput{l3msg.dtx} +\DocInput{l3file.dtx} + +\DocInput{l3luatex.dtx} + +\DocInput{l3legacy.dtx} + + +\part{Data types} + \DocInput{l3tl.dtx} \DocInput{l3str.dtx} \DocInput{l3str-convert.dtx} +\DocInput{l3quark.dtx} \DocInput{l3seq.dtx} \DocInput{l3int.dtx} \DocInput{l3flag.dtx} -\DocInput{l3prg.dtx} -\DocInput{l3sys.dtx} \DocInput{l3clist.dtx} \DocInput{l3token.dtx} \DocInput{l3prop.dtx} -\DocInput{l3msg.dtx} -\DocInput{l3file.dtx} \DocInput{l3skip.dtx} \DocInput{l3keys.dtx} \DocInput{l3intarray.dtx} @@ -489,13 +569,9 @@ used on top of \LaTeXe{} if \cs{outer} tokens are used in the arguments. \DocInput{l3fparray.dtx} \DocInput{l3cctab.dtx} -\DocInput{l3sort.dtx} -\DocInput{l3tl-analysis.dtx} -\DocInput{l3regex.dtx} -\DocInput{l3box.dtx} -\DocInput{l3coffins.dtx} -\DocInput{l3color-base.dtx} -\DocInput{l3luatex.dtx} + +\part{Text manipulation} + \DocInput{l3unicode.dtx} \DocInput{l3text.dtx} \ExplSyntaxOn @@ -505,7 +581,16 @@ used on top of \LaTeXe{} if \cs{outer} tokens are used in the arguments. l3text-purify.dtx } \ExplSyntaxOff -\DocInput{l3legacy.dtx} + +\part{Typesetting} + +\DocInput{l3box.dtx} +\DocInput{l3coffins.dtx} +\DocInput{l3color.dtx} +\DocInput{l3pdf.dtx} + +\part{Additions and removals} + \DocInput{l3candidates.dtx} \ExplSyntaxOn diff --git a/macros/latex/contrib/luacolor/luacolor.dtx b/macros/latex/contrib/luacolor/luacolor.dtx index 68c92f056a..8f072db0f1 100644 --- a/macros/latex/contrib/luacolor/luacolor.dtx +++ b/macros/latex/contrib/luacolor/luacolor.dtx @@ -1,12 +1,12 @@ % \iffalse meta-comment % % File: luacolor.dtx -% Version: 2020-02-24 v1.15 +% Version: 2021-02-17 v1.17 % Info: Color support via LuaTeX's attributes % % Copyright (C) % 2007, 2009-2011 Heiko Oberdiek -% 2016-2020 Oberdiek Package Support Group +% 2016-2021 Oberdiek Package Support Group % https://github.com/ho-tex/luacolor/issues % % This work may be distributed and/or modified under the @@ -80,7 +80,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luacolor 2020-02-24 v1.15 Color support via LuaTeX's attributes (HO)} +\Msg{* Package: luacolor 2021-02-17 v1.17 Color support via LuaTeX's attributes (HO)} \Msg{************************************************************************} \keepsilent @@ -92,11 +92,11 @@ This is a generated file. Project: luacolor -Version: 2020-02-24 v1.15 +Version: 2021-02-17 v1.17 Copyright (C) 2007, 2009-2011 Heiko Oberdiek - 2016-2020 Oberdiek Package Support Group + 2016-2021 Oberdiek Package Support Group This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -169,7 +169,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luacolor.drv}% - [2020-02-24 v1.15 Color support via LuaTeX's attributes (HO)]% + [2021-02-17 v1.17 Color support via LuaTeX's attributes (HO)]% \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/11/22] \usepackage{paralist} @@ -189,7 +189,7 @@ and the derived files % \GetFileInfo{luacolor.drv} % % \title{The \xpackage{luacolor} package} -% \date{2020-02-24 v1.15} +% \date{2021-02-17 v1.17} % \author{Heiko Oberdiek\thanks % {Please report any issues at \url{https://github.com/ho-tex/luacolor/issues}}} % @@ -332,7 +332,7 @@ and the derived files % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luacolor}% - [2020-02-24 v1.15 Color support via LuaTeX's attributes (HO)] + [2021-02-17 v1.17 Color support via LuaTeX's attributes (HO)] % \end{macrocode} % % \subsection{Check for \LuaTeX} @@ -376,7 +376,7 @@ and the derived files % \end{macrocode} % \begin{macrocode} \begingroup - \edef\x{\directlua{tex.write("2020-02-24 v1.15")}}% + \edef\x{\directlua{tex.write("2021-02-17 v1.17")}}% \edef\y{% \directlua{% if oberdiek.luacolor.getversion then % @@ -471,9 +471,15 @@ and the derived files % \end{macro} % % \begin{macrocode} -\RequirePackage{atbegshi}[2011/01/30] -\AtBeginShipout{% - \luacolorProcessBox\AtBeginShipoutBox +\directlua{% + if luatexbase.callbacktypes.pre_shipout_filter then + token.get_next() + end +}\@secondoftwo\@gobble{ + \RequirePackage{atbegshi}[2011/01/30] + \AtBeginShipout{% + \luacolorProcessBox\AtBeginShipoutBox + } } % \end{macrocode} % @@ -608,7 +614,7 @@ oberdiek.luacolor = luacolor % \begin{macro}{getversion()} % \begin{macrocode} function luacolor.getversion() - tex.write("2020-02-24 v1.15") + tex.write("2021-02-17 v1.17") end % \end{macrocode} % \end{macro} @@ -727,6 +733,7 @@ local LIST = 1 local LIST_LEADERS = 2 local LIST_DISC = 3 local COLOR = 4 +local NOCOLOR = 5 local RULE = node.id("rule") local node_types = { [node.id("hlist")] = LIST, @@ -735,6 +742,10 @@ local node_types = { [node.id("glyph")] = COLOR, [node.id("disc")] = LIST_DISC, [node.id("whatsit")] = { + [node.subtype("pdf_colorstack")] = + function(n) + return n.stack == 0 and NOCOLOR or nil + end, [node.subtype("special")] = COLOR, [node.subtype("pdf_literal")] = COLOR, [node.subtype("pdf_save")] = COLOR, @@ -829,6 +840,8 @@ local function traverse(list, color, dry) end end end + elseif t == NOCOLOR then + color = '' end end if get_type(list) == LIST then @@ -848,6 +861,13 @@ function luacolor.process(box) local list = tex.getbox(box) traverse(list, color, DRY_FALSE) end + +if luatexbase.callbacktypes.pre_shipout_filter then + luatexbase.add_to_callback("pre_shipout_filter", function(list) + traverse(list, "", DRY_FALSE) + return true + end, "luacolor.process") +end % \end{macrocode} % \end{macro} % For recent versions of luaotfload, we can register a callback to @@ -1129,6 +1149,13 @@ end % \begin{Version}{2020-02-24 v1.15} % \item Grab all possible arguments for \verb|\saveboxresource|\slash \verb|\pdfxform| % \end{Version} +% \begin{Version}{2020-04-04 v1.16} +% \item Reset color after \verb|pdf_colorstack| whatsits. +% \end{Version} +% \begin{Version}{2021-02-17 v1.17} +% \item Use \LaTeXe's new \verb|pre_shipout_filter| callback if it's available to +% allow coloring background and foregrund layer material +% \end{Version} % \end{History} % % \PrintIndex diff --git a/macros/latex/contrib/luacolor/luacolor.pdf b/macros/latex/contrib/luacolor/luacolor.pdf index b01a36cc92..3f6acfa53a 100644 Binary files a/macros/latex/contrib/luacolor/luacolor.pdf and b/macros/latex/contrib/luacolor/luacolor.pdf differ diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt index eccf4ac6a9..f77e4ae669 100644 --- a/macros/latex/contrib/lwarp/README.txt +++ b/macros/latex/contrib/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.894 README.txt +LaTeX lwarp package v0.895 README.txt Files included are: @@ -41,7 +41,7 @@ and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. -Copyright 2016-2020 Brian Dunn +Copyright 2016-2021 Brian Dunn Homepage: http://BDTechConcepts.com Email: bd@BDTechConcepts.com diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx index 397c835190..51892df0c1 100644 --- a/macros/latex/contrib/lwarp/lwarp.dtx +++ b/macros/latex/contrib/lwarp/lwarp.dtx @@ -1,7 +1,7 @@ % % \iffalse meta-comment % -% Copyright 2016-2020 Brian Dunn +% Copyright 2016-2021 Brian Dunn % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2020/12/24 v0.894 Allows LaTeX to directly produce HTML5 output.] +% [2021/02/18 v0.895 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -25,7 +25,7 @@ \usepackage{lmodern} \usepackage{libertine} -\usepackage[space]{erewhon} +% *88* \usepackage[space]{erewhon} \usepackage[varqu,varl]{inconsolata} % typewriter % \usepackage{roboto}% conflicts with \textsc inside a float % \usepackage{sourcecodepro} @@ -85,7 +85,8 @@ \newunicodechar{฿}{\textbaht} \newunicodechar{℠}{\textservicemark} -\usepackage[log-declarations=false]{xparse} +% \usepackage[log-declarations=false]{xparse} +\usepackage{xparse} \usepackage{ifptex}% *8* remove later @@ -1315,7 +1316,7 @@ Limitations when using \brand{MathJax} include: \item Math appearing inside a lateximage, \margintag{lateximage} and therefore also inside a \tikz\ or \env{picture} - environment, is rendered as SVG math even if \brand{MathJax} + environment, is rendered as \SVG\ math even if \brand{MathJax} is used in the rest of the document. \item For \pkg{siunitx}, @@ -1375,7 +1376,7 @@ package. \DescribeMacro{\inlinemathnormal} \DescribeMacro{\inlinemathother} An inline math expression is usually converted to a reusable hashed \SVG\ math -image, or a MathJax expression. The hash or expression depends on the contents +image, or a \brand{MathJax} expression. The hash or expression depends on the contents of the math expression. In most cases this math expression is static, such as \texttt{\$x+1\$}, so the image can be reused for multiples instances of the same expression. In some cases, @@ -1390,7 +1391,7 @@ Yet another problem is math packages which are only partially emulated in \brand{MathJax}. The macro \cs{inlinemathother} may be used before a sequence of dynamic or complicated math expressions, and \cs{inlinemathnormal} after. Doing so tells \pkg{lwarp} to -use unhashed \SVG\ math images for those particular expressins, even if MathJax +use unhashed \SVG\ math images for those particular expressins, even if \brand{MathJax} is otherwise in use. See \cref{sec:localizingdynamicmath}. } @@ -1410,7 +1411,7 @@ When selecting \cs{displaymathother}, it is assumed that the contents are more complicated than ``pure'' math. An example is an elaborate \tikz\ picture, -\margintag{MathJax unsupported} +\margintag{\brand{MathJax} unsupported} which will not render in \brand{MathJax} and will not make sense as an \HTML\ \attribute{alt} tag. \margintag{complicated \attribute{alt} tag} @@ -1715,7 +1716,7 @@ the extension will be changed to \filenm{.svg} for \HTML: \end{sourcedisplay} \DescribeProgram{pdftocairo} -\margintag{PDF to SVG} +\margintag{\PDF\ to \SVG} To convert a \PDF\ image to \SVG, use the utility \prog{pdftocairo}: \userentry{pdftocairo -svg filename.pdf} For a large number of images, use \prog{lwarpmk}: @@ -1729,14 +1730,14 @@ For \EPS\ images converted to \PDF\ using the package \pkg{epstopdf}, use \userentry{lwarpmk pdftosvg *.PDF} to convert to \SVG\ images. When using \DVI\ \prog{latex}, -\margintag{DVI latex} +\margintag{\DVI\ \LaTeX} it is necessary to convert \EPS\ to \PDF\ and then to \SVG: \gindex{image>PDF or EPS>converting} \userentry{lwarpmk epstopdf *.eps\qquad \textrm{(or a list of filenames)}} \userentry{lwarpmk pdftosvg *.pdf\qquad \textrm{(or a list of filenames)}} For \PNG\ or \JPG -\margintag{PNG and JPG} +\margintag{\PNG\ and \JPG} \gindex{image>PNG and JPG} \gindex{PNG images} \gindex{JPG images} @@ -1745,8 +1746,8 @@ the same file may be used in both print or \HTML\ versions, and may be used with but will also be used without the file extension if it is the only file of its base name. -GIF files may be used for \HTML, -\margintag{GIF} +\GIF\ files may be used for \HTML, +\margintag{\GIF} \gindex{image>GIF} \gindex{GIF images} but another format must also be provided for print output. @@ -2820,18 +2821,17 @@ For math expressions while using \brand{MathJax}, \trouble[MathJax]{mathjax=\brand{MathJax}>siunitx=\pkg{siunitx}} a limited emulation is used. Most functions work reasonably well, but many options cannot be emulated. -\pkg{siunitx} macros with more than one optional value cannot absorb the second optional -value, and complicated parsing such as for \cs{ang} is not supported. +Complicated parsing such as for \cs{ang} is not supported. The result usually looks fine, and otherwise is enough to get the meaning across. -\pkg{lwarp}'s \brand{MathJax} emulation for \pkg{siunitx} is meant to be a -stop-gap measure until an extension is included in \brand{MathJax}. -As of this writing, the third-party \pkg{siunitx} extension -for \brand{MathJax} is not currently hosted at any public CDN, -thus \pkg{siunitx} is not usable with this extension unless a local copy -of this extension is created first. -See \cs{MathJaxFilename} to select a custom MathJax script, but \pkg{lwarp}'s -emulation would have to be diabled as well. +% \pkg{lwarp}'s \brand{MathJax} emulation for \pkg{siunitx} is meant to be a +% stop-gap measure until an extension is included in \brand{MathJax}. +% As of this writing, the third-party \pkg{siunitx} extension +% for \brand{MathJax} is not currently hosted at any public CDN, +% thus \pkg{siunitx} is not usable with this extension unless a local copy +% of this extension is created first. +% See \cs{MathJaxFilename} to select a custom \brand{MathJax} script, but \pkg{lwarp}'s +% emulation would have to be diabled as well. Document modifications required for \brand{MathJax}: \begin{itemize} @@ -2911,12 +2911,12 @@ changes do not affect the \HTML\ output. } \newcommand{\limitspolyglossia}{% -\trouble{Undefined control sequence>polyglossia=\pkg{polyglossia}} -\trouble{polyglossia=\pkg{polyglossia}>Undefined control sequence} +\trouble{Undefined control sequence \dots begindocument>polyglossia=\pkg{polyglossia}} +\trouble{polyglossia=\pkg{polyglossia}>Undefined control sequence \dots begindocument} \pkg{lwarp} uses \pkg{cleveref}, which has some limitations when using \pkg{polyglossia}, possibly resulting in the error \begin{sourcedisplay} -!~Undefined control sequence. \dots\ \cs{@begindocumenthook} +!~Undefined control sequence. \dots\ \cs{\_\_hook} begindocument \end{sourcedisplay} To test compatibility, add @@ -2973,14 +2973,6 @@ The defaults are as follows, and may be changed in the preamble after \bigskip } -\newcommand{\limitsxparse}{% -\trouble{xparse=\pkg{xparse}} -To remove from the log any warnings about redeclaring objects, -place the following before \pkg{lwarp} is loaded: -\begin{sourcedisplay} -\cs{usepackage}[log-declarations=false]\{xparse\} -\end{sourcedisplay} -} % For use in the documentation update section: @@ -3061,7 +3053,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{51622} +% \CheckSum{53146} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -3197,6 +3189,7 @@ This boolean may be tested by the user for later use. % \changes{v0.892}{2020/10/07}{\ 2020/10/07} % \changes{v0.893}{2020/11/26}{\ 2020/11/26} % \changes{v0.894}{2020/12/24}{\ 2020/12/24} +% \changes{v0.895}{2021/02/18}{\ 2021/02/18} @@ -3220,7 +3213,7 @@ This boolean may be tested by the user for later use. % % \fileversion{} \Dash \filedate % -% {\small\textcopyright{} 2016--2020} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} +% {\small\textcopyright{} 2016--2021} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} % % \end{center} % @@ -3420,6 +3413,32 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.895:] Vector packages, greatly improved \brand{MathJax} for \pkg{siunitx}. +% \begin{itemize} +% \item Fixed quotes in \HTML\ tags while using old font packages with +% \margintag{core} +% \XeLaTeX\ and \LuaLaTeX. +% \item Added \cs{ifblank} and \cs{ifstrequal} to \brand{MathJax} emulation. +% \margintag{\brand{MathJax}} +% \item \pkg{multirow}: Allow \cs{par} per v2.7. +% \margintag{packages} +% \item \pkg{acro}: Updated to v3.5. +% \item \pkg{fancyhdr}: Updated to v4.0. +% \item \pkg{changes}: Updated to v4.0.1. +% \item \pkg{epsfig}, \pkg{rotating}: Now work inside \env{lateximage}. +% \item \pkg{amscdx}: Verified to work with \SVG\ math. +% Warning added about use with \brand{MathJax}. +% \item Added \brand{MathJax} emulation for \pkg{isomath}, \pkg{mattens}, +% \pkg{maybemath}, \pkg{skmath}, \pkg{tensor}. +% \item Improved \brand{MathJax} emulation for \pkg{siunitx} \cs{ang}, +% \cs{num}, \cs{SI}. +% \item Added \pkg{epsf}, \pkg{impnattypo}, \pkg{isotope}, +% \pkg{lpic}, \pkg{luavlna}, +% \pkg{mdwmath}, \pkg{pinlabel}, \pkg{rlepsf}, +% \pkg{tikz-imagelabels}, \pkg{xevlna}. +% \item Verified to work as-is: \pkg{tensind}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.894:] \brand{MathJax} additions and improvements. % \begin{itemize} % \item Improved warning message for enabling \SVG\ graphics for @@ -4179,7 +4198,7 @@ This boolean may be tested by the user for later use. % \item \pkg{xfrac}: Improved \CSS. % \item \pkg{textcomp} and \pkg{xunicode}: Fix conflicts with \cs{textcircled}. % \item \pkg{ulem}: Improved compatibility with \pkg{CJKulem}, \env{lateximage}. -% \item MathJax and \pkg{siunitx}: Removed inoperable extension. +% \item \brand{MathJax} and \pkg{siunitx}: Removed inoperable extension. % \item Added \pkg{bitpattern}, \pkg{pdfcomment}, % \pkg{pdfmarginpar}, \pkg{tram}, \pkg{unitsdef}, \pkg{xechangebar}. % \item Added \pkg{musicography}, \pkg{octave}, \pkg{semantic-markup}. @@ -4261,10 +4280,10 @@ This boolean may be tested by the user for later use. % \margintag{\DVI\ \prog{latex}} % \item Fix for \optn{-\/-shell-escape} with \prog{latexmk}. % \margintag{\prog{latexmk}} -% \item Updated MathJax script to v2.7.4. +% \item Updated \brand{MathJax} script to v2.7.4. % \margintag{math} -% \item Fix: Mathjax chapter number removed from non-numeric tagged equations. -% \item Added MathJax support for \pkg{nicefrac}, \pkg{units}. +% \item Fix: \brand{Mathjax} chapter number removed from non-numeric tagged equations. +% \item Added \brand{MathJax} support for \pkg{nicefrac}, \pkg{units}. % \item Fix for \cs{[} and \cs{]} with \cs{displaymathnormal}. % \item Fix for \cs{includegraphics} filename expansion. % \margintag{images} @@ -4329,7 +4348,7 @@ This boolean may be tested by the user for later use. % \needspace{2\baselineskip} % \item[v0.57:] \pkg{algorithm2e}, \pkg{float} styles, tabular packages, internal improvements. % \begin{itemize} -% \item Added support for MathJax equations with \cs{footnote}, \cs{footnotemark}. +% \item Added support for \brand{MathJax} equations with \cs{footnote}, \cs{footnotemark}. % \margintag{MathJax} % \item Added \cs{StartDefiningMath} and \cs{StopDefiningMath} for % \margintag{math macros} @@ -4339,7 +4358,7 @@ This boolean may be tested by the user for later use. % \margintag{dynamic math} % delimit math expressions which depend on a variable condition % such as a counter. Such expressions will not be hashed for reuse, -% and will be converted to \SVG\ math images even when MathJax is enabled. +% and will be converted to \SVG\ math images even when \brand{MathJax} is enabled. % See \cref{sec:mathdynamic}. % \item Renamed \cs{EndDefiningTabulars} to \cs{StopDefiningTabulars}. % \watchout[new name] @@ -4506,7 +4525,7 @@ This boolean may be tested by the user for later use. % \item Improved \cs{ensuremath} hashing expansion. % \item Fix: \env{equation*} with \env{split}. % \item \env{tabbing} now works inside a \env{lateximage}. Use for math in \env{tabbing}. -% \item Fix: MathJax script was not executing in some conditions. +% \item Fix: \brand{MathJax} script was not executing in some conditions. % \margintag{MathJax} % \item Added \cs{CustomizeMathJax} to add custom functions. % See \cref{sec:limitsmath}. @@ -4540,8 +4559,8 @@ This boolean may be tested by the user for later use. % \item Improved support for display math containing complicated math objects, % such as \pkg{tikz-cd}. See \cref{sec:displaymathother}. % \item Fix: \cs{addcontentsline} inside \SVG\ math. -% \item Fix: SVG math containing an embedded \env{lateximage}. -% \item MathJax now handles \cs{ensuremath} in expressions.\margintag{MathJax} +% \item Fix: \SVG\ math containing an embedded \env{lateximage}. +% \item \brand{MathJax} now handles \cs{ensuremath} in expressions.\margintag{MathJax} % \item Fix: Added \env{alignat} environment. \margintag{misc. fixes} % \item Fix: \pkg{afterpackage} no longer required, which conflicted with \pkg{scrlfile}. % \item Fix: \pkg{titling} \cs{thanks} mark. @@ -4568,11 +4587,11 @@ This boolean may be tested by the user for later use. % ^^A Display math and other forms of \SVG\ image such as \env{picture} and % ^^A \tikz\ still use individual image files which are recreated each time % ^^A \cmds{lwarpmk limages} is run. -% ^^A \item Fixes: SVG math and/or \cs{underline} in a sectioning file name. +% ^^A \item Fixes: \SVG\ math and/or \cs{underline} in a sectioning file name. % ^^A \item Improved \SVG\ display math and tags. % ^^A \item Improved \SVG\ math and \pkg{siunitx} \attribute{alt} tags. % ^^A \item Improved \pkg{siunitx} units. -% ^^A \item Fix: \cs{ensuremath} with MathJax now creates a \env{lateximage}. +% ^^A \item Fix: \cs{ensuremath} with \brand{MathJax} now creates a \env{lateximage}. % ^^A \item Fix: \cs{centering}, etc. in \SVG\ math, \env{lateximage}, \tikz. % ^^A \item Fix: Made various macros robust, % ^^A additionally fixing \pkg{authblk}.\margintag{misc. fixes} @@ -4645,7 +4664,7 @@ This boolean may be tested by the user for later use. % ^^A \item \cs{PrintStack} changed to \cs{LWRPrintStack}.\watchout[name change] % ^^A \item Fix: Empty lines between \env{tabular} rows.\margintag{misc. fixes} % ^^A \item Fix: Stack unnesting. -% ^^A \item Fix: SVG math and \env{lateximage}s in numerous situations. +% ^^A \item Fix: \SVG\ math and \env{lateximage}s in numerous situations. % ^^A \item Fix: Spaces in \cs{usepackage}. % ^^A \item Fix: Now allows \brand{MathJax} inside \env{verse}. % ^^A \end{itemize} @@ -4667,7 +4686,7 @@ This boolean may be tested by the user for later use. % ^^A \item Fix: Empty lines between \env{tabular} rows.\margintag{misc. fixes} % ^^A \item Fix: ``Improper \cs{prevdepth}'' with minipages, lists. % ^^A \item Fix: Incorrect \SVG\ math and |lateximage|s with \pkg{subfig}. -% ^^A \item Fix: Lateximages from incorrect pages with Mathjax. +% ^^A \item Fix: Lateximages from incorrect pages with \brand{Mathjax}. % ^^A \item Fix: Missing sidetoc if using \pkg{listings}. % ^^A \item Fix: Added an \pkg{array} emulation package. % ^^A \item Added @@ -5340,7 +5359,7 @@ This boolean may be tested by the user for later use. % While generating \HTML\ output, \SVG\ files are used in place of \PDF. % Other formats such as \PNG\ and \JPG\ are used as-is. % -% SVG images may be used for math, +% \SVG\ images may be used for math, % and are also used for \env{picture}, \tikz, and similar environments. % The \SVG\ format has better browser and e-book support % than \MathML\ (as of this writing), @@ -5491,8 +5510,8 @@ This boolean may be tested by the user for later use. % % \midrule % -% Languages: & \spkg{babel}, \spkg{polyglossia}. -% \spkg{cjkpunct}, \spkg{xeCJK}.\\ +% Languages: & \spkg{babel}, \spkg{cjkpunct}, \ipkg{impnattypo}, \mpkg{luavlna}, +% \spkg{polyglossia}, \spkg{xeCJK}, \mpkg{xevlna}. \\ % % Chinese: & C\TeX, \spkg{ctex}, % \spkg{upzhkinsoku}, @@ -5620,7 +5639,7 @@ This boolean may be tested by the user for later use. % \mpkg{theorem}, \mpkg{thmbox}, \mpkg{thmtools}. \\ % % Additional math: & Math fonts via \SVG\ images, -% \spkg{accents}\ejax, \spkg{amscd}\sjax, \spkg{autobreak}\ejax, \ipkg{autonum}, +% \spkg{accents}\ejax, \spkg{amscd}\sjax, \spkg{amscdx}, \spkg{autobreak}\ejax, \ipkg{autonum}, % \mpkg{backnaur}\ejax, \mpkg{bm}\ejax, \spkg{braket}\sjax, % \mpkg{breqn}\ijax, \mpkg{bussproofs}\sjax, \mpkg{cases}\ijax, % \spkg{centernot}\ejax, \spkg{cmbright}\ejax, @@ -5628,15 +5647,16 @@ This boolean may be tested by the user for later use. % \spkg{delarray}, \mpkg{DotArrow}\ejax, \spkg{dotlessi}\ejax, \spkg{dotlessj}\sjax, % \spkg{esvect}\ejax, \spkg{extarrows}\ejax, \spkg{fixmath}\ejax, % \spkg{fouridx}\ejax, \spkg{fourier}\ejax, -% \spkg{guass}, \spkg{hhtensor}\ejax, \spkg{icomma}\ijax, \spkg{jkmath}, +% \spkg{guass}, \spkg{hhtensor}\ejax, \spkg{icomma}\ijax, +% \spkg{isomath}\ejax, \spkg{jkmath}, % \spkg{kpfonts}\ejax, \spkg{kpfonts-otf}\ejax, % \spkg{leftidx}\ejax, \spkg{libertinust1math}\ejax, \spkg{mathalpha}\ejax, % \spkg{mathastext}\ejax, \spkg{mathcomp}\ejax, \spkg{mathdesign}\ejax, -% \spkg{mathdots}\ejax, -% \spkg{mathfixs}\ejax, +% \spkg{mathdots}\ejax, \spkg{mathfixs}\ejax, % \spkg{mathpazo}\ejax, \spkg{mathptmx}\ejax, % \spkg{mathpunctspace}\ijax, -% \spkg{mathspec}\ejax, \mpkg{mathtools}\ejax, +% \spkg{mathspec}\ejax, \mpkg{mathtools}\ejax, \spkg{mattens}\ejax, +% \spkg{maybemath}\ijax, \spkg{mdwmath}\ejax, % \mpkg{mismath}\ejax, \spkg{mleftright}\ejax, % \spkg{multiobjective}\ejax, \mpkg{nccmath}\ejax, % \spkg{nicematrix}\ejax, \spkg{noitcrul}\ejax, @@ -5644,9 +5664,10 @@ This boolean may be tested by the user for later use. % \spkg{pb-diagram}, % \spkg{pxfonts}\ejax, % \ipkg{resizegather}\ijax, \spkg{rmathbr}\ejax, \spkg{scalerel}\ejax, -% \epkg{shuffle}\ejax, \spkg{stackrel}\ejax, +% \epkg{shuffle}\ejax, \spkg{skmath}\ejax, \spkg{stackrel}\ejax, % \mpkg{statex2}\ejax, \mpkg{statistics}, \spkg{statmath}\ejax, -% \spkg{subsupscripts}\ejax, \spkg{textualicomma}\ijax, +% \spkg{subsupscripts}\ejax, \spkg{tensind}, \spkg{tensor}\ejax, +% \spkg{textualicomma}\ijax, % \spkg{txfonts}\ejax, \spkg{txgreeks}\ejax, % \spkg{unicode-math}\ejax, \spkg{upgreek}\ejax, % \spkg{ushort}\ejax, \mpkg{witharrows}\ejax, @@ -5694,18 +5715,20 @@ This boolean may be tested by the user for later use. % References to \PDF\ files are changed to \SVG, other image types % are accepted as well. % \cs{rotatebox} and \cs{scalebox} are supported as well as \HTML\ can handle. -% \epkg{rotating} is emulated but all objects are unrotated. +% \epkg{rotating} is emulated but all objects are unrotated in \HTML. % \env{picture}, \mpkg{tikz}, and \mpkg{xy} are converted to an \SVG\ image. % % \smallskip % % \mpkg{asymptote}, \spkg{curves}, \spkg{datatool}, -% \spkg{eepic}, \epkg{epsfig}, \spkg{epstopdf}, +% \spkg{eepic}, \mpkg{epsf}, \epkg{epsfig}, \spkg{epstopdf}, % \epkg{figsize}, \ipkg{fitbox}, -% \spkg{grffile}, \mpkg{luamplib}, \epkg{media9}, -% \epkg{movie15}, \epkg{multimedia}, \mpkg{overpic}, \spkg{pict2e}, +% \spkg{grffile}, \mpkg{lpic}, \mpkg{luamplib}, \epkg{media9}, +% \epkg{movie15}, \epkg{multimedia}, \mpkg{overpic}, \spkg{pict2e}, \mpkg{pinlabel}, % \mpkg{psfrag}, \mpkg{psfragx}, \mpkg{pst-eps}, \mpkg{pstool}, \mpkg{pstricks}, -% \spkg{rviewport}, \mpkg{svg}, \spkg{svg-extract}, \spkg{tikz-3dplot}. \\ +% \mpkg{rlepsf}, +% \spkg{rviewport}, \mpkg{svg}, \spkg{svg-extract}, \mpkg{tikz}, \spkg{tikz-3dplot}, +% \mpkg{tikz-imagelabels}, \mpkg{xy} \\ % % \midrule % @@ -5828,6 +5851,7 @@ This boolean may be tested by the user for later use. % \spkg{circuitikz}, \spkg{econometrics}\ejax, \spkg{elements}, % \mpkg{engtlc}\ejax, \spkg{fast-diagram}, \mpkg{ghsystem}, % \spkg{hepnicenames}, \spkg{heppennames}, \spkg{hepunits}\ejax, +% \mpkg{isotope}\ejax, % \spkg{karnaughmap}, \mpkg{karnaugh-map}, \mpkg{keystroke}, % \mpkg{listings}, \spkg{listingsutf8}, \spkg{linop}, \mpkg{menukeys}, % \mpkg{mhchem}\sjax, \mpkg{minted}, \spkg{pgfgantt}, @@ -6509,7 +6533,7 @@ This boolean may be tested by the user for later use. % create a new file called |tutorial.tex|. % This may be done several ways: % \begin{description} -% \item [Copy from the documentation PDF:] \ +% \item [Copy from the documentation \PDF:] \ % % A listing is in \cref{fig:tutorial}, % which may be copied/pasted from the figure directly into your own editor, @@ -7379,7 +7403,7 @@ This boolean may be tested by the user for later use. % \margintag{Computer Modern}% % \gindex{font>Computer Modern}\gindex{Computer Modern}% % \watchout[\prog{pdflatex}]% -% \watchout[DVI \prog{latex}]% +% \watchout[\DVI\ \prog{latex}]% % which may be a ``type 3'' bit-mapped font which may not % convert well to plain text. A ``type 1'' vector font is required. % @@ -7987,7 +8011,7 @@ This boolean may be tested by the user for later use. % \cs{AltTextClose} & PD & End an \HTML\ \attribute{alt} tag. \\ % \midrule % \cs{CSSFilename} & PS & The \CSS\ for the following files. \\ -% \cs{MathJaxFilename} & PS & The MathJax script for the following files. \\ +% \cs{MathJaxFilename} & PS & The \brand{MathJax} script for the following files. \\ % \midrule % \cs{HTMLLanguage} & PS & The \HTML\ \attribute{lang} tag. \\ % \cs{HTMLTitle} & PS & The homepage's \element{title}, overriding \cs{title}. \\ @@ -8234,11 +8258,11 @@ This boolean may be tested by the user for later use. % % \ItemDescribeMacro{\MathJaxFilename} \marg{filename} % \DescribeDefault{\filenm{lwarp_mathjax.txt}} \quad -% Sets the MathJax script file to use for the following +% Sets the \brand{MathJax} script file to use for the following % files. May be changed before each each sectioning command which would % cause a file split. % -% The MathJax script file is copied into the head of each \HTML\ file. +% The \brand{MathJax} script file is copied into the head of each \HTML\ file. % This may be used to point to a local repository, add extensions, or change % the script somewhere in the middle of the document. % \cs{MathJaxFilename} may be used before each file break to set the script file for @@ -9136,7 +9160,7 @@ This boolean may be tested by the user for later use. % emulated in \brand{MathJax}. % \item Fitting features: \cs{tcboxfit} becomes \cs{tcbox} in \HTML. % \item Footnote numbering does not match the printed output.\watchout[footnotes] -% \item MathJax emulation is provided for common macros. +% \item \brand{MathJax} emulation is provided for common macros. % \end{itemize} % % If using \pkg{cleveref}, @@ -10695,14 +10719,6 @@ This boolean may be tested by the user for later use. % See \cref{sec:mhchem}. % % -% \subsubsection{\pkg{xparse} package} -% -% \changes{v0.45}{2017/12/09}{Docs: \pkg{xparse} warnings.} -% \DescribePackage{xparse} -% \limitsxparse -% \gindex{xparse=\pkg{xparse}>warnings} -% -% % \subsubsection{\pkg{kotex} package} % % \DescribePackage{kotex} @@ -11375,7 +11391,7 @@ This boolean may be tested by the user for later use. % % Equation numbering is not automatic, but the equation numbers in \SVG\ math % will match the \LaTeX\ and \HTML\ output. -% SVG math is recommended when using the \AmS\ environments, which may have +% \SVG\ math is recommended when using the \AmS\ environments, which may have % multiple numbered equations per object. % % As of when last checked, \brand{LibreOffice} ignores the following: @@ -11820,7 +11836,7 @@ This boolean may be tested by the user for later use. % avoid corrupted \HTML\ output. % \item[(width,height) missing a comma:] \cs{makebox} and \cs{framebox} can accept % a parenthesis-delimited width and height, which must be separated by a comma. -% \item[``Load graphicx or graphics for improved SVG math baselines.'':] \SVG\ math +% \item[``Load graphicx or graphics for improved \SVG\ math baselines.'':] \SVG\ math % sizing and baselines are improved if either of these packages are used. % \item[``Load graphicx or graphics for improved XeTeX logo.'':] If these packages % are loaded, the \XeLaTeX\ logo can use the reversed ``E''. @@ -11976,7 +11992,7 @@ This boolean may be tested by the user for later use. % % If using BibTeX, see \cref{sec:limitsbibtex}.\watchout[BibTeX] % -% \item[``\texttt{!~Undefined control sequence. \dots\ \cs{@begindocumenthook}''}:] ~ +% \item[``\texttt{!~Undefined control sequence. \dots\ \cs{\_\_hook} begindocument''}:] ~ % \watchout[\pkg{polyglossia}] \\ % See \cref{sec:limitspolyglossia} % if using \pkg{polyglossia}. @@ -12104,7 +12120,7 @@ This boolean may be tested by the user for later use. % \item Enter \cmds{lwarpmk limages} to refresh the \env{lateximage} images. % \end{itemize} % -% \item[SVG images:] \ +% \item[\SVG\ images:] \ % % \limitssvgimages % @@ -12746,6 +12762,7 @@ This boolean may be tested by the user for later use. % \changes{v0.88}{2020/07/07}{Prevented \pkg{shadethm}.} % \changes{v0.891}{2020/09/16}{Prevented \pkg{libgreek}.} % \changes{v0.893}{2020/11/15}{Allowed \pkg{picinpar}.} +% \changes{v0.895}{2021/01/19}{Allowed \pkg{epsf}.} % % ^^A *earlyloadnever *loadnever % \begin{macrocode} @@ -12766,7 +12783,6 @@ This boolean may be tested by the user for later use. \LWR@earlyloadnever{colortab}{colortbl} \LWR@earlyloadnever{csvtools}{datatool} \LWR@earlyloadnever{doublespace}{setspace} -\LWR@earlyloadnever{epsf}{graphicx} \LWR@earlyloadnever{fancyheadings}{fancyhdr} \LWR@earlyloadnever{fncylab}{cleveref} \LWR@earlyloadnever{formula}{siunitx} @@ -12835,6 +12851,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{algorithm2e} \LWR@loadafter{algorithmicx} \LWR@loadafter{alltt} +\LWR@loadafter{amscdx} % \LWR@loadafter{amsmath}% may be preloaded % \LWR@loadafter{amsthm}% may be preloaded \LWR@loadafter{anonchap} @@ -12943,6 +12960,7 @@ This boolean may be tested by the user for later use. \LWR@notmemoirloadafter{enumerate} \LWR@loadafter{enumitem} \LWR@notmemoirloadafter{epigraph} +\LWR@loadafter{epsf} \LWR@loadafter{epsfig} \LWR@loadafter{epstopdf} \LWR@loadafter{epstopdf-base} @@ -13036,11 +13054,14 @@ This boolean may be tested by the user for later use. \LWR@loadafter{idxlayout} \LWR@loadafter{ifoddpage} \LWR@loadafter{imakeidx} +\LWR@loadafter{impnattypo} \LWR@notmemoirloadafter{index} % inputenc must be loaded before lwarp % inputenx must be loaded before lwarp % inputtrc may be loaded before lwarp \LWR@loadafter{intopdf} +\LWR@loadafter{isomath} +\LWR@loadafter{isotope} \LWR@loadafter{jurabib} \LWR@loadafter{karnaugh-map} \LWR@loadafter{keyfloat} @@ -13060,6 +13081,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{listings} \LWR@loadafter{listliketab} \LWR@loadafter{longtable} +\LWR@loadafter{lpic} \LWR@loadafter{lscape} \LWR@loadafter{ltablex} \LWR@loadafter{ltcaption} @@ -13070,6 +13092,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{luacolor} \LWR@loadafter{luamplib} \LWR@loadafter{luatodonotes} +\LWR@loadafter{luavlna} \LWR@loadafter{lyluatex} \LWR@loadafter{magaz} \LWR@notmemoirloadafter{makeidx} @@ -13088,8 +13111,11 @@ This boolean may be tested by the user for later use. \LWR@loadafter{mathptmx} \LWR@loadafter{mathspec} \LWR@loadafter{mathtools} +\LWR@loadafter{mattens} +\LWR@loadafter{maybemath} \LWR@loadafter{mcaption} \LWR@loadafter{mdframed} +\LWR@loadafter{mdwmath} \LWR@loadafter{media9} \LWR@loadafter{memhfixc} \LWR@loadafter{menukeys} @@ -13177,6 +13203,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{physunits} \LWR@loadafter{picinpar} \LWR@loadafter{pifont} +\LWR@loadafter{pinlabel} \LWR@loadafter{placeins} \LWR@loadafter{plarray} \LWR@loadafter{plarydshln} @@ -13208,6 +13235,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{repeatindex} \LWR@loadafter{resizegather} \LWR@loadafter{returntogrid} +\LWR@loadafter{rlepsf} \LWR@loadafter{rmathbr} \LWR@loadafter{rmpage} \LWR@loadafter{romanbar} @@ -13242,6 +13270,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{simplebnf} \LWR@loadafter{SIunits} \LWR@loadafter{siunitx} +\LWR@loadafter{skmath} \LWR@loadafter{slantsc} \LWR@loadafter{slashed} \LWR@loadafter{soul} @@ -13277,6 +13306,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{tagpdf} \LWR@loadafter{tascmac} \LWR@loadafter{tcolorbox} +\LWR@loadafter{tensor} \LWR@loadafter{termcal} \LWR@loadafter{textarea} % \LWR@loadafter{textcomp}% maybe before lwarp with font packages @@ -13294,6 +13324,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{thumb} \LWR@loadafter{thumbs} \LWR@loadafter{tikz} +\LWR@loadafter{tikz-imagelabels} \LWR@loadafter{titleps} \LWR@loadafter{titlesec} \LWR@loadafter{titletoc} @@ -13351,6 +13382,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{xechangebar} \LWR@loadafter{xellipsis} % xetexko-vertical must be loaded before lwarp +\LWR@loadafter{xevlna} \LWR@loadafter{xfakebold} \LWR@loadafter{xfrac} \LWR@loadafter{xltabular} @@ -13452,7 +13484,7 @@ This boolean may be tested by the user for later use. % % % \section{Unicode input characters} -% \changes{v0.18}{2016/05/17}{PDF Unicode input characters.} +% \changes{v0.18}{2016/05/17}{PDF=\PDF\ Unicode input characters.} % \gindex{Unicode>input characters} % % \codeall @@ -13528,7 +13560,7 @@ This boolean may be tested by the user for later use. % % \section{Upright quotes} % -% In PDF\TeX, preserve upright quotes in verbatim text. +% In pdf\TeX, preserve upright quotes in verbatim text. % \pkg{upquote} also loads \pkg{textcomp}. % % \changes{v0.63}{2018/11/25}{p\TeX: Load \pkg{upquote}.} @@ -13544,6 +13576,33 @@ This boolean may be tested by the user for later use. % % % +% \section{Avoid bad font combinations} +% +% For \XeLaTeX\ and \LuaLaTeX, certain font combinations cause problems +% with \pkg{lwarp}. +% +% \pkg{libertinus-otf} has special handling for \cs{textquotedbl}. +% Search for \cs{LWR@orig@textquotedbl}. +% +% \changes{v0.895}{2021/01/14}{Use \pkg{kpfonts-otf} if \LuaLaTeX, \XeLaTeX.} +% +% \begin{macrocode} +\ifxetexorluatex + \AtBeginDocument{ + \@ifpackageloaded{kpfonts}{ + \PackageError{lwarp} + {% + When using XeLaTeX or LuaLaTeX,\MessageBreak + use kpfonts-otf instead of kpfonts% + } + {% + Replace: \protect\usepackage{kpfonts}\MessageBreak + with: \protect\usepackage{kpfonts-otf} + } + }{} + } +\fi +% \end{macrocode} % % % \section{Miscellaneous tools} @@ -14961,7 +15020,7 @@ This boolean may be tested by the user for later use. % \changes{v0.20}{2017/01/12}{Page geometry set to 6in wide with large margins.} % \changes{v0.27}{2017/04/04}{Page geometry modified to reduce line overflow.} % \changes{v0.28}{2017/04/13}{Forced oneside to maintain large right margin.} -% \changes{v0.52}{2018/03/31}{Fix: MathJax script line wraps. Reduced right margin.} +% \changes{v0.52}{2018/03/31}{Fix: \brand{MathJax} script line wraps. Reduced right margin.} % \changes{v0.74}{2019/08/13}{Remembers user's geometry.} % % \codehtml @@ -15464,6 +15523,7 @@ This boolean may be tested by the user for later use. % \changes{v0.88}{2020/07/07}{Prevented \pkg{shadethm}.} % \changes{v0.891}{2020/09/16}{Prevented \pkg{libgreek}.} % \changes{v0.893}{2020/11/15}{Allowed \pkg{picinpar}.} +% \changes{v0.895}{2021/01/19}{Allowed \pkg{epsf}.} % The following should never be loaded: % @@ -15481,7 +15541,6 @@ This boolean may be tested by the user for later use. \LWR@checkloadnever{#1}{colortab}{colortbl} \LWR@checkloadnever{#1}{csvtools}{datatool} \LWR@checkloadnever{#1}{doublespace}{setspace} -\LWR@checkloadnever{#1}{epsf}{graphicx} \LWR@checkloadnever{#1}{fancyheadings}{fancyhdr} \LWR@checkloadnever{#1}{fncylab}{cleveref} \LWR@checkloadnever{#1}{formula}{siunitx} @@ -15505,6 +15564,7 @@ This boolean may be tested by the user for later use. % % ^^A *loadbefore % The following should only be loaded before \pkg{lwarp}: +% \changes{v0.895}{2021/01/14}{\pkg{kpfonts} load before \pkg{lwarp}.} % \begin{macrocode} \LWR@checkloadbefore{#1}{ctex} \LWR@checkloadbefore{#1}{fontspec} @@ -15513,6 +15573,7 @@ This boolean may be tested by the user for later use. \LWR@checkloadbefore{#1}{nfssext-cfr} \LWR@checkloadbefore{#1}{fontaxes} \LWR@checkloadbefore{#1}{kotex} +\LWR@checkloadbefore{#1}{kpfonts}% textcomp option clash \LWR@checkloadbefore{#1}{luatexja} \LWR@checkloadbefore{#1}{luatexja-fontspec} \LWR@checkloadbefore{#1}{luatexko} @@ -16479,6 +16540,7 @@ This boolean may be tested by the user for later use. \begin{warpHTML} % \end{macrocode} % +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \AtBeginDocument{ \ifbool{FormatWP}{ @@ -16496,11 +16558,11 @@ This boolean may be tested by the user for later use. \renewcommand*{\LWR@tagsubsubsectionend}{/h5} \renewcommand*{\LWR@tagparagraph}{h6} \renewcommand*{\LWR@tagparagraphend}{/h6} -\renewcommand*{\LWR@tagsubparagraph}{span class="subparagraph"} +\renewcommand*{\LWR@tagsubparagraph}{span class=\textquotedbl{}subparagraph\textquotedbl} \renewcommand*{\LWR@tagsubparagraphend}{/span} }% WPTitleHeading {% not WPTitleHeading, part and section starting at h1 -\renewcommand*{\LWR@tagtitle}{div class="title"} +\renewcommand*{\LWR@tagtitle}{div class=\textquotedbl{}title\textquotedbl} \renewcommand*{\LWR@tagtitleend}{/div} \renewcommand*{\LWR@tagpart}{h1} \renewcommand*{\LWR@tagpartend}{/h1} @@ -16519,7 +16581,7 @@ This boolean may be tested by the user for later use. {% chapter defined \ifbool{WPTitleHeading}{} {% not WPTitleHeading, part and chapter starting at h1 -\renewcommand*{\LWR@tagtitle}{div class="title"} +\renewcommand*{\LWR@tagtitle}{div class=\textquotedbl{}title\textquotedbl} \renewcommand*{\LWR@tagtitleend}{/div} \renewcommand*{\LWR@tagpart}{h1} \renewcommand*{\LWR@tagpartend}{/h1} @@ -16533,7 +16595,7 @@ This boolean may be tested by the user for later use. \renewcommand*{\LWR@tagsubsubsectionend}{/h5} \renewcommand*{\LWR@tagparagraph}{h6} \renewcommand*{\LWR@tagparagraphend}{/h6} -\renewcommand*{\LWR@tagsubparagraph}{span class="subparagraph"} +\renewcommand*{\LWR@tagsubparagraph}{span class=\textquotedbl{}subparagraph\textquotedbl} \renewcommand*{\LWR@tagsubparagraphend}{/span} }% not WPTitleHeading }% chapter defined @@ -16592,9 +16654,22 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \let\LWR@origvdots\vdots % \end{macrocode} +% +% \pkg{libertinus-otf} has too much kerning for \cs{textquotedbl}, +% causing an extra space. +% \changes{v0.895}{2021/01/14}{Fixed \pkg{libertinus-otf} \cs{textquotedbl} kern.} % \begin{macrocode} -\let\LWR@orig@textquotedbl\textquotedbl +\LetLtxMacro\LWR@orig@@textquotedbl\textquotedbl +\LetLtxMacro\LWR@orig@textquotedbl\LWR@orig@@textquotedbl +\AtEndPreamble{ +\@ifpackageloaded{libertinus-otf}{ + \renewcommand{\LWR@orig@textquotedbl}{\LWR@orig@@textquotedbl\kern-.15em} + \LetLtxMacro\textquotedbl\LWR@orig@textquotedbl +}{} +} +% \end{macrocode} +% \begin{macrocode} \LetLtxMacro\LWR@origttfamily\ttfamily \LetLtxMacro\LWR@origem\em @@ -16892,7 +16967,7 @@ This boolean may be tested by the user for later use. \PackageError{lwarp}% {Unknown LaTeX engine}% {% - Lwarp only knows about pdflatex, dvi latex, + Lwarp only knows about pdflatex, DVI latex, xelatex, lualatex, and upLateX.% }% } @@ -17323,7 +17398,7 @@ This boolean may be tested by the user for later use. \begin{filecontents*}[overwrite]{lwarp.css} /* CSS stylesheet for the LaTeX Lwarp package - Copyright 2016-2020 Brian Dunn — BD Tech Concepts LLC + Copyright 2016-2021 Brian Dunn — BD Tech Concepts LLC */ @@ -19744,8 +19819,8 @@ page_compositor "." % \credits{Davide P. Cervone} % \DescribeFile{lwarp_mathjax.txt} -% The default MathJax script used by \pkg{lwarp} when using \brand{MathJax}. -% A recent version of MathJax is used, as served by the recommended repository. +% The default \brand{MathJax} script used by \pkg{lwarp} when using \brand{MathJax}. +% A recent version of \brand{MathJax} is used, as served by the recommended repository. % Adjustments are made to allow \LaTeX\ to control the equation tags % and provide for starred macros. % @@ -19781,6 +19856,7 @@ page_compositor "." % \changes{v0.87}{2020/05/20}{File: \filenm{lwarp_mathjax.txt}: Now provides \cs{ifstar}, \cs{ifnextchar}.} % \changes{v0.891}{2020/09/07}{File: \filenm{lwarp_mathjax.txt}: Renamed \filenm{tagformat} extension.} % \changes{v0.892}{2020/09/26}{File: \filenm{lwarp_mathjax.txt}: Added \cs{left} \Slash \cs{right} delimiters.} +% \changes{v0.895}{2021/01/13}{File: \filenm{lwarp_mathjax.txt}: Added \cs{ifblank}, \cs{ifstrequal} macros.} % ^^A *lwarp_mathjax.txt % % \codeconfig @@ -19832,10 +19908,13 @@ MathJax = { } } - // Create the command map for \ifstar, \ifnextchar, \seteqnumber - new CommandMap('ifstar-ifnextchar-setequnumber', { + // Create the command map for: + // \ifstar, \ifnextchar, \ifblank, \ifstrequal, \seteqnumber + new CommandMap('Lwarp-macros', { ifstar: 'IfstarFunction', ifnextchar: 'IfnextcharFunction', + ifblank: 'IfblankFunction', + ifstrequal: 'IfstrequalFunction', seteqnumber: 'SeteqnumberFunction' }, { // This function implements an ifstar macro. @@ -19859,6 +19938,25 @@ MathJax = { useArgument(parser, gotchar ? resultnextchar : resultnotnextchar); }, + // This function implements an ifblank macro. + IfblankFunction(parser, name) { + const blankarg = parser.GetArgument(name); + const resultblank = parser.GetArgument(name); + const resultnotblank = parser.GetArgument(name); + const isblank = (blankarg.trim() == ""); + useArgument(parser, isblank ? resultblank : resultnotblank); + }, + + // This function implements an ifstrequal macro. + IfstrequalFunction(parser, name) { + const strequalfirst = parser.GetArgument(name); + const strequalsecond = parser.GetArgument(name); + const resultequal = parser.GetArgument(name); + const resultnotequal = parser.GetArgument(name); + const isequal = (strequalfirst == strequalsecond); + useArgument(parser, isequal ? resultequal : resultnotequal); + }, + // This function modifies the equation numbers. SeteqnumberFunction(parser, name) { // Get the macro parameters @@ -19874,9 +19972,9 @@ MathJax = { }); - // Create the ifstar-ifnextchar-setequnumber package - Configuration.create('ifstar-ifnextchar-setequnumber', { - handler: {macro: ['ifstar-ifnextchar-setequnumber']} + // Create the Lwarp-macros package + Configuration.create('Lwarp-macros', { + handler: {macro: ['Lwarp-macros']} }); MathJax.startup.defaultReady(); @@ -19943,7 +20041,7 @@ MathJax = { }, // startup tex: { - packages: {'[+]': ['tagformat', 'ifstar-ifnextchar-setequnumber', 'textmacros']}, + packages: {'[+]': ['tagformat', 'Lwarp-macros', 'textmacros']}, tags: "ams", tagformat: { number: function (n) { @@ -20091,10 +20189,10 @@ MathJax = { \begin{filecontents*}[overwrite]{lwarpmk.lua} #!/usr/bin/env texlua --- Copyright 2016-2020 Brian Dunn +-- Copyright 2016-2021 Brian Dunn -printversion = "v0.894" +printversion = "v0.895" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -21347,11 +21445,11 @@ end -- not --version % \DescribeBoolean{LWR@mathmacro} True if currently defining math macros. -% Used to disable \SVG\ math hashing and MathJax math contents while +% Used to disable \SVG\ math hashing and \brand{MathJax} math contents while % defining a macro using inline math. % Begin a macro, it is not guaranteed that the contents are static, and so % the image must be unique. The contents also almost certainly will not be -% parsed correctly by MathJax. +% parsed correctly by \brand{MathJax}. % \begin{macrocode} \newbool{LWR@mathmacro} \boolfalse{LWR@mathmacro} @@ -21397,7 +21495,7 @@ end -- not --version % value of a counter, then \cs{inlinemathother} must be used before the % inline math expression, and \cs{inlinemathnormal} must be used after. % -% For MathJax, the inline math expression is usually printed for MathJax to +% For \brand{MathJax}, the inline math expression is usually printed for \brand{MathJax} to % interpret. When marked as dynamic math, the following inline math expression % will be displayed as an unhashed inline \SVG\ image instead. % @@ -21473,7 +21571,7 @@ end -- not --version \newcommand*{\HTMLentity}[1]{% % \LWR@traceinfo{HTMLentity \detokenize{#1}}% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \LWR@origampersand#1;% \endgroup% % \LWR@traceinfo{HTMLentity done}% @@ -21716,7 +21814,7 @@ end -- not --version % % Prints the filename for the given label % -% \changes{v0.50}{2018/02/20}{Fix: SVG math in a section name.} +% \changes{v0.50}{2018/02/20}{Fix: \SVG\ math in a section name.} % \begin{macrocode} \newcommand*{\LWR@htmlrefsectionfilename}[1]{% \LWR@traceinfo{LWR@htmlrefsectionfilename: !\detokenize{#1}!}% @@ -22181,10 +22279,11 @@ end -- not --version % \subsection{Mapping \LaTeX\ sections to \HTML\ sections} % % \changes{v0.73}{2019/06/21}{Added \cs{book} for \pkg{memoir}.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@tagtitle}{h1} \newcommand*{\LWR@tagtitleend}{/h1} -\newcommand*{\LWR@tagbook}{div class="book"} +\newcommand*{\LWR@tagbook}{div class=\textquotedbl{}book\textquotedbl} \newcommand*{\LWR@tagbookend}{/div} \newcommand*{\LWR@tagpart}{h2} \newcommand*{\LWR@tagpartend}{/h2} @@ -22196,15 +22295,30 @@ end -- not --version \newcommand*{\LWR@tagsubsectionend}{/h5} \newcommand*{\LWR@tagsubsubsection}{h6} \newcommand*{\LWR@tagsubsubsectionend}{/h6} -\newcommand*{\LWR@tagparagraph}{span class="paragraph"} +\newcommand*{\LWR@tagparagraph}{span class=\textquotedbl{}paragraph\textquotedbl} \newcommand*{\LWR@tagparagraphend}{/span} -\newcommand*{\LWR@tagsubparagraph}{span class="subparagraph"} +\newcommand*{\LWR@tagsubparagraph}{span class=\textquotedbl{}subparagraph\textquotedbl} \newcommand*{\LWR@tagsubparagraphend}{/span} \newcommand*{\LWR@tagregularparagraph}{p} % \end{macrocode} +% \subsection{Hook while processing tags} +% +% This is used to disable special text processing while processing \HTML\ tags. +% Special processing includes that done by +% \pkg{babel-french}, \pkg{luavina}, \pkg{xevlna}. +% +% \begin{macro}{\LWR@hook@processingtags} Disable special text processing +% while generating tags. +% Replaces \cs{LWR@FBcancel} in most places. +% \changes{v0.895}{2021/01/12}{Added.} +% \begin{macrocode} +\newcommand*{\LWR@hook@processingtags}{} +% \end{macrocode} +% \end{macro} + % \subsection{Babel-French tag modifications} @@ -22231,6 +22345,7 @@ end -- not --version {}% {% \LetLtxMacro\LWR@FBcancel\NoAutoSpacing% + \appto{\LWR@hook@processingtags}{\LWR@FBcancel}% }% \@ifundefined{frenchbsetup}% @@ -22243,31 +22358,31 @@ end -- not --version % \renewrobustcmd*{\FBcolonspace}{% \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% \LWR@origampersand{}nbsp;% \endgroup% }% \renewrobustcmd*{\FBthinspace}{% \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% \LWR@origampersand\LWR@origpound{}x202f;% \, \endgroup% }% \renewrobustcmd*{\FBguillspace}{% \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% \LWR@origampersand{}nbsp;% ~, for \og xyz \fg{} \endgroup% }% \DeclareDocumentCommand{\FBmedkern}{}{% \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% \LWR@origampersand\LWR@origpound{}x202f;% \, \endgroup% }% \DeclareDocumentCommand{\FBthickkern}{}{% \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% \LWR@origampersand{}nbsp;% ~ \endgroup% }% @@ -22316,7 +22431,7 @@ end -- not --version \newcommand*{\LWR@htmltagc}[1]{% \LWR@traceinfo{LWR@htmltagc !\detokenize{#1}!}% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% \protect\LWR@origtextless% \LWR@isolate{#1}% @@ -22496,7 +22611,7 @@ end -- not --version {% % \LWR@traceinfo{LWR@htmlopencomment}% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% \LWR@print@mbox{\LWR@origtextless{}!-\/-}% \endgroup% @@ -22507,7 +22622,7 @@ end -- not --version {% % \LWR@traceinfo{LWR@htmlclosecomment}% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% \LWR@print@mbox{-\/-\LWR@origtextgreater}% \endgroup% @@ -23461,7 +23576,7 @@ end -- not --version -% \section{MathJax script} +% \section{\brand{MathJax} script} % \codehtml % \begin{macrocode} @@ -23470,11 +23585,11 @@ end -- not --version % \begin{macro}{\LWR@mathjaxfilename} % \DescribeDefault{\filenm{lwarp_mathjax.txt}} -% The MathJax script filename to use. +% The \brand{MathJax} script filename to use. % This file is copied into the head of each \HTML\ page. % This may be changed mid-document using \cs{MathJaxFilename}, -% allowing the use of a custom MathJax script, such as for a local repository, -% or different MathJax script files to be used for different sections of the document. +% allowing the use of a custom \brand{MathJax} script, such as for a local repository, +% or different \brand{MathJax} script files to be used for different sections of the document. % % \changes{v0.70}{2019/03/24}{Added.} % \begin{macrocode} @@ -23483,7 +23598,7 @@ end -- not --version % \end{macro} % \begin{macro}{\MathJaxFilename} \marg{filename} \qquad -% Assigns the MathJax script file to be used by the following \HTML\ pages. +% Assigns the \brand{MathJax} script file to be used by the following \HTML\ pages. % % \changes{v0.70}{2019/03/24}{Added.} % \begin{macrocode} @@ -24563,7 +24678,7 @@ end -- not --version \LWR@replacestrings{'}{'}% \LWR@replacestrings{`}{`}% % \end{macrocode} -% MathJax allows expressions to be defined with \cs{newcommand}. +% \brand{MathJax} allows expressions to be defined with \cs{newcommand}. % These expressions would appear with |##| for each argument, % and each must be changed to a single |#|. % This must be done after all the above changes. @@ -24587,7 +24702,7 @@ end -- not --version % and fully expand the strings: % \begin{macrocode} \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% \edef\LWR@strresult{\detokenize{#1}}% \LWR@subHTMLsanitize% \LWR@strresult% @@ -24625,7 +24740,7 @@ end -- not --version % and fully expand the strings: % \begin{macrocode} \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% % \end{macrocode} % The difference between this and \cs{LWR@HTMLsanitize} (without ``expand'') % is the following \cs{expandafter}: @@ -24676,7 +24791,7 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@subcustomizedmathjax}[1]{% \begingroup% - \LWR@FBcancel% + \LWR@hook@processingtags% \edef\LWR@strresult{\detokenize{#1}}% \LWR@subHTMLsanitize% \xdef\LWR@customizedMathJax{% @@ -24703,7 +24818,7 @@ end -- not --version \newcommand*{\CustomizeMathJax}[1]{% \ifbool{LWR@warnedcustomizemathjax}{}{% \StrLen{\detokenize{#1}}[\LWR@tempone]% - \ifnumgreater{\LWR@tempone}{200}{% + \ifnumgreater{\LWR@tempone}{350}{% \AtEndDocument{% \PackageWarningNoLine{lwarp}{% To ensure faster MathJax compilation, place each\MessageBreak @@ -24736,6 +24851,7 @@ end -- not --version % \end{macrocode} % \end{macro} + % ^^A *mathjax customizations % Default customizations: % \margintag{defaults} @@ -24832,7 +24948,7 @@ end -- not --version % \begin{macro}{\LWR@customizeMathJax} -% Prints MathJax commands to the \HTML\ output. +% Prints \brand{MathJax} commands to the \HTML\ output. % % \changes{v0.79}{2020/01/28}{MathJax: Hide definitions.} % \begin{macrocode} @@ -25106,7 +25222,7 @@ end -- not --version % Uses pipe-separated fields for |split_html.gawk|. % Uses monospaced font with ligatures disabled for everything except the title. % -% \changes{v0.50}{2018/02/20}{Fix: SVG math in a section name.} +% \changes{v0.50}{2018/02/20}{Fix: \SVG\ math in a section name.} % \begin{macrocode} \LWR@traceinfo{LWR@newhtmlfile: about to print start file}% % \end{macrocode} @@ -25550,7 +25666,7 @@ end -- not --version % % \DescribeCounter{LWR@currentautosec} Records the page number when the section % was created. (If a math expression is included in the section name, -% and SVG math is used, the corresponding \env{lateximage} will cause the +% and \SVG\ math is used, the corresponding \env{lateximage} will cause the % page number to change by the time the following autosec label is created, % thus the initial page number is recorded here.) % \changes{v0.43}{2017/11/01}{\ctr{LWR@currentautosec}: Added.} @@ -26257,6 +26373,10 @@ end -- not --version % \end{macrocode} % % The language is user-adjustable: +% +% NOTE: \cs{LWR@orig@textquotedbl} is used here because \cs{textquotedbl} is +% nullified by \cs{LWR@nullfonts} while starting the new file. +% % \begin{macrocode} \LWR@htmltag{% html lang=\LWR@orig@textquotedbl\LWR@currentHTMLLanguage\LWR@orig@textquotedbl% @@ -26523,7 +26643,7 @@ end -- not --version \global\boolfalse{LWR@doingstartpars} % \end{macrocode} % Document and page settings: -% \changes{v0.45}{2017/12/08}{Fix: Lateximages on incorrect pages with Mathjax.} +% \changes{v0.45}{2017/12/08}{Fix: Lateximages on incorrect pages with \brand{Mathjax}.} % \begin{macrocode} \mainmatter \LWR@origpagenumbering{arabic} @@ -27765,11 +27885,14 @@ end -- not --version \LWR@htmltag{/span}% \endgroup% } - +% \end{macrocode} +% +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} +% \begin{macrocode} \xpretocmd{\verb} {% \begingroup% - \LWR@htmltag{span class="texttt"}% + \LWR@htmltag{span class=\textquotedbl{}texttt\textquotedbl}% \let\verb@egroup\LWR@verb@egroup@endspan% } {} @@ -27836,7 +27959,7 @@ end -- not --version % \end{macrocode} % Turn off \pkg{babel-french} extra space before punctuation: % \begin{macrocode} -\LWR@FBcancel% +\LWR@hook@processingtags% % \end{macrocode} % Do not produce \HTML\ tags for \cs{hspace} inside a verse |par|. % Restore plain \LaTeX{} \cs{hspace} functionality: @@ -28085,8 +28208,11 @@ end -- not --version % \begin{macro}{\LWR@printopenlist} % May be locally redefined by \env{enumerate} or \env{description}. % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} -\newcommand*{\LWR@printopenlist}{ul style="\LWR@print@mbox{list-style-type:none}"} +\newcommand*{\LWR@printopenlist}{% + ul style=\textquotedbl\LWR@print@mbox{list-style-type:none}\textquotedbl{}% +} % \end{macrocode} % \end{macro} @@ -28323,10 +28449,13 @@ end -- not --version % \begin{environment}{itemize} \oarg{options} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@itemizestart}{% \renewcommand*{\LWR@printcloselist}{\LWR@printcloseitemize} -\renewcommand*{\LWR@printopenlist}{ul style="\LWR@print@mbox{list-style-type:none}"} +\renewcommand*{\LWR@printopenlist}{% + ul style=\textquotedbl\LWR@print@mbox{list-style-type:none}\textquotedbl{}% +} \let\item\LWR@itemizeitem% \LWR@nulllistfills% } @@ -28341,10 +28470,13 @@ end -- not --version % \begin{environment}{enumerate} \oarg{options} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@enumeratestart}{% \renewcommand*{\LWR@printcloselist}{\LWR@printcloseitemize} -\renewcommand*{\LWR@printopenlist}{ul style="\LWR@print@mbox{list-style-type:none}"} +\renewcommand*{\LWR@printopenlist}{% + ul style=\textquotedbl\LWR@print@mbox{list-style-type:none}\textquotedbl{}% +} \let\item\LWR@itemizeitem% \LWR@nulllistfills% } @@ -30078,6 +30210,7 @@ end -- not --version \booltrue{LWR@startedrow}% % \end{macrocode} % Create the row tag, with a class if necessary. +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \booltrue{LWR@intabularmetadata}% \ifboolexpr{% @@ -30085,19 +30218,19 @@ end -- not --version test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}}% }% {% - \LWR@htmltag{tr class="hline" }% + \LWR@htmltag{tr class=\textquotedbl{}hline\textquotedbl }% \LWR@orignewline% }% {% not doing hline \ifbool{LWR@doingtbrule}% {% \ifdefvoid{\LWR@ruleHTMLcolor}{% - \LWR@htmltag{tr class="tbrule"}% + \LWR@htmltag{tr class=\textquotedbl{}tbrule\textquotedbl}% }{% \LWR@htmltag{% - tr class="tbrule" % space - style="border-top: 1px solid % space - \LWR@origpound\LWR@ruleHTMLcolor "% + tr class=\textquotedbl{}tbrule\textquotedbl\ % space + style=\textquotedbl{}border-top: 1px solid % space + \LWR@origpound\LWR@ruleHTMLcolor \textquotedbl{}% }% }% \LWR@orignewline% @@ -30148,15 +30281,16 @@ end -- not --version \LWR@traceinfo{atbang: #2 !\LWR@atbangspec!}% % \end{macrocode} % Only generate if is not empty; +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \ifdefempty{\LWR@atbangspec}% {}% {% not empty \LWR@htmltag{% - td class="td#1% + td class=\textquotedbl{}td#1% \LWR@subaddcmidruletrim{}{}% \LWR@printbartag{#2}% - "% + \textquotedbl{}% \LWR@tdstartstyles% \LWR@addcmidrulewidth% \LWR@addcdashline% @@ -30248,13 +30382,14 @@ end -- not --version \LWR@getexparray{LWR@tablecolspec}{\arabic{LWR@tableLaTeXcolindex}}% }% % \end{macrocode} -% print the start of a new table data cell: +% Print the start of a new table data cell: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@traceinfo{LWR@tabledatasinglecolumntag: about to print td tag}% \LWR@htmltag{% - td class="td% + td class=\textquotedbl{}td% % \end{macrocode} -% append this column's spec: +% Append this column's spec: % \begin{macrocode} \LWR@strresult% % \end{macrocode} @@ -30264,7 +30399,7 @@ end -- not --version \LWR@addcmidruletrim% \LWR@addleftmostbartag% \LWR@printbartag{\arabic{LWR@tableLaTeXcolindex}}% - "% + \textquotedbl{}% % \end{macrocode} % Add styles for rules, alignment: % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add cell alignment.} @@ -30512,11 +30647,12 @@ end -- not --version % \begin{macro}{\LWR@tdaddstyle} % Starts adding a table data cell style. +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@tdaddstyle}{% \ifbool{LWR@tdhavecellstyle}% {; }% - { style="}% + { style=\textquotedbl}% \booltrue{LWR@tdhavecellstyle}% } % \end{macrocode} @@ -30525,11 +30661,12 @@ end -- not --version % \begin{macro}{\LWR@tdendstyles} % Finishes possibly adding a table data cell style. % Prints the closing quote. +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@tdendstyles}{% \ifbool{LWR@tdhavecellstyle}% {% - "% + \textquotedbl% \boolfalse{LWR@tdhavecellstyle}% }{}% } @@ -30887,11 +31024,14 @@ end -- not --version % \begin{macro}{\LWR@subaddtabularcellcolor} \marg{\HTML\ color} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@subaddtabularcellcolor}[1]{% - \LWR@htmltag{div class="cellcolor" style="% + \LWR@htmltag{div class=\textquotedbl{}cellcolor\textquotedbl\ % space + style=\textquotedbl{}% background:\LWR@origpound{}{}#1 % - " }% + \textquotedbl\ % + }% space \defaddtocounter{LWR@cellcolordepth}{1}% } % \end{macrocode} @@ -31249,20 +31389,22 @@ end -- not --version \LWR@maybenewtablerow% % \end{macrocode} % Begin the opening table data tag: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@htmltag{% - td colspan="#4" % + td colspan=\textquotedbl#4\textquotedbl\ % % \end{macrocode} % % \begin{macrocode} \IfValueT{#2}{ % rows? - rowspan="#2" % + rowspan=\textquotedbl#2\textquotedbl\ % }% % \end{macrocode} % % \changes{v0.84}{2020/04/16}{Fix: Multicolumn style.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - class="td% + class=\textquotedbl{}td% % \end{macrocode} % Print the column type and vertical bars: % \begin{macrocode} @@ -31306,8 +31448,9 @@ end -- not --version { tvertbarrdoubledash}{}% % \end{macrocode} % Close the class tag's opening quote: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - "% + \textquotedbl{}% % \end{macrocode} % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add cell alignment.} % \begin{macrocode} @@ -32139,7 +32282,7 @@ end -- not --version % \begin{macro}{\LWR@nullifyNoAutoSpacing} % For \pkg{babel-french}, turn off auto spacing at the start of the tabular, % then nullify the autospacing commands inside the tabular, -% since they were not compatible with the tabular column parsing code, +% since they were not compatible with the tabular parsing code for each cell, % which uses \pkg{xstring}. % \changes{v0.41}{2017/10/06}{\pkg{babel-french}: Fix: \cs{NoAutoSpacing} in a tabular.} % \changes{v0.78}{2019/10/29}{\pkg{babel-french}: Fix: Hyperlinks.} @@ -32762,9 +32905,10 @@ end -- not --version % \begin{macro}{\LWR@label@subcreatetag} Creates the tag from \cs{LWR@sanitized}. +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@label@subcreatetag}{% - \LWR@htmltag{a \LWR@print@mbox{id="\LWR@sanitized"}}% + \LWR@htmltag{a \LWR@print@mbox{id=\textquotedbl\LWR@sanitized\textquotedbl}}% \LWR@htmltag{/a}% } % \end{macrocode} @@ -32912,10 +33056,11 @@ end -- not --version % \begin{macro}{\LWR@addlinktitle} % \changes{v0.74}{2019/08/25}{Added.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@addlinktitle}{% \ifdefvoid{\LWR@ThisAltText}{}{ % space - title="\LWR@ThisAltText" % space + title=\textquotedbl\LWR@ThisAltText\textquotedbl\ % space \gdef\LWR@ThisAltText{}% }% } @@ -32939,8 +33084,9 @@ end -- not --version \LWR@traceinfo{LWR@startref A: !#1!}% % \end{macrocode} % Create the filename part of the link: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - \LWR@htmltag{a href="% + \LWR@htmltag{a href=\textquotedbl% \LWR@traceinfo{LWR@startref B}% \LWR@print@mbox{\LWR@htmlrefsectionfilename{#1}}% \LWR@traceinfo{LWR@startref C}% @@ -32985,8 +33131,9 @@ end -- not --version \LWR@traceinfo{LWR@startref E}% % \end{macrocode} % Closing quote: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - "% + \textquotedbl% % \end{macrocode} % Maybe add a title: % \begin{macrocode} @@ -33155,7 +33302,7 @@ end -- not --version % For \pkg{babel-french}: % \changes{v0.78}{2019/10/29}{\pkg{babel-french}: Fix: Hyperlinks.} % \begin{macrocode} - \LWR@FBcancel% + \LWR@hook@processingtags% } % \end{macrocode} % \end{macro} @@ -33176,7 +33323,7 @@ end -- not --version % For \pkg{babel-french}: % \changes{v0.78}{2019/10/29}{\pkg{babel-french}: Fix: Hyperlinks.} % \begin{macrocode} - \LWR@FBcancel% + \LWR@hook@processingtags% } % \end{macrocode} % \end{macro} @@ -33191,14 +33338,15 @@ end -- not --version % \changes{v0.18}{2016/04/14}{Improved \HTML\ output linebreaks.} % \changes{v0.45}{2017/12/29}{Improved URLs with underscores.} % \changes{v0.57}{2018/06/05}{Fix: Text catcodes.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \NewDocumentCommand{\LWR@subhyperref}{m}{% \LWR@traceinfo{LWR@subhyperref !#1!}% \LWR@sanitize{#1}% \LWR@htmltag{% - a href="\LWR@sanitized" % space + a href=\textquotedbl\LWR@sanitized\textquotedbl\ % space \LWR@addlinktitle % space - target="\_{}blank" % space + target=\textquotedbl\_{}blank\textquotedbl\ % space }% } % \end{macrocode} @@ -33225,12 +33373,13 @@ end -- not --version % \changes{v0.45}{2017/12/29}{Improved URLs with underscores.} % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \changes{v0.78}{2019/11/05}{Remove extra space.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \NewDocumentCommand{\LWR@subhyperrefclass}{m +m m}{% \LWR@htmltag{% a % space - href="\begingroup\@sanitize#1\endgroup" % space - class="#3" % space + href=\textquotedbl\begingroup\@sanitize#1\endgroup\textquotedbl\ % space + class=\textquotedbl#3\textquotedbl\ % space \LWR@addlinktitle % space }\LWR@orignewline% #2% @@ -33330,23 +33479,24 @@ end -- not --version % \changes{v0.18}{2016/05/18}{Suppress extra space.} % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@subinlineimage}[5]{% \ifblank{#1}% {% \LWR@htmltag{img \LWR@indentHTML - src="#3.#4" \LWR@indentHTML - alt="#3" \LWR@indentHTML - style="#5" \LWR@indentHTML - class="#2" \LWR@orignewline + src=\textquotedbl#3.#4\textquotedbl \LWR@indentHTML + alt=\textquotedbl#3\textquotedbl \LWR@indentHTML + style=\textquotedbl#5\textquotedbl \LWR@indentHTML + class=\textquotedbl#2\textquotedbl \LWR@orignewline }% }% {% \LWR@htmltag{img \LWR@indentHTML - src="#3.#4" \LWR@indentHTML - alt="#1" \LWR@indentHTML - style="#5" \LWR@indentHTML - class="#2" \LWR@orignewline + src=\textquotedbl#3.#4\textquotedbl \LWR@indentHTML + alt=\textquotedbl#1\textquotedbl \LWR@indentHTML + style=\textquotedbl#5\textquotedbl \LWR@indentHTML + class=\textquotedbl#2\textquotedbl \LWR@orignewline }% }% } @@ -33449,10 +33599,13 @@ end -- not --version % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add a text frame.} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.56}{2018/05/14}{Adds a \element{class} per \pkg{float} package style.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@htmltag{% - figure id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}" % space - class="#1 \@nameuse{LWR@floatstyle@#1}"% + figure id=\textquotedbl% + \LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}% + \textquotedbl\ % space + class=\textquotedbl#1 \@nameuse{LWR@floatstyle@#1}\textquotedbl% }% \ifbool{FormatWP}{% \LWR@orignewline% @@ -33599,18 +33752,23 @@ end -- not --version % \changes{v0.79}{2019/12/09}{Factored.} % \changes{v0.84}{2020/04/16}{\element{par} handling.} % \changes{v0.88}{2020/07/04}{Inline handling.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@forcenewautoidanchor}{% \addtocounter{LWR@thisautoid}{1}% \ifbool{LWR@doingapar}% {% - \LWR@htmltag{a id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}" }% - \LWR@htmltag{/a }% + \LWR@htmltag{a id=\textquotedbl% + \LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}% + \textquotedbl\ }% space + \LWR@htmltag{/a }% }% {% \LWR@stoppars% - \LWR@htmltag{a id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}" }% - \LWR@htmltag{/a }% + \LWR@htmltag{a id=\textquotedbl% + \LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}% + \textquotedbl\ }% space + \LWR@htmltag{/a }% \LWR@startpars% }% } @@ -35365,7 +35523,7 @@ end -- not --version \LWR@restoreorigaccents% \LWR@restoreoriglists% % - \LWR@FBcancel% + \LWR@hook@processingtags% % \end{macrocode} % % To enable \brand{MathJax}-specific nullification, used for \pkg{tcolorbox}: @@ -35830,7 +35988,7 @@ end -- not --version % % A marker with alpha or opacity of 0\% is not registered by \prog{pdfcrop}, so % the marker is a small square block of 1\% alpha, which seems to work while still being -% effectively invisible in the final SVG image. +% effectively invisible in the final \SVG\ image. % % If \pkg{graphicx} is loaded, this marker is sized as a tiny 1\,sp square. % If \pkg{graphics} is loaded, this marker is used at its default size of around @@ -35935,13 +36093,13 @@ end -- not --version % preferred.) % % \begin{description} -% \item [SVG math:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [SVG math \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [SVG dynamic math:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [Mathjax:] Argument \#4 is the contents of the math expression +% \item [\SVG\ math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\SVG\ math \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\SVG\ dynamic math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\brand{MathJax}:] Argument \#4 is the contents of the math expression % without \cs{LWR@origensuredmath}. This case is handled above. -% \item [Mathjax \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [Mathjax dynamic math:] Argument \#4 is the contents of the math expression +% \item [\brand{MathJax} \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\brand{MathJax} dynamic math:] Argument \#4 is the contents of the math expression % without \cs{LWR@origensuredmath}, so \cs{LWR@origensuredmath} is added below.\ % \item [\cs{ifmmode}:] Included ``just in case''. % \end{description} @@ -36065,7 +36223,7 @@ end -- not --version \newcommand*{\LWR@subsingledollarsvg}[4]{% % \end{macrocode} % Measure the depth, width, and height of the math image: -% \changes{v0.51}{2018/03/04}{Fix: SVG math with enclosed \env{lateximage}.} +% \changes{v0.51}{2018/03/04}{Fix: \SVG\ math with enclosed \env{lateximage}.} % \begin{macrocode} \LWR@singledollarmeasure{#4}% % \end{macrocode} @@ -36217,17 +36375,17 @@ end -- not --version % \marg{4: math expression} % % For inline math. -% Uses MathJax, or for \SVG\ math the image is measured and ajusted to the baseline +% Uses \brand{MathJax}, or for \SVG\ math the image is measured and ajusted to the baseline % of the \HTML\ output, and placed inside a \env{lateximage}. % % \begin{description} -% \item [SVG math:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [SVG math \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [SVG dynamic math:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [Mathjax:] Argument \#4 is the contents of the math expression +% \item [\SVG\ math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\SVG\ math \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\SVG\ dynamic math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\brand{MathJax}:] Argument \#4 is the contents of the math expression % without \cs{LWR@origensuredmath}. This case is handled above. -% \item [Mathjax \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [Mathjax dynamic math:] Argument \#4 is the contents of the math expression +% \item [\brand{MathJax} \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [\brand{MathJax} dynamic math:] Argument \#4 is the contents of the math expression % without \cs{LWR@origensuredmath}, so \cs{LWR@origensuredmath} is added below.\ % \end{description} % @@ -36236,7 +36394,7 @@ end -- not --version % \changes{v0.19}{2016/05/25}{\brand{MathJax} support.} % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} print LaTeX expression.} % \changes{v0.47}{2018/01/24}{Added \SVG\ math image baseline adjust and em sizing.} -% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if MathJax.} +% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if \brand{MathJax}.} % \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} % \begin{macrocode} \newlength{\LWR@singledollarwidth} @@ -36262,14 +36420,14 @@ end -- not --version % \begin{macrocode} \LWR@applyxfakebold% % \end{macrocode} -% MathJax cannot parse the often complicated \TeX\ expressions which +% \brand{MathJax} cannot parse the often complicated \TeX\ expressions which % appear in the various uses of \cs{ensuredmath}. % \cs{ensuremath} forces the \attribute{alt} tag to ``|(math image)|'', as % translated according to \cs{MathImageAltText}. -% If this is the case, force the use of a \env{lateximage} even if MathJax. +% If this is the case, force the use of a \env{lateximage} even if \brand{MathJax}. % Likewise for \pkg{siunitx} if |parse-numbers=false|. % -% If MathJax, or if formatting math for a word processor, and not \cs{ensuredmath}, +% If \brand{MathJax}, or if formatting math for a word processor, and not \cs{ensuredmath}, % and not a dynamic math expression, print the math expression: % \changes{v0.51}{2018/03/11}{Fix: \cs{ensuredmath} inside \SVG\ image.} % \changes{v0.57}{2018/05/23}{Fix: Dynamic inline math expressions.} @@ -36306,7 +36464,7 @@ end -- not --version }% }% mathjax % \end{macrocode} -% For SVG, print the math inside a \env{lateximage}, +% For \SVG, print the math inside a \env{lateximage}, % with an \element{alt} tag of the \LaTeX\ code, % and a \CSS\ style to control the baseline adjustment. % \begin{macrocode} @@ -36383,7 +36541,7 @@ end -- not --version }% mathjax % \end{macrocode} -% For SVG, print the math inside a \env{lateximage}, +% For \SVG, print the math inside a \env{lateximage}, % with an \element{alt} tag of the \LaTeX\ code: % \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} % \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} @@ -36479,14 +36637,14 @@ end -- not --version % \begin{macro}{\@ensuredmath} \marg{expression} % -% If MathJax, a \env{lateximage} is used, since \cs{ensuremath} is -% often used for complex \TeX\ expressions which MathJax may not render. +% If \brand{MathJax}, a \env{lateximage} is used, since \cs{ensuremath} is +% often used for complex \TeX\ expressions which \brand{MathJax} may not render. % If \SVG\ math, a hashed file is used with a simple \attribute{alt} tag, but % additional hashing provided by the contents. % % \changes{v0.51}{2018/02/24}{Hashes \cs{ensuremath}.} % \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.} -% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if MathJax.} +% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if \brand{MathJax}.} % \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} % \changes{v0.52}{2018/03/25}{Improved hashing expansion.} % \begin{macrocode} @@ -36854,7 +37012,7 @@ end -- not --version \LWR@hidelatexequation{#2}{#1} } % \end{macrocode} -% SVG output: +% \SVG\ output: % Create the |lateximage| along with an \HTML\ \element{alt} tag % having an equation number, the \LaTeX{} equation environment % commands, and the contents of the environment's \cs{BODY}. @@ -37064,7 +37222,7 @@ end -- not --version % \begin{macro}{\displaymathother} Use when display math environments have complicated -% objects which will not work with MathJax or should not be +% objects which will not work with \brand{MathJax} or should not be % included in \HTML\ \attribute{alt} tags. \margintag{complicated math objects} % Complicated contents are more likely to compile correctly. % \changes{v0.51}{2018/03/21}{Processing for complicated display math.} @@ -37756,10 +37914,13 @@ end -- not --version % Create an \HTML\ span which will hold the comment which contains the \prog{pdftotext} translation % of the image's page, and also will hold the link to the |.svg| file: % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@htmltag{span\LWR@indentHTML% - id="lateximage-\BaseJobname-\arabic{LWR@lateximagenumber}"\LWR@indentHTML - class="lateximagesource"\LWR@orignewline + id=\textquotedbl{}% + lateximage-\BaseJobname-\arabic{LWR@lateximagenumber}% + \textquotedbl\LWR@indentHTML + class=\textquotedbl{}lateximagesource\textquotedbl\LWR@orignewline }% % \end{macrocode} % Write instructions to the |.txt| file: @@ -37865,13 +38026,14 @@ end -- not --version % \end{macrocode} % % Enable print-mode math functions: -% \changes{v0.50}{2018/02/20}{Fix: SVG math in a section name.} +% \changes{v0.50}{2018/02/20}{Fix: \SVG\ math in a section name.} % \begin{macrocode} \LetLtxMacro$\LWR@origdollar% \catcode`\$=3% math shift \LetLtxMacro\(\LWR@origopenparen% \LetLtxMacro\)\LWR@origcloseparen% % \end{macrocode} +% % Only enable print-mode display math if are not already inside display math: % \changes{v0.51}{2018/03/21}{Processing for complicated display math.} % \begin{macrocode} @@ -37884,6 +38046,7 @@ end -- not --version \csletcs{endequation*}{LWR@origendequation*}% }% not in display math % \end{macrocode} +% % For \pkg{chemformula}: % \begin{macrocode} \LetLtxMacro\LWR@newsingledollar$% @@ -37896,20 +38059,20 @@ end -- not --version % \end{macrocode} % % -% -% -% When the environment closes: +% When the \env{lateximage} environment closes: % \margintag{\cs{endlateximage}} % % \begin{macrocode} {% start of \end{lateximage} \LWR@traceinfo{lateximage: starting end of lateximage}% % \end{macrocode} +% % Nested more than one deep? % \begin{macrocode} \LWR@traceinfo{lateximage: internal depth was \arabic{LWR@lateximagedepth}}% \ifnumcomp{\value{LWR@lateximagedepth}}{>}{1}% % \end{macrocode} +% % If nesting inside an already existing lateximage, simply record one less level. % Uses a lower-level \TeX\ macro due to \AmS\ \cs{text} change of \cs{addtocounter}. % \begin{macrocode} @@ -37918,10 +38081,12 @@ end -- not --version \global\advance\c@LWR@lateximagedepth -1\relax% }% % \end{macrocode} +% % If this is the outer-most lateximage: % \begin{macrocode} {% end of outer-most lateximage % \end{macrocode} +% % Finish the lateximage minipage and start a new \PDF\ page: % \changes{v0.69}{2019/03/14}{Fix for \prog{pdftotext} errors from font size change.} % \begin{macrocode} @@ -37929,12 +38094,14 @@ end -- not --version \endLWR@print@minipage% \LWR@maybe@orignewpage% % \end{macrocode} +% % Close the \HTML\ comment which encapsulated any traces of the lateximage picked up by \prog{pdftotext}: % \begin{macrocode} \LWR@print@vspace*{.5\baselineskip}% \LWR@htmlclosecomment% \LWR@traceinfo{lateximage: The page after the image is \arabic{page}}% % \end{macrocode} +% % Create a link to the lateximage, allowing its natural height: % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.50}{2018/02/22}{MD5 hash avoids duplicate \SVG\ math.} @@ -37948,10 +38115,12 @@ end -- not --version \LWR@lateximage@oneimage{#2}{\LWR@ImagesName\theLWR@externalfilecnt}{#5}{#3}% }% no hash % \end{macrocode} +% % Be sure that are doing a paragraph: % \begin{macrocode} \LWR@ensuredoingapar% % \end{macrocode} +% % Close the \HTML\ span which has the \prog{pdftotext} comment and also the link to the |.svg| image: % \begin{macrocode} \LWR@htmltag{/span}% @@ -37959,11 +38128,13 @@ end -- not --version \LWR@htmlcomment{End of lateximage}% }{}% % \end{macrocode} +% % Undo one lateximage level. % This is not inside an \AmS\ \cs{text}, so regular \cs{addtocounter} may be used here. % \begin{macrocode} \addtocounter{LWR@lateximagedepth}{-1}% % \end{macrocode} +% % Clear the single-use \attribute{alt} text: % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \begin{macrocode} @@ -38907,13 +39078,16 @@ end -- not --version % If |FormatWP|, add a text frame: % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add a text frame.} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \ifbool{FormatWP}{% \addtocounter{LWR@thisautoidWP}{1}% \LWR@htmltag{% - div id="\LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}" % - class="wpminipage"% + div id=\textquotedbl% + \LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}% + \textquotedbl\ % space + class=\textquotedbl{}wpminipage\textquotedbl% }% }{}% @@ -38921,9 +39095,10 @@ end -- not --version % % Create the \element{div} tag with optional alignment style: % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@traceinfo{minipage: creating div class}% -\LWR@htmltag{div class="minipage" style="% +\LWR@htmltag{div class=\textquotedbl{}minipage\textquotedbl\ style=\textquotedbl% \ifthenelse{\equal{#1}{t}}{\LWR@print@mbox{vertical-align:bottom} ; }{}% \ifthenelse{\equal{#1}{c}}{\LWR@print@mbox{vertical-align:middle} ; }{}% \ifthenelse{\equal{#1}{b}}{\LWR@print@mbox{vertical-align:top} ; }{}% @@ -38950,7 +39125,8 @@ end -- not --version }% \LWR@traceinfo{minipage: about to print the height}% \ifblank{#2}{}{height:\LWR@printlength{\LWR@minipageheight} ; }% -"}% +\textquotedbl% +}% % \end{macrocode} % % Finish with an empty line to start the contents on a new line. @@ -40511,11 +40687,12 @@ color:\LWR@origpound\LWR@tempcolor% }% % \end{macrocode} % Print the span with the converted width. Not rounded. +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} {% \LWR@htmltagc{% - span style="width:\LWR@printlength{\LWR@tempwidth}; % extra space - display:inline-block"% + span style=\textquotedbl{}width:\LWR@printlength{\LWR@tempwidth}; % extra space + display:inline-block\textquotedbl% }% % \end{macrocode} % If formatting for a word processor, approximate with a number of \cs{quad}s, @@ -40698,11 +40875,12 @@ color:\LWR@origpound\LWR@tempcolor% % less than 1pt is quite common in \LaTeX\ code. % \changes{v0.57}{2018/06/02}{Fix: Colored rules.} % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@findcurrenttextcolor% \LWR@htmltagc{% span\LWR@indentHTML% - style="% + style=\textquotedbl% % \end{macrocode} % The \HTML\ background color is used to draw the filled rule according % to the \LaTeX\ foreground color set by \cs{textcolor}. @@ -40737,8 +40915,9 @@ color:\LWR@origpound\LWR@tempcolor% }% % \end{macrocode} % Display inline-block to place the span inline with the text: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - display:inline-block;"\LWR@orignewline% + display:inline-block;\textquotedbl\LWR@orignewline% }% % \end{macrocode} % If formatting for a word processor, approximate with a number of underscores, @@ -41432,7 +41611,7 @@ color:\LWR@origpound\LWR@tempcolor% \typeout{Package lwarp:} \typeout{If the error} \typeout{\space\space``! Undefined control sequence. - \space ... \space \protect\@begindocumenthook''} + \space ... \space \protect\__hook begindocument''} \typeout{occurs here, use the polyglossia macro:} \typeout{\space\space\protect\setmainlanguage\protect{...\protect}} \typeout{---} @@ -41486,13 +41665,15 @@ color:\LWR@origpound\LWR@tempcolor% % To be done \cs{AtBeginDocument}. % % \changes{v0.894}{2020/12/22}{Warn if using packages not supported by \brand{MathJax}.} +% \changes{v0.895}{2021/01/08}{Improved \brand{MathJax} warning.} % \begin{macrocode} \newcommand*{\LWR@nomathjaxwarn}[2]{% \@ifpackageloaded{lwarp-#1}{% \ifblank{#2}{% \PackageWarningNoLine{lwarp} {% - Lwarp does not provide MathJax support for #1% + Lwarp does not provide MathJax support for #1.\MessageBreak + Use SVG math by removing the Lwarp mathjax option% } }{% \PackageWarningNoLine{lwarp} @@ -41506,7 +41687,8 @@ color:\LWR@origpound\LWR@tempcolor% % \end{macrocode} % % \begin{macro}{\LWR@forceSVGmessage} \marg{packagename} -% \changes{v0.894}{2020/12/22}{Improved MathJax warnings.} +% \changes{v0.894}{2020/12/22}{Improved \brand{MathJax} warnings.} +% \changes{v0.895}{2021/01/08}{Improved \brand{MathJax} warning.} % \begin{macrocode} \newcommand*{\LWR@forceSVGmessage}[1]{% SVG math output may be enabled for select math\MessageBreak @@ -41517,23 +41699,34 @@ color:\LWR@origpound\LWR@tempcolor% afterward to resume using MathJax math.\MessageBreak Before display math, use \protect\displaymathother\MessageBreak to begin using SVG math, and use \protect\displaymathnormal\MessageBreak - after to resume using MathJax for the following math% + after to resume using MathJax for the following math.\MessageBreak + Or, use SVG math for all expressions by removing\MessageBreak + the mathjax option for the lwarp package% } % \end{macrocode} % \end{macro} % +% % ^^A *mathjax warnings % % If \brand{MathJax} is being used, issue a warning for certain packages. -% \changes{v0.894}{2020/12/22}{Improved MathJax warnings.} +% \changes{v0.894}{2020/12/22}{Improved \brand{MathJax} warnings.} +% \changes{v0.895}{2021/02/06}{Added \brand{MathJax} warnings for +% \pkg{aligned-overset}, \pkg{autoaligne}, \pkg{boldtensors}, +% \pkg{liberitinust1math}, \pkg{tensind}.} +% \changes{v0.895}{2021/02/06}{Improved \brand{MathJax} warning for \pkg{unicode-math}.} % \begin{macrocode} \AtBeginDocument{ \ifbool{mathjax}{ + \LWR@nomathjaxwarn{aligned-overset}{} + \LWR@nomathjaxwarn{amscdx} + {\LWR@forceSVGmessage{amscdx}} \LWR@mathjaxwarn{arydshln} {In a math array, do not use the optional argument\MessageBreak for \protect\cdashline.\space\space Furthermore, \protect\cline\space is not\MessageBreak supported by MathJax} + \LWR@nomathjaxwarn{autoaligne}{} \LWR@mathjaxwarn{autonum} {MathJax does not support equation+.\MessageBreak You may use the warpprint and warpHTML\MessageBreak @@ -41541,6 +41734,7 @@ color:\LWR@origpound\LWR@tempcolor% and the equation+ environments} \LWR@mathjaxwarn{bigdelim} {Delimiters appear only of the first line} + \LWR@nomathjaxwarn{boldtensors}{} \LWR@mathjaxwarn{booktabs} {\protect\cmidrule\space is not displayed} \LWR@mathjaxwarn{breqn} @@ -41555,8 +41749,18 @@ color:\LWR@origpound\LWR@tempcolor% {\LWR@forceSVGmessage{gauss}} \LWR@mathjaxwarn{hhline} {A simple \protect\hline\space is used} + \LWR@mathjaxwarn{isomath} + {Some of the symbol font macros such as \protect\mathsfbfit\MessageBreak + do not use a sans font because MathJax does not yet\MessageBreak + have sans Greek. Tensors may look like vectors% + } \LWR@nomathjaxwarn{jkmath} {\LWR@forceSVGmessage{jkmath}} + \LWR@mathjaxwarn{libertinust1math} + {Some of the symbol font macros such as \protect\mathsfbfit\MessageBreak + do not use a sans font because MathJax does not yet\MessageBreak + have sans Greek. Tensors may look like vectors% + } \LWR@mathjaxwarn{mathtools} {See the Lwarp manual regarding the disallowspaces\MessageBreak and showonlyrefs options, the alignat environment,\MessageBreak @@ -41581,13 +41785,15 @@ color:\LWR@origpound\LWR@tempcolor% % % {The third-party extension is not used.\MessageBreak % {The MathJax v3 extension is used.\MessageBreak % See the Lwarp manual for details} + \LWR@nomathjaxwarn{tensind}{} \LWR@mathjaxwarn{unicode-math} {Do not use embedded Unicode characters.\MessageBreak - Not all characters are encoded correctly.\MessageBreak - \protect\left\space and \protect\right\space may not work.\MessageBreak + (Not all characters are encoded correctly.)\MessageBreak Some symbol fonts are not supported by MathJax,\MessageBreak and are only approximated.\MessageBreak - Latin characters may not be correct} + Greek macros such as \protect\alpha\space respond to the math-style\MessageBreak + option. Latin symbols does not, per MathJax\MessageBreak + limitations, unless placed inside \protect\symbit\space or similar} \LWR@nomathjaxwarn{unitsdef}{} \LWR@mathjaxwarn{witharrows} {Arrows can only point to the next line.\MessageBreak @@ -42214,7 +42420,18 @@ color:\LWR@origpound\LWR@tempcolor% \LWR@DeclareAcronym } % \end{macrocode} - +% +% +% Replace dot fill with simple dots: +% \changes{v0.895}{2021/01/20}{\pkg{acro}: Updated to v3.5.} +% \begin{macrocode} +\ExplSyntaxOn +\cs_new_protected:Npn \LWR@HTML@acro_dot_fill: {\dots\space} +\LWR@formatted{acro_dot_fill:} +\ExplSyntaxOff +% \end{macrocode} +% +% % Modified to activate the current font: % \changes{v0.76}{2019/10/07}{\pkg{acro}: Updated for v2.10.} % \begin{macrocode} @@ -42827,6 +43044,7 @@ color:\LWR@origpound\LWR@tempcolor% % % \changes{v0.42}{2017/10/27}{\pkg{algorithmicx}: If \progcode{FormatWP} add \cs{quad}s.} % \changes{v0.44}{2017/11/16}{\pkg{algorithmicx}: Improved comment symbol.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % % \begin{macrocode} \AtBeginEnvironment{algorithmic}{% @@ -42836,7 +43054,9 @@ color:\LWR@origpound\LWR@tempcolor% \renewcommand*{\ALG@doentity}{% \origALG@doentity% \LWR@htmltagc{% -span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% + span style=\textquotedbl{}% + width:\LWR@printlength{\ALG@thistlm}; display:inline-block;% + \textquotedbl% }% \ifbool{FormatWP}{% \setlength{\LWR@templengthone}{\the\ALG@thistlm}% @@ -42926,6 +43146,53 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % +% \iffalse +%<*amscdx> +% \fi +% +% \part{lwarp-amscdx.sty} +% +% \section{amscdx} +% +% \credits{Martin Vermeer} +% +% \DescribePackage{amscdx} +% \pkg{amscdx} is used as-is for \SVG\ math. +% +% For \brand{MathJax}, a warning notes that the \env{CD} environment +% \trouble[\brand{MathJax}]{amscdx=\pkg{amscdx}} +% must be enclosed between \cs{displaymathother} and \cs{displaymathnormal}. +% +% \changes{v0.895}{2021/01/08}{\pkg{amscdx}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{amscdx}[2019/07/02] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{% + \renewenvironment{CD} + {\text{(Use \unicode{x005C}displaymathother before the CD enviroment.) \quad}} + {\quad \text{(Use \unicode{x005C}displaymathnormal after the CD enviroment.)}} +} + +\CustomizeMathJax{\newcommand{\CDfattrue}{}} +\CustomizeMathJax{\newcommand{\CDfatfalse}{}} +\CustomizeMathJax{\newcommand{\CDashtrue}{}} +\CustomizeMathJax{\newcommand{\CDashfalse}{}} +\CustomizeMathJax{\newcommand{\CDlor}[1]{}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % % \iffalse %<*amsmath> @@ -43213,9 +43480,20 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % For \brand{MathJax}: % \changes{v0.79}{2020/01/27}{\pkg{amsmath}: Added \brand{MathJax} emulation.} % \changes{v0.82}{2020/03/14}{\pkg{amsmath}: Fixed: \cs{intertext} for \brand{MathJax}.} +% \changes{v0.895}{2021/02/11}{\pkg{amsmath}: Added \cs{Hat}, etc..} % \begin{macrocode} \begin{warpMathJax} \CustomizeMathJax{\newcommand{\intertext}[1]{\text{#1}\notag \\}} +\CustomizeMathJax{\let\Hat\hat} +\CustomizeMathJax{\let\Check\check} +\CustomizeMathJax{\let\Tilde\tilde} +\CustomizeMathJax{\let\Acute\acute} +\CustomizeMathJax{\let\Grave\grave} +\CustomizeMathJax{\let\Dot\dot} +\CustomizeMathJax{\let\Ddot\ddot} +\CustomizeMathJax{\let\Breve\breve} +\CustomizeMathJax{\let\Bar\bar} +\CustomizeMathJax{\let\Vec\vec} \end{warpMathJax} % \end{macrocode} % @@ -44680,7 +44958,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \renewenvironment{bnf*}{\csuse{eqnarray*}}{\csuse{endeqnarray*}} % \end{macrocode} % -% ^^A % For HTML without SVG images, but also without equation numbering: +% ^^A % For HTML without \SVG\ images, but also without equation numbering: % ^^A % % ^^A % A purely \HTML\ text output is generated, without math images. % ^^A % @@ -46400,7 +46678,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \section{cancel} % % \DescribePackage{cancel} -% \pkg{cancel} is used as-is for SVG math, and emulated for \HTML\ text output. +% \pkg{cancel} is used as-is for \SVG\ math, and emulated for \HTML\ text output. % % \changes{v0.44}{2017/11/16}{\pkg{cancel}: Added.} % \changes{v0.87}{2020/06/02}{\pkg{cancel}: Now uses \brand{MathJax} v3 extension.} @@ -47123,13 +47401,18 @@ s% % \DescribePackage{changes} % \pkg{changes} is patched for use by \pkg{lwarp}. % +% Use \optn{commandnameprefix=ifneeded} to avoid a conflict with the \cs{comment} +% \trouble[\cs{comment}]{changes=\pkg{changes}} +% command when using \pkg{lwarp}. +% % \changes{v0.67}{2019/02/15}{\pkg{changes}: Added.} % \changes{v0.70}{2019/03/24}{\pkg{changes}: Updated to v3.1.2.} +% \changes{v0.895}{2021/01/30}{\pkg{changes}: Updated to v4.0.1.} % % \codehtml % % \begin{macrocode} -\LWR@ProvidesPackagePass{changes}[2019/01/26] +\LWR@ProvidesPackagePass{changes}[2021/02/14] % \end{macrocode} % % \cs{BaseJobname} is added to the label in case \pkg{xr} or \pkg{xr-hyper} are used. @@ -47137,7 +47420,7 @@ s% % \changes{v0.72}{2019/06/05}{\pkg{changes}: Fix references for \pkg{xr}, \pkg{xr-hyper}.} % \begin{macrocode} \renewcommand{\ChangesListline}[4]{% - \IfSubStr{\Changes@loc@show}{#1}{% + \IfIsInList{#1}{\Changes@loc@show}{% \LWR@startpars% #2: #3 \qquad \nameref{\BaseJobname-autopage-#4}% @@ -47145,112 +47428,255 @@ s% }{}% } -\renewcommand{\Changes@summaryline}[4]{% - \IfSubStr{\Changes@loc@show}{#1}{% - \ifthenelse{\not\equal{\Changes@loc@style}{compactsummary} \or #2 > 0}% - {% - #3:~#2#4% - }{}% - }{}% +\renewcommand{\listofchanges}[1][\@empty]{% +\setkeys{Changes@loc}{#1}% +\ifbool{Changes@optiondraft}% +{% +\IfIsInList{\Changes@loc@style}{list|summary|compactsummary}% +{}% +{% +\PackageWarning{changes}{Wrong style for list of changes: '\Changes@loc@style', using 'list' instead.}% +\def\Changes@loc@style{}% +}% +\IfIsEmpty{\Changes@loc@style}% +{\def\Changes@loc@style{list}}% +{}% +\IfStrEq{\Changes@loc@show}{all}% +{\def\Changes@loc@show{added|deleted|replaced|highlight|comment}}% +{}% +\IfIsInList{\Changes@loc@show}{added|deleted|replaced|highlight|comment}% +{}% +{% +\PackageWarning{changes}{Wrong show-value for list of changes: '\Changes@loc@show', using 'all' instead.}% +\def\Changes@loc@show{}% +}% +\IfIsEmpty{\Changes@loc@show}% +{\def\Changes@loc@show{added|deleted|replaced|highlight|comment}}% +{}% +\IfIsEmpty{\Changes@loc@title}% +{% +\IfStrEq{\Changes@loc@style}{list}% +{\def\Changes@heading{\listofchangesname}}{}% +\IfStrEq{\Changes@loc@style}{summary}% +{\def\Changes@heading{\summaryofchangesname}}{}% +\IfStrEq{\Changes@loc@style}{compactsummary}% +{\def\Changes@heading{\compactsummaryofchangesname}}{}% +}% +{\def\Changes@heading{\Changes@loc@title}}% +\section*{\Changes@heading} +\IfIsInList{\Changes@loc@style}{list}% +{% +\IfFileExists{\jobname.\Changes@locextension}% +{% +\newread\Changes@InFile% +\openin\Changes@InFile=\jobname.\Changes@locextension% +\loop\unless\ifeof\Changes@InFile% +\read\Changes@InFile to \Changes@Line% +\ifeof\Changes@InFile\else% +\Changes@Line% +\fi +\repeat +\closein\Changes@InFile% +}{% +\emph{\changesnoloc}% +\PackageWarning{changes}{LaTeX rerun needed for list of changes}% +}% +}{}% +\IfIsInList{\Changes@loc@style}{summary|compactsummary}% +{% +\IfFileExists{\jobname.\Changes@socextension}% +{% +\newread\Changes@InFile% +\openin\Changes@InFile = \jobname.\Changes@socextension% +\loop\unless\ifeof\Changes@InFile% +\read\Changes@InFile to \Changes@Line% +\ifeof\Changes@InFile\else% +\expandafter\changes@chopline\Changes@Line\\% +\textbf{% +\IfIsColored% +{\color{\Changes@Incolor}}% +{}% +\IfIsAnonymous{\Changes@Inid}% +{% + \LWR@textcurrentcolor{% lwarp + \changesauthorname: \changesanonymousname% + }% lwarp +}% +{% + \LWR@textcurrentcolor{% lwarp +\changesauthorname: \Changes@Inid% + }% lwarp +\IfIsEmpty{\Changes@Inname}% +{}% +{ % + \LWR@textcurrentcolor{% lwarp +(\Changes@Inname)% + }% lwarp +}% +}% +}\\% +\numdef{\Changes@InSum}{0}% +\renewcommand*{\do}[1]{% +\numdef{\Changes@InSum}{\Changes@InSum + \csuse{Changes@In########1}}% +}% +\expandafter\dopsvlist\expandafter{\Changes@loc@show}% +\ifnumcomp{\Changes@InSum}{=}{0}% +{% +% \parbox{\Changes@summary@width}{% lwarp + \changesnochanges% +% }% lwarp +% \\[1ex]% lwarp + \par% \lwarp +}% +{% +\numdef{\Changes@InCount}{0}% +\renewcommand*{\do}[1]{% +\numdef{\Changes@InCount}{\Changes@InCount + \csuse{Changes@In########1}}% +\ifboolexpr{% +not test {\IfStrEq{\Changes@loc@style}{compactsummary}} or% +test {\ifnumgreater{\csuse{Changes@In########1}}{0}}% +}% +{% +% \parbox{\Changes@summary@width}{% lwarp +\csuse{changes########1name}~% +% \let\cleaders\leaders\dotfill~% lwarp +\dotfill~% \lwarp +\csuse{Changes@In########1}% +% }% lwarp +% \ifnumless{\Changes@InCount}{\Changes@InSum}% lwarp +{\\}% +% {\\[1ex]}% lwarp +}% +{}% +}% +\expandafter\dopsvlist\expandafter{\Changes@loc@show}% + \par% lwarp +}% +\fi% +\repeat +\closein\Changes@InFile% +}{% +\emph{\changesnosoc}% +\PackageWarning{changes}{LaTeX rerun needed for summary of changes}% +}% +}{}% +}{}% } -\xpatchcmd{\listofchanges} - {{\changesauthorname: \changesanonymousname}} - {{\LWR@textcurrentcolor{\changesauthorname: \changesanonymousname}}} - {} - {\LWR@patcherror{changes}{listofchanges A}} - -\xpatchcmd{\listofchanges} - {\changesauthorname: \Changes@InID} - {\LWR@textcurrentcolor{\changesauthorname: \Changes@InID}} - {} - {\LWR@patcherror{changes}{listofchanges B}} - -\xpatchcmd{\listofchanges} - {(\Changes@InName)} - {\LWR@textcurrentcolor{(\Changes@InName)}} - {} - {\LWR@patcherror{changes}{listofchanges C}} - -\xpatchcmd{\listofchanges} - {\parbox{\Changes@summary@width}} - {} - {} - {\LWR@patcherror{changes}{listofchanges D}} -\xpatchcmd{\Changes@Markup@comment} - {% - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - } - {% - \LWR@textcurrentcolor{% lwarp - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - }% lwarp - } - {} - {\LWR@patcherror{changes}{\Changes@Markup@comment A}} - -\xpatchcmd{\Changes@Markup@comment} - {% - \uwave{% - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - }% - } - {% - \LWR@textcurrentcolor{% lwarp - \uwave{% - \ifthenelse{\isAnonymous{#2}}% - {\textbf{[\arabic{Changes@commentCount#2}]:} }% - {\textbf{[#3~\arabic{Changes@commentCount#2}]:} }% - #1% - }% - }% lwarp - } - {} - {\LWR@patcherror{changes}{\Changes@Markup@comment B}} - -\xpatchcmd{\Changes@output} - {\Changes@Markup@author{\Changes@output@author{#2}{left}}} - {\LWR@textcurrentcolor{\Changes@Markup@author{\Changes@output@author{#2}{left}}}} - {} - {\LWR@patcherror{changes}{Changes@output A}} - -\xpatchcmd{\Changes@output} - {% - \ifthenelse{\equal{#1}{added}}{\Changes@Markup@added{#3}}{}% - \ifthenelse{\equal{#1}{deleted}}{\Changes@Markup@deleted{#4}}{}% - \ifthenelse{\equal{#1}{replaced}}{% - {\Changes@Markup@added{#3}}\allowbreak\Changes@Markup@deleted{#4}% - }{}% - \ifthenelse{\equal{#1}{highlight}}{\Changes@Markup@highlight{#3}}{}% - } - {% - \LWR@textcurrentcolor{% - \ifthenelse{\equal{#1}{added}}{\Changes@Markup@added{#3}}{}% - \ifthenelse{\equal{#1}{deleted}}{\Changes@Markup@deleted{#4}}{}% - \ifthenelse{\equal{#1}{replaced}}{% - {\Changes@Markup@added{#3}}\allowbreak\Changes@Markup@deleted{#4}% - }{}% - \ifthenelse{\equal{#1}{highlight}}{\Changes@Markup@highlight{#3}}{}% - }% - } - {} - {\LWR@patcherror{changes}{Changes@output B}} +\renewcommand{\Changes@Markup@comment}[3]{% +\IfStrEq{\Changes@optioncommentmarkup}{todo}% +{% +\IfIsColored% +{\colorlet{Changes@todocolor}{authorcolor}}% +{\colorlet{Changes@todocolor}{black}}% +\todo[color=Changes@todocolor!10, bordercolor=Changes@todocolor, linecolor=Changes@todocolor!70, nolist]{\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{authorcommentcount}]} #1}% +}{}% +\IfStrEq{\Changes@optioncommentmarkup}{margin}% +{% +\marginpar{% +\IfIsColored% +{\leavevmode\color{authorcolor}}% +{}% + \LWR@textcurrentcolor{% lwarp +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% + }% lwarp +}% +}{}% +\IfStrEq{\Changes@optioncommentmarkup}{footnote}% +{% +\footnote{% + \LWR@textcurrentcolor{% lwarp +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% + }% lwarp +}% +}{}% +\IfStrEq{\Changes@optioncommentmarkup}{uwave}% +{% +{% +\IfIsColored% +{\color{authorcolor}}% +{}% +\allowbreak% +\uwave{% +\textbf{[\IfIsAnonymous{#2}{}{#3~}\arabic{Changes@commentCount#2}]:} #1% +}% +}% +}{}% +} -\xpatchcmd{\Changes@output} - {\Changes@Markup@author{\Changes@output@author{#2}{right}}} - {\LWR@textcurrentcolor{\Changes@Markup@author{\Changes@output@author{#2}{right}}}} - {} - {\LWR@patcherror{changes}{Changes@output C}} +\renewrobustcmd{\Changes@output}[7]{% +\ifbool{Changes@optiondraft}% +{% +\Changes@check@author{#2}% +\Changes@set@color{#2}% +{% +\IfIsInList{#1}{added|deleted|replaced|highlight}% +{% +\IfIsEmpty{#5}% +{% +\IfIsAuthorEmptyAtPosition{#2}{left}% +{}% +{{% +\IfIsColored% +{\color{authorcolor}}% +{}% + \LWR@textcurrentcolor{% lwarp +\Changes@Markup@author{\Changes@output@author{#2}{left}}% + }% lwarp +}}% +}{}% +{% +\IfStrEq{#1}{highlight}% +{}{% +\IfIsColored% +{\color{authorcolor}}% +{}% +}% + \LWR@textcurrentcolor{% lwarp +\IfStrEq{#1}{added}{\Changes@Markup@added{#3}}{}% +\IfStrEq{#1}{deleted}{\Changes@Markup@deleted{#4}}{}% +\IfStrEq{#1}{replaced}{{\Changes@Markup@added{#3}}\allowbreak\Changes@Markup@deleted{#4}}{}% +\IfStrEq{#1}{highlight}{\Changes@Markup@highlight{#3}}{}% + }% lwarp +}% +\IfIsEmpty{#5}% +{% +\IfIsAuthorEmptyAtPosition{#2}{right}% +{}% +{{% +\IfIsColored% +{\color{authorcolor}}% +{}% + \LWR@textcurrentcolor{% lwarp +\Changes@Markup@author{\Changes@output@author{#2}{right}}% + }% lwarp +}}% +}{}% +\stepcounter{Changes@#1Count#2}% +}{}% +\IfIsEmpty{#5}% +{}% +{% +\stepcounter{Changes@commentCount#2}% +\Changes@set@commentcount{#2}% +\Changes@Markup@comment% +{#5}% +{#2}% +{\Changes@output@author{#2}{left}\Changes@output@author{#2}{right}}% +}% +}% +\IfIsEmpty{#2}% +{\def\Changes@locid{}}% +{\def\Changes@locid{~(#2)}}% +\addtocontents{\Changes@locextension}{\protect\ChangesListline{#1}{#6\Changes@locid}{#7}{\thepage}}% +}% +{% +\IfIsEmpty{#3}% +{\@bsphack\@esphack}% +{#3}% +}% +} % \end{macrocode} % % \iffalse @@ -47481,7 +47907,7 @@ s% % \end{macrocode} % % \begin{noindmacro}{\ch} -% Enclose in an inline \SVG\ image or MathJax. +% Enclose in an inline \SVG\ image or \brand{MathJax}. % The \attribute{alt} tag is is the contents of the \cs{ch} expression. % The filename is hashed, and also has additional hashing information based on % the local options. @@ -47864,7 +48290,7 @@ s% \LWR@ProvidesPackagePass{chemmacros}[2017/08/28] % \end{macrocode} % -% SVG file hashing assumes that the relevent options are constant for the entire document. +% \SVG\ file hashing assumes that the relevent options are constant for the entire document. % % \subsection{Changes to the user's document} % @@ -51808,6 +52234,45 @@ name = \chemmacros_translate:n {scheme-name} % % % +% \iffalse +%<*epsf> +% \fi +% +% \part{lwarp-epsf.sty} +% +% \section{epsf} +% +% \credits{Tom Rokicki} +% +% \DescribePackage{epsf} +% \pkg{epsf} is patched for use by \pkg{lwarp}. +% +% \changes{v0.895}{2019/01/19}{\pkg{epsf}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{epsf}% not date given +% \end{macrocode} +% +% \begin{macrocode} +\xpretocmd{\epsfsetgraph} + {\begin{lateximage}} + {} + {\LWR@patcherror{lwarp-epsf}{epsfsetgraph-begin}} + +\xapptocmd{\epsfsetgraph} + {\end{lateximage}} + {} + {\LWR@patcherror{lwarp-epsf}{epsfsetgraph-end}} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % % \iffalse %<*epsfig> @@ -51824,11 +52289,12 @@ name = \chemmacros_translate:n {scheme-name} % \watchout % % \changes{v0.61}{2018/10/01}{\pkg{epsfig}: Added.} +% \changes{v0.895}{2021/01/17}{\pkg{epsfig}: Supports \env{lateximage}.} % % \codehtml % % \begin{macrocode} -\LWR@ProvidesPackageDrop{epsfig}[2017/06/25] +\LWR@ProvidesPackagePass{epsfig}[2017/06/25] % \end{macrocode} % % A few additional keys to capture the filename: @@ -51850,9 +52316,11 @@ name = \chemmacros_translate:n {scheme-name} % % The captured filename is used as the argument to \cs{includegraphics}: % \begin{macrocode} -\newcommand{\epsfig}[1]{\includegraphics[#1]{\LWR@epsfig@filename}} +\newcommand{\LWR@HTML@epsfig}[1]{\includegraphics[#1]{\LWR@epsfig@filename}} +\LWR@formatted{epsfig} -\newcommand{\psfig}[1]{\includegraphics[#1]{\LWR@epsfig@filename}} +\newcommand{\LWR@HTML@psfig}[1]{\includegraphics[#1]{\LWR@epsfig@filename}} +\LWR@formatted{psfig} % \end{macrocode} % % \iffalse @@ -52911,19 +53379,20 @@ name = \chemmacros_translate:n {scheme-name} % \changes{v0.20}{2017/01/11}{\pkg{fancyhdr}: Added.} % \changes{v0.33}{2017/06/18}{\pkg{fancyhdr}: Fix: Optional args for \cs{lhead}, etc.} % \changes{v0.66}{2019/02/02}{\pkg{fancyhdr}: Updated to v3.10.} +% \changes{v0.895}{2020/01/05}{\pkg{fancyhdr}: Updated to v4.0.} % % \codehtml % % Discard all options for \pkg{lwarp-fancyhdr}: % \begin{macrocode} -\LWR@ProvidesPackageDrop{fancyhdr}[2019/01/31] +\LWR@ProvidesPackageDrop{fancyhdr}[2021/01/04] % \end{macrocode} % \begin{macrocode} \newcommand*{\fancyhead}[2][]{} \newcommand*{\fancyfoot}[2][]{} \newcommand*{\fancyhf}[2][]{} -\newcommand*{\fancypagestyle}[2]{} + \newcommand*{\lhead}[2][]{} \newcommand*{\chead}[2][]{} \newcommand*{\rhead}[2][]{} @@ -52932,16 +53401,30 @@ name = \chemmacros_translate:n {scheme-name} \newcommand*{\rfoot}[2][]{} \newcommand*{\headrulewidth}{} \newcommand*{\footrulewidth}{} +\providecommand{\headruleskip}{0pt} +\providecommand{\footruleskip}{0pt} +\newcommand{\plainheadrulewidth}{0pt} +\newcommand{\plainfootrulewidth}{0pt} +\def\fancyplain#1#2{#1} \newcommand*{\headrule}{} \newcommand*{\footrule}{} \newlength{\headwidth} +\newcommand*{\fancycenter}[1][1em]{} \newcommand*{\fancyheadoffset}[2][]{} \newcommand*{\fancyfootoffset}[2][]{} \newcommand*{\fancyhfoffset}[2][]{} +\newcommand{\fancyheadinit}[1]{} +\newcommand{\fancyfootinit}[1]{} +\newcommand{\fancyhfinit}[1]{} \newcommand*{\iffloatpage}[2]{#2} \newcommand*{\ifftopfloat}[2]{#2} \newcommand*{\iffbotfloat}[2]{#2} \newcommand*{\iffootnote}[2]{#2} + +\newcommand{\fancypagestyle}[1]{% + \@ifnextchar[{\f@nch@pagestyle{#1}}{\f@nch@pagestyle{#1}[]}% +} +\long\def\f@nch@pagestyle#1[#2]#3{} % \end{macrocode} % \iffalse @@ -53189,6 +53672,7 @@ name = \chemmacros_translate:n {scheme-name} % start and end of the environment, depending on the choice of |frame|. % Original code is from the \pkg{fancyvrb} package. % \changes{v0.73}{2019/06/26}{\pkg{fancyvrb}: Fix: Nested \element{div}/\element{pre}.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@fvstartnone}{% \LWR@traceinfo{fvstartnone}% @@ -53199,8 +53683,8 @@ name = \chemmacros_translate:n {scheme-name} \ifx\FV@LabelBegin\relax\else \FancyVerbRuleColor{\LWR@FVfindbordercolor} \LWR@htmltagc{% - div class="fancyvrblabel" % extra space - style="color: \LWR@origpound\LWR@tempcolor"% + div class=\textquotedbl{}fancyvrblabel\textquotedbl\ % space + style=\textquotedbl{}color: \LWR@origpound\LWR@tempcolor\textquotedbl% } \LWR@print@textrm{\FV@LabelBegin}% \textrm preserves emdash \LWR@htmltagc{/div}\LWR@orignewline% @@ -53219,8 +53703,8 @@ name = \chemmacros_translate:n {scheme-name} \ifx\FV@LabelEnd\relax\else \FancyVerbRuleColor{\LWR@FVfindbordercolor} \LWR@htmltagc{% - div class="fancyvrblabel" % extra space - style="color: \LWR@origpound\LWR@tempcolor"% + div class=\textquotedbl{}fancyvrblabel\textquotedbl\ % space + style=\textquotedbl{}color: \LWR@origpound\LWR@tempcolor\textquotedbl% } \LWR@print@textrm{\FV@LabelEnd} \LWR@htmltagc{/div}\LWR@orignewline% @@ -57009,19 +57493,21 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % For the \HTML\ reference, add the graphicspath, filename, extension, % alt tag, style, and class. % \changes{v0.79}{2019/12/09}{\pkg{graphics}: Factored from \cs{LWR@includegraphicsb}.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand*{\LWR@ig@htmltag}{% img\LWR@indentHTML% - src="% + src=\textquotedbl% % \end{macrocode} % \changes{v0.62}{2018/10/27}{\pkg{graphics}: Fix: Filename expansion.} % \begin{macrocode} \detokenize\expandafter{\LWR@parsedfilename}% % \end{macrocode} % \begin{macrocode} - "\LWR@indentHTML% + \textquotedbl\LWR@indentHTML% % \end{macrocode} % Only include a style tag if a width, height, angle, or scale was given: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \ifthenelse{ \NOT\equal{\LWR@igwidthstyle}{} \OR @@ -57032,7 +57518,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \NOT\equal{\LWR@igyscale}{1} }% {% - style="\LWR@indentHTML + style=\textquotedbl\LWR@indentHTML \ifthenelse{\NOT\equal{\LWR@igwidthstyle}{}}% {\LWR@igwidthstyle;\LWR@indentHTML}{}% \ifthenelse{\NOT\equal{\LWR@igheightstyle}{}}% @@ -57064,14 +57550,15 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \ifthenelse{\NOT\equal{\LWR@opacity}{1}}% {opacity:\LWR@opacity;\LWR@indentHTML}{}% % - "\LWR@indentHTML% + \textquotedbl\LWR@indentHTML% }{}% % \end{macrocode} % Set the class and alt tag: % \changes{v0.65}{2018/12/19}{\pkg{graphics}: Added \cs{includegraphics} \attribute{alt} key.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - class="\LWR@igclass"\LWR@indentHTML% - alt="\AltTextOpen\LWR@igalt\AltTextClose" \LWR@orignewline% + class=\textquotedbl\LWR@igclass\textquotedbl\LWR@indentHTML% + alt=\textquotedbl\AltTextOpen\LWR@igalt\AltTextClose\textquotedbl\ \LWR@orignewline% }% end of image tags % \end{macrocode} % \end{noindmacro} @@ -57093,7 +57580,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \changes{v0.18}{2016/05/17}{\pkg{graphics}: Fix: \cs{linewidth}, \cs{textwidth}, \cs{textheight} % inside a minipage.} % \changes{v0.18}{2016/05/17}{\pkg{graphics}: em, ex, \%, px dimensions preserved.} -% \changes{v0.18}{2016/05/17}{\pkg{graphics}: Add: svgz file extension.} +% \changes{v0.18}{2016/05/17}{\pkg{graphics}: Add: \SVG\ file extension.} % \changes{v0.20}{2016/08/20}{\pkg{graphics}: Fix: \cs{linewidth} in a floatrow.} % \changes{v0.20}{2017/01/12}{\pkg{graphics}: Fix: Expands filename.} % \changes{v0.28}{2017/04/12}{\pkg{graphics}: Adapts to \pkg{graphics} syntax.} @@ -57319,10 +57806,11 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \end{macrocode} % Select |inline-block| so that \HTML\ will transform this span: % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@htmltagc{% span\LWR@indentHTML - style="\LWR@indentHTML + style=\textquotedbl\LWR@indentHTML display: inline-block;\LWR@indentHTML % \end{macrocode} % If an origin was given, translate and print the origin information: @@ -57335,7 +57823,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \begin{macrocode} \LWR@rotstyle{-ms-}{#2}\LWR@indentHTML \LWR@rotstyle{-webkit-}{#2}\LWR@indentHTML - \LWR@rotstyle{}{#2}"\LWR@orignewline% + \LWR@rotstyle{}{#2}\textquotedbl\LWR@orignewline% }\LWR@orignewline% % \end{macrocode} % Print the text to be rotated: @@ -57371,10 +57859,11 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \end{macrocode} % Select |inline-block| so that \HTML\ will transform this span: % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \LWR@htmltagc{% span\LWR@indentHTML - style="\LWR@indentHTML + style=\textquotedbl\LWR@indentHTML display: inline-block;\LWR@indentHTML % \end{macrocode} % Print the scaling information: @@ -57382,7 +57871,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \LWR@scalestyle{-ms-}{#1}{\IfNoValueTF{#2}{#1}{#2}}\LWR@indentHTML \LWR@scalestyle{-webkit-}{#1}{\IfNoValueTF{#2}{#1}{#2}}\LWR@indentHTML \LWR@scalestyle{}{#1}{\IfNoValueTF{#2}{#1}{#2}} - "\LWR@orignewline + \textquotedbl\LWR@orignewline }\LWR@orignewline% % \end{macrocode} % Print the text to be scaled: @@ -57642,6 +58131,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % % \changes{v0.44}{2017/11/15}{\pkg{hang}: Added.} % \changes{v0.47}{2018/01/26}{\pkg{hang}: Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % % \codehtml % @@ -57676,7 +58166,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \renewcommand*{\LWR@printcloselist}{\LWR@printcloseitemize}% \renewcommand*{\LWR@printopenlist}{% \LWR@findhangingleftmargin% - ul style="% + ul style=\textquotedbl% \LWR@print@mbox{list-style-type:none;} % extra space \LWR@print@mbox{% margin-left:\LWR@printlength{\LWR@templengthone}% @@ -57684,7 +58174,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \LWR@print@mbox{% text-indent:-\LWR@printlength{\hangingindent}% }% - "% + \textquotedbl% }% \let\item\LWR@itemizeitem% \list{}{}% @@ -58416,12 +58906,17 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \changes{v0.43}{2017/10/31}{\pkg{hyperref}: Made robust.} % \changes{v0.45}{2017/12/29}{\pkg{hyperref}: Fix: Underscore in \URL.} % \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \URL.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \NewDocumentCommand{\LWR@hyperimageb}{m +m}{% \LWR@ensuredoingapar% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% - \LWR@htmltag{img src="\LWR@templink" alt="#2" class="hyperimage"}% + \LWR@htmltag{% + img src=\textquotedbl\LWR@templink\textquotedbl\ % + alt=\textquotedbl#2\textquotedbl\ % + class=\textquotedbl{}hyperimage\textquotedbl% + }% \LWR@ensuredoingapar% \endgroup% } @@ -58465,6 +58960,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \changes{v0.45}{2018/01/02}{\pkg{hyperref}: Fix: Underscore in \URL.} % \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \URL.} % \changes{v0.57}{2018/06/05}{\pkg{subcaption}: Fix: \cs{subref}.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % % Creates an \HTML\ link to |URL#category.name| with the given text. % @@ -58480,10 +58976,10 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \newcommand*{\LWR@hyperrefbb}[3]{% \LWR@htmltag{% - a href="% + a href=\textquotedbl% \detokenize\expandafter{#1}\LWR@hashmark% \detokenize\expandafter{#2}.\detokenize\expandafter{#3}% - "% + \textquotedbl% \LWR@addlinktitle% }% \endgroup% @@ -59273,6 +59769,32 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % % +% +% \iffalse +%<*impnattypo> +% \fi +% +% \part{lwarp-impnattypo.sty} +% +% \section{impnattypo} +% +% \DescribePackage{impnattypo} +% \pkg{impnattypo} is ignored. +% +% \changes{v0.895}{2021/01/13}{\pkg{impnattypo}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{impnattypo}[2019/03/04] +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % \iffalse %<*index> % \fi @@ -59455,6 +59977,149 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % % \iffalse +%<*isomath> +% \fi +% +% \part{lwarp-isomath.sty} +% +% \section{isomath} +% +% \credits{Günter Milde} +% +% \DescribePackage{isomath} +% \pkg{isomath} is used as-is for \SVG\ math, and +% emulated for \brand{MathJax}. +% +% \brand{MathJax} does not provide a sans math font, so sans is typeset as roman. +% \trouble[\brand{MathJax} sans]{isomath=\pkg{isomath}} +% +% \changes{v0.895}{2021/02/08}{\pkg{isomath}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{isomath}[2012/09/04] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\let\mathbfit\boldsymbol} +\CustomizeMathJax{\let\mathsfbfit\mathbfit}% not sans +\CustomizeMathJax{\let\mathsfit\mathit}% not sans +\CustomizeMathJax{\let\vectorsym\mathbfit} +\CustomizeMathJax{\let\matrixsym\mathbfit} +\CustomizeMathJax{\let\tensorsym\mathsfbfit} +\CustomizeMathJax{\let\mathboldsans\mathsfbfit} +\CustomizeMathJax{\let\mathbold\mathbfit} +\CustomizeMathJax{\let\mathsans\mathrm}% not sans +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% \iffalse +%<*isotope> +% \fi +% +% \part{lwarp-isotope.sty} +% +% \section{isotope} +% +% \credits{Heiko Bauke} +% +% \DescribePackage{isotope} +% \pkg{isotope} is patched for use by \pkg{lwarp} with \SVG\ math, +% and emulated for \brand{MathJax}. +% +% \changes{v0.895}{2021/01/10}{\pkg{isotope}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{isotope}[2011/08/26] +% \end{macrocode} +% +% \begin{macrocode} +\newcommand{\LWR@HTML@isotope@two}[2][]{% + \renewcommand{\isotope@atomicnumber}{#1}% + \edef\LWR@isotope@alttag{% + \textbackslash( + \textbackslash{}isotope + [\isotope@nucleonnumber]% + [\isotope@atomicnumber]% + \{#2\} + \textbackslash)% + }% + \ifbool{mathjax}% + {\LWR@isotope@alttag}% + {% SVG + \m@th% + \LWR@subsingledollar*% + {% alt tag + \LWR@isotope@alttag% + }% + {isotope}% add'l hashing + {% contents + \settowidth\@tempdimb{% + \ensuremath{\scriptstyle\isotope@nucleonnumber}% + }% + \settowidth\@tempdimc{% + \ensuremath{\scriptstyle\isotope@atomicnumber}% + }% + \ifdim\@tempdimb<\@tempdimc\@tempdimb=\@tempdimc\fi% + \ensuremath{ + {}% + ^{\makebox[\@tempdimb][r]{% + \ensuremath{% + \scriptstyle\isotope@nucleonnumber% + }% ensuremath + }}% + _{\makebox[\@tempdimb][r]{% + \ensuremath{% + \scriptstyle\isotope@atomicnumber% + }% ensuremath + }}% + \isotopestyle{#2}% + }% ensuremath + }% contents + }% SVG + \endgroup% +}% +\LWR@formatted{isotope@two} + +\begin{warpMathJax} +\CustomizeMathJax{% + \newcommand{\LWRisotopetwo}[2][]{% + {% + \vphantom{\mathrm{#2}}% + {}^{\LWRisotopenucleonnumber}_{#1}% + \mathrm{#2}% + }% + }% +} + +\CustomizeMathJax{% + \newcommand{\isotope}[1][]{% + \def\LWRisotopenucleonnumber{#1}% + \LWRisotopetwo% + }% +} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% \iffalse %<*jurabib> % \fi % @@ -59664,9 +60329,12 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \ifnum0=\@karnaughmap@local@matrixtemplate@% original % print error if no template could be found \PackageError{lwarp-karnaugh-map}{% - Can not find a template fitting your specification (\@karnaughmap@var@mapsizex@\space x \@karnaughmap@var@mapsizey@\space x \@karnaughmap@var@mapsizez@)% + Can not find a template fitting your specification + (\@karnaughmap@var@mapsizex@\space x \@karnaughmap@var@mapsizey@\space x + \@karnaughmap@var@mapsizez@)% }{% - Existing templates have the following dimensions: 2x2x1, 2x4x1, 4x2x1, 4x4x1, 4x4x2, and 4x4x4. + Existing templates have the following dimensions: + 2x2x1, 2x4x1, 4x2x1, 4x4x1, 4x4x2, and 4x4x4. }% % \fi original }{\relax}% lwarp @@ -60775,10 +61443,11 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \brand{MathJax} cannot yet honor options for adjusting Latin characters. % % The dedicated macros for upright and italic Greek letters do work correctly. -% Some of the symbol font macros such as \cs{mathsfbf} work for Latin but not -% for Greek letters. % -% \SVG\ math should appear the same as the printed output. +% Some of the symbol font macros such as \cs{mathsfbf} do not use a sans font +% because \brand{MathJax} does not yet have sans Greek. +% +% \SVG\ math honors all font choices, and should appear the same as the printed output. % % \changes{v0.891}{2020/09/18}{\pkg{libertinust1math}: Added.} % @@ -60816,17 +61485,35 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \LWR@mathjax@addgreek@l@up{up}{} \CustomizeMathJax{\let\uppartial\partial}% not upright +% \end{macrocode} +% +% \changes{v0.895}{2021/01/04}{\pkg{libertinust1math}: \brand{MathJax}: Fixed for Greek, ignoring sans.} +% \begin{macrocode} +\CustomizeMathJax{\let\mathsfbf\mathbf}% not sans +% \CustomizeMathJax{\newcommand{\mathsfbf}[1]{% +% \mmlToken{mi}[mathvariant="bold-sans-serif"]{#1}% not greek +% }}% not sans + +% \CustomizeMathJax{\newcommand{\mathbfit}[1]{\boldsymbol{#1}}} +\CustomizeMathJax{\let\mathbfit\boldsymbol} +% \end{macrocode} +% +% \changes{v0.895}{2021/01/04}{\pkg{libertinust1math}: \brand{MathJax}: Fixed for Greek, ignoring sans.} +% \begin{macrocode} +% \CustomizeMathJax{\newcommand{\mathsfbfit}[1]{\boldsymbol{#1}}}% not sans +\CustomizeMathJax{\let\mathsfbfit\mathbfit}% not sans +% \CustomizeMathJax{\newcommand{\mathsfbfit}[1]{% +% \mmlToken{mi}[mathvariant="sans-serif-bold-italic"]{#1}% not greek +% }}% +% \end{macrocode} +% +% \changes{v0.895}{2021/01/04}{\pkg{libertinust1math}: \brand{MathJax}: Fixed for Greek, ignoring sans.} +% \begin{macrocode} +\CustomizeMathJax{\let\mathsfit\mathit}% not sans +% \CustomizeMathJax{\newcommand{\mathsfit}[1]{% +% \mmlToken{mi}[mathvariant="sans-serif-italic"]{#1}% not greek +% }} -\CustomizeMathJax{\newcommand{\mathsfbf}[1]{% - \mmlToken{mi}[mathvariant="bold-sans-serif"]{#1}% not greek -}}% not sans -\CustomizeMathJax{\newcommand{\mathsfbfit}[1]{% - \mmlToken{mi}[mathvariant="sans-serif-bold-italic"]{#1}% not greek -}}% -\CustomizeMathJax{\newcommand{\mathbfit}[1]{\boldsymbol{#1}}} -\CustomizeMathJax{\newcommand{\mathsfit}[1]{% - \mmlToken{mi}[mathvariant="sans-serif-italic"]{#1}% not greek -}} \CustomizeMathJax{\let\vectorsym\mathbfit} \CustomizeMathJax{\let\matrixsym\mathbfit} \CustomizeMathJax{\let\tensorsym\mathsfbfit} @@ -61456,8 +62143,11 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \else% % \end{macrocode} % Inline, so open a \element{span}: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} - \ifbool{LWR@verbtags}{\LWR@htmltag{span class="inlineprogramlisting"}}{}% + \ifbool{LWR@verbtags}{\LWR@htmltag{% + span class=\textquotedbl{}inlineprogramlisting\textquotedbl% + }}{}% \fi% \LWR@traceinfo{lst@Init done}% } @@ -61918,6 +62608,42 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % % +% \iffalse +%<*lpic> +% \fi +% +% \part{lwarp-lpic.sty} +% +% \section{lpic} +% +% \credits{R. Matveyev} +% +% \DescribePackage{lpic} +% \pkg{lpic} is patched for use by \pkg{lwarp}. +% +% \changes{v0.895}{2021/01/19}{\pkg{lpic}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{lpic}[2010/12/23] +% \end{macrocode} +% +% \begin{macrocode} +\BeforeBeginEnvironment{lpic}{% + \begin{lateximage}[-lpic-~\PackageDiagramAltText]% +} + +\AfterEndEnvironment{lpic}{\end{lateximage}} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% % % % \iffalse @@ -62507,6 +63233,41 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % % +% \iffalse +%<*luavlna> +% \fi +% +% \part{lwarp-luavlna.sty} +% +% \section{luavlna} +% +% \credits{Michal Hoftich, Miro Hrončok} +% +% \DescribePackage{luavlna} +% \pkg{luavlna} is patched for use by \pkg{lwarp}. +% +% The package is disabled for \HTML\ output, due to incompatibilities with +% \pkg{lwarp}'s handling of math \SVG\ images. +% +% \changes{v0.895}{2020/01/13}{\pkg{luavlna}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{luavlna}[2019/10/30] +% \end{macrocode} +% +% \begin{macrocode} +\preventsingleoff +\LetLtxMacro\preventsingleon\preventsingleoff +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % % \iffalse %<*lyluatex> @@ -64041,6 +64802,169 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % % +% +% \iffalse +%<*mattens> +% \fi +% +% \part{lwarp-mattens.sty} +% +% \section{mattens} +% +% \credits{Danie Els} +% +% \DescribePackage{mattens} +% \pkg{mattens} is used as-is for \SVG\ math, +% and is emulated for \brand{MathJax}. +% +% \changes{v0.895}{2021/02/11}{\pkg{mattens}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{mattens}[2010/03/26] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\LWRmattensnull}{}} + +\CustomizeMathJax{\newcommand{\LWRmattensnostar}[2][]{% + {#1{\LWRmattensundercmd{\LWRmattensovercmd{\LWRmattenscross{\boldsymbol{#2}}}}}}% +}} + +\CustomizeMathJax{\newcommand{\LWRmattensstar}[2][]{% + {#1{\LWRmattensundercmd{\LWRmattensovercmd{\LWRmattenscross{#2}}}}}% +}} + +\CustomizeMathJax{\newcommand{\LWRmattens}{ + \ifstar\LWRmattensstar\LWRmattensnostar% +}} + +\CustomizeMathJax{\newcommand{\aS}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\overrightarrow% + \let\LWRmattensundercmd\LWRmattensnull% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\Sa}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\underrightarrow% + \let\LWRmattensundercmd\LWRmattensnull% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\bS}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\overline% + \let\LWRmattensundercmd\LWRmattensnull% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\Sb}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\underline% + \let\LWRmattensundercmd\LWRmattensnull% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\aSa}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\overrightarrow% + \let\LWRmattensundercmd\underrightarrow% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\aSb}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\overrightarrow% + \let\LWRmattensundercmd\underline% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\bSa}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\overline% + \let\LWRmattensundercmd\underrightarrow% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\bSb}{% + \let\LWRmattenscross\LWRmattensnull% + \let\LWRmattensovercmd\overline% + \let\LWRmattensundercmd\underline% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\aCSa}{% + \let\LWRmattenscross\tilde% + \let\LWRmattensovercmd\overrightarrow% + \let\LWRmattensundercmd\underrightarrow% + \LWRmattens% +}} + +\CustomizeMathJax{\newcommand{\bCSb}{% + \let\LWRmattenscross\tilde% + \let\LWRmattensovercmd\overline% + \let\LWRmattensundercmd\underline% + \LWRmattens% +}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% \iffalse +%<*maybemath> +% \fi +% +% \part{lwarp-maybemath.sty} +% +% \section{maybemath} +% +% \credits{Andy Buckley} +% +% \DescribePackage{maybemath} +% \pkg{maybemath} is used as-is for \SVG\ math, +% and is emulated for \brand{MathJax}. +% +% \brand{MathJax} is not able to detect the surrounding text font, +% \trouble[no effect]{maybemath=\pkg{maybemath}} +% so all \pkg{maybemath} macros are ignored. +% +% \changes{v0.0.895}{2021/01/08}{\pkg{maybemath}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{maybemath}[2005/2/22] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\mayberm}[1]{{#1}}} +\CustomizeMathJax{\let\maybebm\mayberm} +\CustomizeMathJax{\let\maybeit\mayberm} +\CustomizeMathJax{\let\maybeitrm\mayberm} +\CustomizeMathJax{\let\maybeitsubscript\mayberm} +\CustomizeMathJax{\let\maybesf\mayberm} +\CustomizeMathJax{\let\maybebmsf\mayberm} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% % \iffalse %<*mcaption> % \fi @@ -64224,12 +65148,13 @@ endinnercode={\LWR@stoppars}, % A \env{BlockClass} environment is not used because this \element{div} is % created by the \pkg{mdframed} \optn{startcode} and \optn{endcode} settings, % which do not properly nest the \element{div} inside the \env{mdframed} environment. +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} -\LWR@htmltagc{div class="% +\LWR@htmltagc{div class=\textquotedbl% mdframed% \ifdefstring{\LWR@mdthisenv}{mdframed}{}{ \LWR@mdthisenv}% -" \LWR@orignewline -style=" \LWR@orignewline +\textquotedbl \LWR@orignewline +style=\textquotedbl\LWR@orignewline % \end{macrocode} % Convert and print the background color: % \begin{macrocode} @@ -64257,7 +65182,7 @@ border-radius: \LWR@mdfprintlength{roundcorner} ; \LWR@orignewline \LWR@orignewline % \end{macrocode} % \begin{macrocode} -"} +\textquotedbl} % \LWR@htmldivclass{\LWR@mdthisenv} % \end{macrocode} % \env{mdframed} environment may not work with the \HTML\ versions of the following, @@ -64676,6 +65601,44 @@ background: % \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} % % +% \iffalse +%<*mdwmath> +% \fi +% +% \part{lwarp-mdwmath.sty} +% +% \section{mdwmath} +% +% \credits{Mark Wooding} +% +% \DescribePackage{mdwmath} +% \pkg{mdwmath} is used as-is for \SVG\ math, and +% is emulated for \brand{MathJax}. +% +% \changes{v0.895}{2021/01/11}{\pkg{mdwmath}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{mdwmath}[1996/04/11] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\let\LWRmdwmathsqrt\sqrt} +\CustomizeMathJax{\renewcommand{\sqrt}{\ifstar\LWRmdwmathsqrt\LWRmdwmathsqrt}} +\CustomizeMathJax{\newcommand{\bitand}{\mathbin\&}} +\CustomizeMathJax{\def\bitor{\mathbin\mid}} +\CustomizeMathJax{\def\dblor{\mathbin{\mid\mid}}} +\CustomizeMathJax{\def\dbland{\mathbin{\mathrel\bitand\mathrel\bitand}}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% % % \iffalse %<*media9> @@ -66269,8 +67232,7 @@ background: % % \limitsmultirow % -% In a \env{lateximage}, \cs{LWR@restoreorigformatting} -% restores the original print-mode versions. +% In a \env{lateximage}, the print versions are restored. % % See \cref{sec:printmultirow} for the print-mode versions. % @@ -66282,7 +67244,7 @@ background: % \end{macrocode} % % \begin{macrocode} -\LWR@ProvidesPackagePass{multirow}[2018/08/03] +\LWR@ProvidesPackagePass{multirow}[2021/01/29] % \end{macrocode} % % @@ -66297,6 +67259,12 @@ background: % % \subsection{Multirow} % +% \begin{noindmacro}{\LWR@multirow@par} \cs{par} inside a \cs{multirow}. +% \begin{macrocode} +\newcommand*{\LWR@multirow@par}{\LWR@htmltag{br /}\LWR@origpar}% +% \end{macrocode} +% \end{noindmacro} +% % \DescribeMacro{\multirow} % \oarg{vpos} \marg{numrows} \oarg{bigstruts} \marg{width} \oarg{fixup} \marg{text} % \changes{v0.19}{2015/05/28}{\pkg{multirow}: Added optional args.} @@ -66321,12 +67289,13 @@ background: \LWR@tabularleftedge% % \end{macrocode} % Print the start of a new table data cell: +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} -\LWR@htmltag{td rowspan="#2" % +\LWR@htmltag{td rowspan=\textquotedbl#2\textquotedbl\ % % \end{macrocode} % A class adds the column spec and the rule: % \begin{macrocode} -class="td% +class=\textquotedbl{}td% % \end{macrocode} % Append this column's spec: % \changes{v0.60}{2018/09/17}{\env{tabular}: Improved memory management: Not using \pkg{xstring}.} @@ -66340,7 +67309,7 @@ class="td% \LWR@addcmidruletrim% \LWR@addleftmostbartag% \LWR@printbartag{\arabic{LWR@tableLaTeXcolindex}}% -"% +\textquotedbl% % \end{macrocode} % \changes{v0.42}{2017/10/26}{\pkg{multirow}: If \progcode{FormatWP} add cell alignment.} % \begin{macrocode} @@ -66377,9 +67346,22 @@ class="td% % \begin{macrocode} \LWR@getexparray{LWR@colbeforespec}{\arabic{LWR@tableLaTeXcolindex}}% % \end{macrocode} -% While printing the text, redefine |\\| to generate a new line +% +% While printing the text, redefine |\\| to generate a new line. +% If a nested \env{tabular} occurs, |\\| is redefined to +% \cs{LWR@tabularendofline} at the start of the \env{tabular}, then +% \cs{LWR@endofline} before again printing any +% \cs{multirow} contents inside the nested \env{tabular}. +% +% \cs{par} is redefined to insert an \HTML\ break, and if \env{tabular} +% is nested, it is redefined at the start of \env{tabular}. +% \changes{v0.895}{2021/01/31}{Allow \cs{par}.} % \begin{macrocode} -\begingroup\LetLtxMacro{\\}{\LWR@endofline}#6\endgroup% +\begingroup% + \LetLtxMacro{\\}{\LWR@endofline}% + \let\par\LWR@multirow@par% + #6% +\endgroup% \LWR@stoppars% \boolfalse{LWR@intabularmetadata}% \renewcommand{\LWR@multirowborder}{}% @@ -67795,7 +68777,7 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak \LWR@formatted{@UnitsUglyFrac} % \end{macrocode} % -% For Mathjax: +% For \brand{Mathjax}: % \changes{v0.891}{2020/09/08}{\pkg{nicefrac}: Added \cs{mathinner}, improved fraction.} % \begin{macrocode} \begin{warpMathJax} @@ -67877,8 +68859,8 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % \trouble[\brand{MathJax}]{nicematrix=\pkg{nicematrix}} % \cs{Cdots}, etc. do not span multiple cells. % \env{AutoNiceMatrix}, etc. are not supported for \brand{MathJax}. -% SVG math output preserves all nicematrix features. -% To force SVG output for one or more consecutive +% \SVG\ math output preserves all nicematrix features. +% To force \SVG\ output for one or more consecutive % math expressions, for inline math use % \cs{inlinemathother} and \cs{inlinemathnormal}, or % for display math use \cs{displaymathother} and \cs{displaymathnormal}. @@ -68640,11 +69622,15 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % Mimics a float by incrementing the float counter and generating % an \HTML\ anchor. These are used for list-of-theorem cross-references. % \changes{v0.47}{2018/01/26}{\pkg{ntheorem}: Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.} % \begin{macrocode} \newcommand{\LWR@inctheorem}{% \addtocounter{LWR@thisautoid}{1}% \LWR@stoppars% -\LWR@htmltag{a id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}"}\LWR@htmltag{/a}% +\LWR@htmltag{% + a id=\textquotedbl\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}\textquotedbl% +}% +\LWR@htmltag{/a}% \LWR@startpars% } % \end{macrocode} @@ -70927,6 +71913,47 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % +% +% +% \iffalse +%<*pinlabel> +% \fi +% +% \part{lwarp-pinlabel.sty} +% +% \section{pinlabel} +% +% \credits{Colin Rourke} +% +% \DescribePackage{pinlabel} +% \pkg{pinlabel} is patched for use by \pkg{lwarp}. +% +% \changes{v0.895}{2021/01/19}{\pkg{pinlabel}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{pinlabel}% no date given +% \end{macrocode} +% +% \begin{macrocode} +\xpretocmd{\psfig} + {\begin{lateximage}[-pinlabel-~\PackageDiagramAltText]} + {} + {\LWR@patcherror{pinlabel}{psfigA}} + +\xapptocmd{\psfig} + {\end{lateximage}} + {} + {\LWR@patcherror{pinlabel}{psfigB}} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % \iffalse %<*placeins> % \fi @@ -72377,6 +73404,49 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % +% \iffalse +%<*rlepsf> +% \fi +% +% \part{lwarp-rlepsf.sty} +% +% \section{rlepsf} +% +% \credits{Michael Greene, Colin Rourke} +% +% \DescribePackage{rlepsf} +% \pkg{rlepsf} is patched for use by \pkg{lwarp}. +% +% The file \filenm{rlepsf.tex} must be copied to \filenm{rlepsf.sty} for +% \trouble[Rename the style file!]{rlepsf=\pkg{rlepsf}} +% \pkg{lwarp} to detect and patch it. +% +% \changes{v0.895}{2019/01/19}{\pkg{rlepsf}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{rlepsf}% No date given. +% \end{macrocode} +% +% \begin{macrocode} +\xpretocmd{\relabelbox} + {\begin{lateximage}} + {} + {\LWR@patcherror{rlepsf}{relabelbox}} + +\xapptocmd{\endrelabelbox} + {\end{lateximage}} + {} + {\LWR@patcherror{rlepsf}{endrelabelbox}} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % % \iffalse %<*rmathbr> @@ -72524,27 +73594,41 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % All rotations are ignored in \HTML\ output. % -% \changes{v0.69}{2019/03/09}{\pkg{rotfloat}: Requires \pkg{graphicx}.} +% \changes{v0.69}{2019/03/09}{\pkg{rotating}: Requires \pkg{graphicx}.} +% \changes{v0.895}{2021/01/19}{\pkg{rotating}: Supports \env{lateximage}.} % % \codehtml % \begin{macrocode} -\LWR@ProvidesPackageDrop{rotating}[2016/08/11] +\LWR@ProvidesPackagePass{rotating}[2016/08/11] \RequirePackage{graphicx} % \end{macrocode} % \begin{macrocode} -\LetLtxMacro\sidewaystable\table -\let\endsidewaystable\endtable +\LetLtxMacro\LWR@HTML@sidewaystable\table +\let\endLWR@HTML@sidewaystable\endtable +\LWR@formattedenv{sidewaystable} + +\LetLtxMacro\LWR@HTML@sidewaysfigure\figure +\let\endLWR@HTML@sidewaysfigure\endfigure +\LWR@formattedenv{sidewaysfigure} + +\newenvironment*{LWR@HTML@sideways}{}{} +\LWR@formattedenv{sideways} -\LetLtxMacro\sidewaysfigure\figure -\let\endsidewaysfigure\endfigure +\newenvironment*{LWR@HTML@turn}[1]{}{} +\LWR@formattedenv{turn} -\newenvironment*{sideways}{}{} -\newenvironment*{turn}[1]{}{} -\newenvironment*{rotate}[1]{}{} -\NewDocumentCommand{\turnbox}{m +m}{#2} -\let\rotcaption\caption -\let\@makerotcaption\@makecaption +\newenvironment*{LWR@HTML@rotate}[1]{}{} +\LWR@formattedenv{rotate} + +\NewDocumentCommand{\LWR@HTML@turnbox}{m +m}{#2} +\LWR@formatted{turnbox} + +\let\LWR@HTML@rotcaption\caption +\LWR@formatted{rotcaption} + +\let\LWR@HTML@@makerotcaption\@makecaption +\LWR@formatted{@makerotcaption} % \end{macrocode} @@ -74683,12 +75767,18 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \CustomizeMathJax{\newcommand{\molepercubicmetrenp}{\mole\usk\rpcubic\metre}} \CustomizeMathJax{\newcommand{\radianpersquaresecond}{\radian\per\second\squared}} \CustomizeMathJax{\newcommand{\radianpersquaresecondnp}{\radian\usk\second\rpsquared}} -\CustomizeMathJax{\newcommand{\kilogramsquaremetrepersecond}{\kilogram\usk\squaremetre\per\second}} -\CustomizeMathJax{\newcommand{\kilogramsquaremetrepersecondnp}{\kilogram\usk\squaremetre\usk\reciprocal\second}} +\CustomizeMathJax{\newcommand{\kilogramsquaremetrepersecond}{% + \kilogram\usk\squaremetre\per\second% +}} +\CustomizeMathJax{\newcommand{\kilogramsquaremetrepersecondnp}{% + \kilogram\usk\squaremetre\usk\reciprocal\second% +}} \CustomizeMathJax{\newcommand{\radianpersecond}{\radian\per\second}} \CustomizeMathJax{\newcommand{\radianpersecondnp}{\radian\usk\reciprocal\second}} \CustomizeMathJax{\newcommand{\squaremetrepercubicmetre}{\squaremetre\per\cubic\metre}} -\CustomizeMathJax{\newcommand{\squaremetrepercubicmetrenp}{\squaremetre\usk\rpcubic\metre}} +\CustomizeMathJax{\newcommand{\squaremetrepercubicmetrenp}{% + \squaremetre\usk\rpcubic\metre% +}} \CustomizeMathJax{\newcommand{\katalpercubicmetre}{\katal\per\cubic\metre}} \CustomizeMathJax{\newcommand{\katalpercubicmetrenp}{\katal\usk\rpcubic\metre}} \CustomizeMathJax{\newcommand{\coulombpermol}{\coulomb\per\mole}} @@ -74697,8 +75787,12 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \CustomizeMathJax{\newcommand{\amperepersquaremetrenp}{\ampere\usk\rpsquare\metre}} \CustomizeMathJax{\newcommand{\kilogrampercubicmetre}{\kilogram\per\cubic\metre}} \CustomizeMathJax{\newcommand{\kilogrampercubicmetrenp}{\kilogram\usk\rpcubic\metre}} -\CustomizeMathJax{\newcommand{\squaremetrepernewtonsecond}{\squaremetre\per\newton\usk\second}} -\CustomizeMathJax{\newcommand{\squaremetrepernewtonsecondnp}{\squaremetre\usk\reciprocal\newton\usk\reciprocal\second}} +\CustomizeMathJax{\newcommand{\squaremetrepernewtonsecond}{% + \squaremetre\per\newton\usk\second% +}} +\CustomizeMathJax{\newcommand{\squaremetrepernewtonsecondnp}{% + \squaremetre\usk\reciprocal\newton\usk\reciprocal\second% +}} \CustomizeMathJax{\newcommand{\pascalsecond}{\pascal\usk\second}} \CustomizeMathJax{\newcommand{\coulombpercubicmetre}{\coulomb\per\cubic\metre}} \CustomizeMathJax{\newcommand{\coulombpercubicmetrenp}{\coulomb\usk\rpcubic\metre}} @@ -74726,11 +75820,21 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \CustomizeMathJax{\newcommand{\coulombperkilogram}{\coulomb\per\kilogram}} \CustomizeMathJax{\newcommand{\coulombperkilogramnp}{\coulomb\usk\reciprocal\kilogram}} \CustomizeMathJax{\newcommand{\squaremetrepersecond}{\squaremetre\per\second}} -\CustomizeMathJax{\newcommand{\squaremetrepersecondnp}{\squaremetre\usk\reciprocal\second}} -\CustomizeMathJax{\newcommand{\squaremetrepersquaresecond}{\squaremetre\per\second\squared}} -\CustomizeMathJax{\newcommand{\squaremetrepersquaresecondnp}{\squaremetre\usk\second\rpsquared}} -\CustomizeMathJax{\newcommand{\kilogrammetrepersecond}{\kilogram\usk\metre\per\second}} -\CustomizeMathJax{\newcommand{\kilogrammetrepersecondnp}{\kilogram\usk\metre\usk\reciprocal\second}} +\CustomizeMathJax{\newcommand{\squaremetrepersecondnp}{% + \squaremetre\usk\reciprocal\second% +}} +\CustomizeMathJax{\newcommand{\squaremetrepersquaresecond}{% + \squaremetre\per\second\squared% +}} +\CustomizeMathJax{\newcommand{\squaremetrepersquaresecondnp}{% + \squaremetre\usk\second\rpsquared% +}} +\CustomizeMathJax{\newcommand{\kilogrammetrepersecond}{% + \kilogram\usk\metre\per\second% +}} +\CustomizeMathJax{\newcommand{\kilogrammetrepersecondnp}{% + \kilogram\usk\metre\usk\reciprocal\second% +}} \CustomizeMathJax{\newcommand{\candelapersquaremetre}{\candela\per\squaremetre}} \CustomizeMathJax{\newcommand{\candelapersquaremetrenp}{\candela\usk\rpsquare\metre}} \CustomizeMathJax{\newcommand{\amperepermetre}{\ampere\per\metre}} @@ -74741,54 +75845,93 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \CustomizeMathJax{\newcommand{\henrypermetrenp}{\henry\usk\reciprocal\metre}} \CustomizeMathJax{\newcommand{\kilogrampersecond}{\kilogram\per\second}} \CustomizeMathJax{\newcommand{\kilogrampersecondnp}{\kilogram\usk\reciprocal\second}} -\CustomizeMathJax{\newcommand{\kilogrampersquaremetresecond}{\kilogram\per\squaremetre\usk\second}} -\CustomizeMathJax{\newcommand{\kilogrampersquaremetresecondnp}{\kilogram\usk\rpsquare\metre\usk\reciprocal\second}} +\CustomizeMathJax{\newcommand{\kilogrampersquaremetresecond}{% + \kilogram\per\squaremetre\usk\second% +}} +\CustomizeMathJax{\newcommand{\kilogrampersquaremetresecondnp}{% + \kilogram\usk\rpsquare\metre\usk\reciprocal\second% +}} \CustomizeMathJax{\newcommand{\kilogrampersquaremetre}{\kilogram\per\squaremetre}} \CustomizeMathJax{\newcommand{\kilogrampersquaremetrenp}{\kilogram\usk\rpsquare\metre}} \CustomizeMathJax{\newcommand{\kilogrampermetre}{\kilogram\per\metre}} \CustomizeMathJax{\newcommand{\kilogrampermetrenp}{\kilogram\usk\reciprocal\metre}} \CustomizeMathJax{\newcommand{\joulepermolekelvin}{\joule\per\mole\usk\kelvin}} -\CustomizeMathJax{\newcommand{\joulepermolekelvinnp}{\joule\usk\reciprocal\mole\usk\reciprocal\kelvin}} +\CustomizeMathJax{\newcommand{\joulepermolekelvinnp}{% + \joule\usk\reciprocal\mole\usk\reciprocal\kelvin% +}} \CustomizeMathJax{\newcommand{\kilogramperkilomole}{\kilogram\per\kilo\mole}} -\CustomizeMathJax{\newcommand{\kilogramperkilomolenp}{\kilogram\usk\kilo\reciprocal\mole}} +\CustomizeMathJax{\newcommand{\kilogramperkilomolenp}{% + \kilogram\usk\kilo\reciprocal\mole% +}} \CustomizeMathJax{\newcommand{\kilogramsquaremetre}{\kilogram\usk\squaremetre}} \CustomizeMathJax{\newcommand{\kilogramsquaremetrenp}{\kilogramsquaremetre}} -\CustomizeMathJax{\newcommand{\kilogrammetrepersquaresecond}{\kilogram\usk\metre\per\second\squared}} -\CustomizeMathJax{\newcommand{\kilogrammetrepersquaresecondnp}{\kilogram\usk\metre\usk\second\rpsquared}} +\CustomizeMathJax{\newcommand{\kilogrammetrepersquaresecond}{% + \kilogram\usk\metre\per\second\squared% +}} +\CustomizeMathJax{\newcommand{\kilogrammetrepersquaresecondnp}{% + \kilogram\usk\metre\usk\second\rpsquared% +}} \CustomizeMathJax{\newcommand{\newtonpersquaremetre}{\newton\per\squaremetre}} \CustomizeMathJax{\newcommand{\newtonpersquaremetrenp}{\newton\usk\rpsquare\metre}} \CustomizeMathJax{\newcommand{\persquaremetresecond}{1\per\squaremetre\usk\second}} -\CustomizeMathJax{\newcommand{\persquaremetresecondnp}{\rpsquare\metre\usk\reciprocal\second}} +\CustomizeMathJax{\newcommand{\persquaremetresecondnp}{% + \rpsquare\metre\usk\reciprocal\second% +}} \CustomizeMathJax{\newcommand{\wattperkilogram}{\watt\per\kilogram}} \CustomizeMathJax{\newcommand{\wattperkilogramnp}{\watt\usk\reciprocal\kilogram}} \CustomizeMathJax{\newcommand{\wattpercubicmetre}{\watt\per\cubic\metre}} \CustomizeMathJax{\newcommand{\wattpercubicmetrenp}{\watt\usk\rpcubic\metre}} -\CustomizeMathJax{\newcommand{\wattpersquaremetresteradian}{\watt\per\squaremetre\usk\steradian}} -\CustomizeMathJax{\newcommand{\wattpersquaremetresteradiannp}{\watt\usk\rpsquare\metre\usk\rp\steradian}} +\CustomizeMathJax{\newcommand{\wattpersquaremetresteradian}{% + \watt\per\squaremetre\usk\steradian% +}} +\CustomizeMathJax{\newcommand{\wattpersquaremetresteradiannp}{% + \watt\usk\rpsquare\metre\usk\rp\steradian% +}} \CustomizeMathJax{\newcommand{\jouleperkilogramkelvin}{\joule\per\kilogram\usk\kelvin}} -\CustomizeMathJax{\newcommand{\jouleperkilogramkelvinnp}{\joule\usk\reciprocal\kilogram\usk\reciprocal\kelvin}} +\CustomizeMathJax{\newcommand{\jouleperkilogramkelvinnp}{% + \joule\usk\reciprocal\kilogram\usk\reciprocal\kelvin% +}} \CustomizeMathJax{\newcommand{\squaremetreperkilogram}{\squaremetre\per\kilogram}} -\CustomizeMathJax{\newcommand{\rpsquaremetreperkilogram}{\squaremetre\usk\reciprocal\kilogram}} +\CustomizeMathJax{\newcommand{\rpsquaremetreperkilogram}{% + \squaremetre\usk\reciprocal\kilogram% +}} \CustomizeMathJax{\newcommand{\cubicmetreperkilogram}{\cubic\metre\per\kilogram}} -\CustomizeMathJax{\newcommand{\rpcubicmetreperkilogram}{\cubic\metre\usk\reciprocal\kilogram}} +\CustomizeMathJax{\newcommand{\rpcubicmetreperkilogram}{% + \cubic\metre\usk\reciprocal\kilogram% +}} \CustomizeMathJax{\newcommand{\newtonpermetre}{\newton\per\metre}} \CustomizeMathJax{\newcommand{\newtonpermetrenp}{\newton\usk\reciprocal\metre}} \CustomizeMathJax{\newcommand{\Celsius}{\unicode{x2103}}} \CustomizeMathJax{\newcommand{\wattpermetrekelvin}{\watt\per\metre\usk\kelvin}} -\CustomizeMathJax{\newcommand{\wattpermetrekelvinnp}{\watt\usk\reciprocal\metre\usk\reciprocal\kelvin}} -\CustomizeMathJax{\newcommand{\newtonmetre}{\newton\usk\metre} \CustomizeMathJax{\newcommand{\newtonmetrenp}{\newtonmetre}}} -\CustomizeMathJax{\newcommand{\squaremetrepercubicsecond}{\squaremetre\per\cubic\second}} -\CustomizeMathJax{\newcommand{\squaremetrepercubicsecondnp}{\squaremetre\usk\rpcubic\second}} +\CustomizeMathJax{\newcommand{\wattpermetrekelvinnp}{% + \watt\usk\reciprocal\metre\usk\reciprocal\kelvin% +}} +\CustomizeMathJax{\newcommand{\newtonmetre}{\newton\usk\metre} +\CustomizeMathJax{\newcommand{\newtonmetrenp}{\newtonmetre}}} +\CustomizeMathJax{\newcommand{\squaremetrepercubicsecond}{% + \squaremetre\per\cubic\second% +}} +\CustomizeMathJax{\newcommand{\squaremetrepercubicsecondnp}{% + \squaremetre\usk\rpcubic\second% +}} \CustomizeMathJax{\newcommand{\metrepersecond}{\metre\per\second}} \CustomizeMathJax{\newcommand{\metrepersecondnp}{\metre\usk\reciprocal\second}} \CustomizeMathJax{\newcommand{\joulepercubicmetre}{\joule\per\cubicmetre}} \CustomizeMathJax{\newcommand{\joulepercubicmetrenp}{\joule\usk\rpcubic\metre}} -\CustomizeMathJax{\newcommand{\kilogrampercubicmetrecoulomb}{\kilogram\per\cubic\metre\usk\coulomb}} -\CustomizeMathJax{\newcommand{\kilogrampercubicmetrecoulombnp}{\kilogram\usk\rpcubic\metre\usk\reciprocal\coulomb}} +\CustomizeMathJax{\newcommand{\kilogrampercubicmetrecoulomb}{% + \kilogram\per\cubic\metre\usk\coulomb% +}} +\CustomizeMathJax{\newcommand{\kilogrampercubicmetrecoulombnp}{% + \kilogram\usk\rpcubic\metre\usk\reciprocal\coulomb% +}} \CustomizeMathJax{\newcommand{\cubicmetrepersecond}{\cubicmetre\per\second}} \CustomizeMathJax{\newcommand{\rpcubicmetrepersecond}{\cubicmetre\usk\reciprocal\second}} -\CustomizeMathJax{\newcommand{\kilogrampersecondcubicmetre}{\kilogram\per\second\usk\cubicmetre}} -\CustomizeMathJax{\newcommand{\kilogrampersecondcubicmetrenp}{\kilogram\usk\reciprocal\second\usk\rpcubic\metre}} +\CustomizeMathJax{\newcommand{\kilogrampersecondcubicmetre}{% + \kilogram\per\second\usk\cubicmetre% +}} +\CustomizeMathJax{\newcommand{\kilogrampersecondcubicmetrenp}{% + \kilogram\usk\reciprocal\second\usk\rpcubic\metre% +}} \end{warpMathJax} % \end{macrocode} % @@ -74810,7 +75953,8 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \credits{Joseph Wright} % % \DescribePackage{siunitx} -% \pkg{siunitx} is patched for use by \pkg{lwarp}. +% \pkg{siunitx} is patched for use by \pkg{lwarp}, +% and is emulated for \brand{MathJax}. % % \limitssiunitx % @@ -74842,7 +75986,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \cs{@ensuredmath} is not supported inside an \cs{hbox}, so it must % temporarily be restored to its original. % Similar for \cs{mbox}. -% SVG math is created explicitly when necessary, using \cs{LWR@subsingledollar}. +% \SVG\ math is created explicitly when necessary, using \cs{LWR@subsingledollar}. % % \changes{v0.42}{2017/10/16}{\pkg{siunitx}: Improved \cs{ensuremath}.} % \changes{v0.48}{2018/02/13}{\pkg{siunitx}: Improved \SVG\ math.} @@ -75078,6 +76222,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \cs_new_protected:Npn \__siunitx_textsuperscript:n #1 {\textsuperscript{#1}} % \end{macrocode} % +% \begin{noindmacro}{\num} \oarg{options} \marg{value} % \begin{macrocode} \RenewDocumentCommand \num { o m } { \leavevmode @@ -75090,7 +76235,11 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \__siunitx_number_output:n {#2} \group_end:% lwarp } - +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\numrange} \oarg{options} \marg{value1} \marg{value2} +% \begin{macrocode} \RenewDocumentCommand \numrange { o m m } { \leavevmode \group_begin:% lwarp @@ -75102,7 +76251,11 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \__siunitx_range_numbers:nn {#2} {#3} \group_end:% lwarp } - +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\ang} \marg{options} \marg{angle} +% \begin{macrocode} \RenewDocumentCommand \ang { o > { \SplitArgument { 2 } { ; } } m } { \group_begin:% lwarp \LetLtxMacro\@ensuredmath\LWR@origensuredmath% lwarp @@ -75112,7 +76265,11 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \__siunitx_angle_output:nnn #2 \group_end:% lwarp } - +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\si} \marg{options} \marg{unit} +% \begin{macrocode} \RenewDocumentCommand \si { o m } { \leavevmode \group_begin:% lwarp @@ -75127,8 +76284,11 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', } \group_end:% lwarp } - - +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\SIrange} \oarg{options} \marg{value1} \marg{value2} \marg{unit} +% \begin{macrocode} \RenewDocumentCommand{\SIrange}{o m m m} {% \leavevmode @@ -75144,10 +76304,14 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', } \group_end:% lwarp } - +% \end{macrocode} +% \end{noindmacro} +% +% \begin{macrocode} \ExplSyntaxOff % \end{macrocode} + % For \brand{MathJax}. % (The following runs much faster as separate \cs{CusomizeMathJax} calls instead % of one single call.) @@ -75160,24 +76324,243 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \begin{macrocode} \CustomizeMathJax{\newcommand{\tothe}[1]{^{#1}}} \CustomizeMathJax{\newcommand{\raiseto}[2]{{#2}^{#1}}} +% \end{macrocode} +% +% Used as an end marker when parsing values: +% \changes{v0.895}{2021/01/13}{\pkg{siunitx}: Fix: \brand{MathJax} for \cs{ang}.} +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRsiunitxEND}{}} +% \end{macrocode} +% +% \begin{noindmacro}{\ang} \oarg{options} \marg{value} +% \begin{macrocode} +\CustomizeMathJax{\def\LWRsiunitxang#1;#2;#3;#4\LWRsiunitxEND{% + \ifblank{#1}{}{\num{#1}\degree}% + \ifblank{#2}{}{\num{#2}^{\unicode{x2032}}}% \prime + \ifblank{#3}{}{\num{#3}^{\unicode{x2033}}}% \dblprime +}} +\CustomizeMathJax{\newcommand{\ang}[2][]{\LWRsiunitxang#2;;;\LWRsiunitxEND}} +% \end{macrocode} +% \end{noindmacro} +% +% Processes scientific notation. +% Special handling for a mantissa which is either empty or only a minus sign. +% \changes{v0.895}{2021/01/14}{\pkg{siunitx}, \brand{MathJax}: Scientific notation.} +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRsiunitxnumscientific}[2]{% + \ifblank{#1}% + {}% + {% + \ifstrequal{#1}{-}% + {-}% + {\LWRsiunitxprintdecimal{#1}\times}% + }% + 10^{\LWRsiunitxprintdecimal{#2}} +}} +% \end{macrocode} +% +% \cs{num} handles optional powers (|e|, |E|, |d|, |D|), +% multiples (|x|), plus and minus, and period or comma decimal output. +% +% To split the string, \cs{def} is used with parameter delimiters. +% When each of the following macro is used, extra delimiters are padded to the end +% of the arguments of each macro when used, and +% the final argument of each collects any extra unused delimiters. +% +% \changes{v0.895}{2021/01/14}{\pkg{siunitx}, \brand{MathJax}: +% \cs{num} sci notation, multiples, +-, decimals, comma.} +% \begin{macrocode} +\ExplSyntaxOn +\AtBeginDocument{ +\ifdefstring{\l__siunitx_output_decimal_tl}{{,}} + {% Use decimal comma + \CustomizeMathJax{\def\LWRsiunitxprintdecimalsub#1.#2.#3\LWRsiunitxEND{% + \mathrm{#1}% + \ifblank{#2} + {}% + {,\mathrm{#2}} + }} + + \CustomizeMathJax{\newcommand{\LWRsiunitxprintdecimal}[1]{% + \LWRsiunitxprintdecimalsub#1...\LWRsiunitxEND% + }} + } + {% Use decimal point + \CustomizeMathJax{\def\LWRsiunitxprintdecimalsub#1,#2,#3\LWRsiunitxEND{% + \mathrm{#1}% + \ifblank{#2} + {}% + {.\mathrm{#2}} + }} + + \CustomizeMathJax{\newcommand{\LWRsiunitxprintdecimal}[1]{% + \LWRsiunitxprintdecimalsub#1,,,\LWRsiunitxEND% + }} + } +} +\ExplSyntaxOff +% \end{macrocode} +% +% \begin{noindmacro}{\num} \oarg{options} \marg{value} +% \begin{macrocode} +\CustomizeMathJax{\def\LWRsiunitxnumplus#1+#2+#3\LWRsiunitxEND{% + \ifblank{#2} + {\LWRsiunitxprintdecimal{#1}}% no plus + {% + \ifblank{#1}% + {\LWRsiunitxprintdecimal{#2}}% leading plus, ignore + {% a+b + \LWRsiunitxprintdecimal{#1}% + \unicode{x02B}% plus sign + \LWRsiunitxprintdecimal{#2}% + }% + }% +}} -\CustomizeMathJax{\newcommand{\ang}[2][]{(\mathrm{#2})\degree}} -\CustomizeMathJax{\newcommand{\num}[2][]{\mathrm{#2}}} +\CustomizeMathJax{\def\LWRsiunitxnumminus#1-#2-#3\LWRsiunitxEND{% + \ifblank{#2} + {\LWRsiunitxnumplus#1+++\LWRsiunitxEND}% + {% + \LWRsiunitxprintdecimal{#1}% + \unicode{x02212}% mathematical minus sign + \LWRsiunitxprintdecimal{#2}% + }% +}} + +\CustomizeMathJax{\def\LWRsiunitxnumpm#1+-#2+-#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumminus#1---\LWRsiunitxEND}% + {% + \LWRsiunitxprintdecimal{#1}% + \unicode{x0B1}% \pm + \LWRsiunitxprintdecimal{#2}% + }% +}} + +\CustomizeMathJax{\def\LWRsiunitxnumx#1x#2x#3x#4\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumpm#1+-+-\LWRsiunitxEND}% + {% + \ifblank{#3}% + {% + \LWRsiunitxprintdecimal{#1}% + \times% + \LWRsiunitxprintdecimal{#2}% + }% + {% + \LWRsiunitxprintdecimal{#1}% + \times% + \LWRsiunitxprintdecimal{#2}% + \times% + \LWRsiunitxprintdecimal{#3}% + }% + }% +}} + +\CustomizeMathJax{\def\LWRsiunitxnumD#1D#2D#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumx#1xxxxx\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} + +\CustomizeMathJax{\def\LWRsiunitxnumd#1d#2d#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumD#1DDD\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} + +\CustomizeMathJax{\def\LWRsiunitxnumE#1E#2E#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumd#1ddd\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} + +\CustomizeMathJax{\def\LWRsiunitxnume#1e#2e#3\LWRsiunitxEND{% + \ifblank{#2}% + {\LWRsiunitxnumE#1EEE\LWRsiunitxEND}% + {\mathrm{\LWRsiunitxnumscientific{#1}{#2}}}% +}} + +\CustomizeMathJax{\def\LWRsiunitxnumcomma#1,#2,#3\LWRsiunitxEND{% + \ifblank{#2} + {\LWRsiunitxnume#1eee\LWRsiunitxEND} + {\LWRsiunitxnume#1.#2eee\LWRsiunitxEND} +}} + +\CustomizeMathJax{\newcommand{\num}[2][]{\LWRsiunitxnumcomma#2,,,\LWRsiunitxEND}} +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\si} \oarg{options} \marg{unit} +% \begin{macrocode} \CustomizeMathJax{\newcommand{\si}[2][]{\mathrm{#2}}} +% \end{macrocode} +% \end{noindmacro} % -% \SI[opt]{num}[preunit]{unit} -\CustomizeMathJax{\newcommand{\LWRSI}[2][]{\mathrm{#1\LWRSInumber\,#2}}} -\CustomizeMathJax{\newcommand{\SI}[2][]{\def\LWRSInumber{#2}\LWRSI}} +% \begin{noindmacro}{\SI} \oarg{options} \marg{value} \oarg{prefix} \marg{unit} +% +% \cs{SI} has a second optional arg, which is parsed using \cs{ifnextchar}. +% \changes{v0.895}{2021/01/14}{\pkg{siunitx}: \brand{MathJax}: \cs{SI} prefix parsing.} +% \begin{macrocode} +\CustomizeMathJax{\def\LWRsiunitxSIopt#1[#2]#3{% + {#2}\num{#1}{#3}% +}} + +\CustomizeMathJax{\newcommand{\LWRsiunitxSI}[2]{% + \num{#1}\,{#2}% +}} % \end{macrocode} % -% \changes{v0.89}{2020/08/02}{\pkg{siunitx}: Unicode for endash.} +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\SI}[2][]{% + \ifnextchar[% + {\LWRsiunitxSIopt{#2}}% + {\LWRsiunitxSI{#2}}% +}} +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\numlist} \oarg{options} \marg{list} +% +% \cs{numlist} should only be used in text mode. +% If used in \brand{MathJax}, it is merely printed as input. % \begin{macrocode} \CustomizeMathJax{\newcommand{\numlist}[2][]{\mathrm{#2}}} -\CustomizeMathJax{\newcommand{\numrange}[3][]{\mathrm{#2\,\unicode{x2013}\,#3}}} +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\numrange} \oarg{options} \marg{value1} \marg{value2} +% +% \cs{numrange} should only be used in text mode. +% If used in \brand{MathJax} math, an en-dash is used instead of the \optn{range-phase}. +% \changes{v0.89}{2020/08/02}{\pkg{siunitx}: Unicode for endash.} +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\numrange}[3][]{\num{#2}\,\unicode{x2013}\,\num{#3}}} +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\SIlist} \oarg{options} \marg{list} +% +% \cs{SIlist} and \cs{SIrange} should only be used in text mode. +% If used in \brand{MathJax}, a simple emulation is provided. +% \begin{macrocode} \CustomizeMathJax{\newcommand{\SIlist}[3][]{\mathrm{#2\,#3}}} -\CustomizeMathJax{\newcommand{\SIrange}[4][]{\mathrm{#2\,#4\,\unicode{x2013}\,#3\,#4}}} +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\SIrange} \oarg{options} \marg{value1} \marg{value2} \marg{unit} +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\SIrange}[4][]{\num{#2}\,#4\,\unicode{x2013}\,\num{#3}\,#4}} +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\tablenum} \oarg{options} \marg{value} +% \begin{macrocode} \CustomizeMathJax{\newcommand{\tablenum}[2][]{\mathrm{#2}}} +% \end{macrocode} +% \end{noindmacro} % +% \begin{macrocode} \CustomizeMathJax{\newcommand{\ampere}{\mathrm{A}}} \CustomizeMathJax{\newcommand{\candela}{\mathrm{cd}}} \CustomizeMathJax{\newcommand{\kelvin}{\mathrm{K}}} @@ -75403,6 +76786,382 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % \iffalse +%<*skmath> +% \fi +% +% \part{lwarp-skmath.sty} +% +% \section{skmath} +% +% \credits{Simon Sigurdhsson} +% +% \DescribePackage{skmath} +% \pkg{skmath} is used as-is for \SVG\ math, +% and is emulated for \brand{MathJax}. +% +% \changes{v0.895}{2021/01/13}{\pkg{skmath}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{skmath}[2019/10/15] +% \end{macrocode} +% +% Only defined if package option requested: +% \begin{macrocode} +\begin{warpMathJax} +\ExplSyntaxOn +\bool_if:NT\g__skmath_define_common_sets_bool{ +\CustomizeMathJax{\newcommand{\N}{\mathbb{N}}} +\CustomizeMathJax{\newcommand{\Z}{\mathbb{Z}}} +\CustomizeMathJax{\newcommand{\Q}{\mathbb{Q}}} +\CustomizeMathJax{\newcommand{\R}{\mathbb{R}}} +\CustomizeMathJax{\newcommand{\C}{\mathbb{C}}} +} +% \end{macrocode} +% +% \pkg{skmath} is using \pkg{l3keys}, which does not seem to have +% an equivalent to \cs{@ifpackagewith}. +% To detect package options, comparisons with the following are made to see if +% various macros have been defined as follows: +% \begin{macrocode} +\cs_gset_nopar:Npn\LWR__skmath_imaginary_unit:n#1{{#1}} +\cs_gset_nopar:Npn\LWR__skmath_natural_log_e:{{e}} +\cs_gset_nopar:Npn\LWR__skmath_integral_d:{{d}} +\cs_gset_nopar:Npn\LWR__skmath_total_derivative_d:{{d}} +% \end{macrocode} +% +% If \optn{notation=iso}, use upright, else italic: +% \begin{macrocode} +\cs_if_eq:NNTF \__skmath_imaginary_unit:n \LWR__skmath_imaginary_unit:n + { + \CustomizeMathJax{\newcommand{ii}{\mathit{i}}} + \CustomizeMathJax{\newcommand{jj}{\mathit{j}}} + } + { + \CustomizeMathJax{\newcommand{ii}{\mathrm{i}}} + \CustomizeMathJax{\newcommand{jj}{\mathrm{j}}} + } +% \end{macrocode} +% +% If \optn{notation=iso}, use upright, else italic: +% \begin{macrocode} +\cs_if_eq:NNTF \__skmath_natural_log_e: \LWR__skmath_natural_log_e: + { \CustomizeMathJax{\newcommand{\ee}{\mathit{e}}} } + { \CustomizeMathJax{\newcommand{\ee}{\mathrm{e}}} } +% \end{macrocode} +% +% \pkg{skmath} uses \cs{DeclarePairedDelimiter} from \pkg{mathtools} +% for \cs{abs} and \cs{norm}, +% and \pkg{lwarp} uses this to automatically define \brand{MathJax} definitions for +% each. +% +% If \optn{notation=english}, use slanted, else upright: +% \begin{macrocode} +\cs_if_eq:NNTF \__skmath_integral_d: \LWR__skmath_integral_d: + { \CustomizeMathJax{\newcommand{\d}{\mathit{d}}} } + { \CustomizeMathJax{\newcommand{\d}{\mathrm{d}}} } +% \end{macrocode} +% +% Used to parse comma and caret arguments for \cs{pd} and \cs{td}: +% \begin{macrocode} +\CustomizeMathJax{\def\LWRskmathEND{}} +% \end{macrocode} +% +% Parse the arguments with up to four commas. +% Argument 6 contains any leftover commas. +% \begin{macrocode} +\CustomizeMathJax{\def\LWRskmathpdstarsub#1#2,#3,#4,#5,#6\LWRskmathEND{ + #1_{#2#3#4#5}% +}} + +\CustomizeMathJax{\newcommand{\LWRskmathpdstar}[2]{% + \LWRskmathpdstarsub{#1}#2,,,,\LWRskmathEND% +}} +% \end{macrocode} +% +% Parse the arguments with up to two carets. +% Argument 3 contains any leftover carets. +% \cs{LWRskmathpdplus} is used to only place a plus sign +% starting after the first term. +% \cs{LWRskmathpdone} is used to only place a |1| digit if +% a second or later term does not have a power. +% \begin{macrocode} +\CustomizeMathJax{\def\LWRskmathpdnumerator#1^#2^#3\LWRskmathEND{% + \ifblank{#1}{}{ + \ifblank{#2}{\LWRskmathpdplus\LWRskmathpdone}{\LWRskmathpdplus#2} + } +}} +% \end{macrocode} +% +% Parse the arguments with up to two carets. +% Argument 3 contains any leftover carets. +% \begin{macrocode} +\CustomizeMathJax{\def\LWRskmathpddenominator#1^#2^#3\LWRskmathEND{% + \ifblank{#1}{}{% + \ifblank{#2}% + {\partial{#1}}% + {\partial{#1}^{#2}}% + }% +}} +% \end{macrocode} +% +% Factored from \cs{LWRskmathpdnostarsub}, following: +% +% The phrase |^{}| appears to be required while +% parsing the carets. +% \cs{LWRskmathpdplus} is used to only place a plus sign +% starting after the first term. +% \cs{LWRskmathpdone} is used to only place a |1| digit if +% a second or later term does not have a power. +% +% This may not be recursion-safe. +% (Is there really such as a thing as nested differentials?) +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathdonumerator}[5]{% + \partial^{% + \def\LWRskmathpdplus{}% + \LWRskmathpdnumerator#2^{}^{}\LWRskmathEND% + \def\LWRskmathpdplus{+}% + \def\LWRskmathpdone{1}% + \LWRskmathpdnumerator#3^{}^{}\LWRskmathEND% + \LWRskmathpdnumerator#4^{}^{}\LWRskmathEND% + \LWRskmathpdnumerator#5^{}^{}\LWRskmathEND% + }% + {#1}% +}} + +\CustomizeMathJax{\newcommand{\LWRskmathdodenominator}[4]{% + \LWRskmathpddenominator#1^{}^{}^{}\LWRskmathEND% + \ifblank{#2}{}{\,}% + \LWRskmathpddenominator#2^{}^{}^{}\LWRskmathEND% + \ifblank{#3}{}{\,}% + \LWRskmathpddenominator#3^{}^{}^{}\LWRskmathEND% + \ifblank{#4}{}{\,}% + \LWRskmathpddenominator#4^{}^{}^{}\LWRskmathEND% +}} +% \end{macrocode} +% +% Parse the arguments with up to four commas. +% Argument 6 contains any leftover commas. +% \begin{macrocode} +\CustomizeMathJax{\def\LWRskmathpdnostarsub#1#2,#3,#4,#5,#6\LWRskmathEND{ + \ifblank{#3}{\def\LWRskmathpdone{}}{\def\LWRskmathpdone{1}} + \frac% + {\LWRskmathdonumerator{#1}{#2}{#3}{#4}{#5}}% + {\LWRskmathdodenominator{#2}{#3}{#4}{#5}}% +}} + +\CustomizeMathJax{\newcommand{\LWRskmathpdnostar}[2]{% + \LWRskmathpdnostarsub{#1}#2,,,,,,\LWRskmathEND% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\pd}{\ifstar\LWRskmathpdstar\LWRskmathpdnostar}} +% \end{macrocode} +% +% If \optn{notation=english} or \optn{legacy}, use slanted, else upright: +% \begin{macrocode} +\cs_if_eq:NNTF \__skmath_total_derivative_d: \LWR__skmath_total_derivative_d: + { \CustomizeMathJax{\newcommand{\LWRskmathtd}{\mathit{d}}} } + { \CustomizeMathJax{\newcommand{\LWRskmathtd}{\mathrm{d}}} } +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\def\LWRskmathtdsub#1#2^#3\LWRskmathEND{% + \frac + {\LWRskmathtd^{#3}{#1}} + {\LWRskmathtd{#2}^{#3}} +}} + +\CustomizeMathJax{\newcommand{\td}[2]{% + \LWRskmathtdsub{#1}#2^{}\LWRskmathEND% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\E}[1]{% + \operatorname{E}\left[#1\right]% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\let\given\mid} + +\CustomizeMathJax{\newcommand{\P}[1]{% + \operatorname{P}% + \left(#1\right)% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\var}[1]{% + \operatorname{Var}\left(#1\right)% +}} + +\CustomizeMathJax{\newcommand{\cov}[2]{% + \operatorname{Cov}\left(#1,#2\right)% +}} +% \end{macrocode} +% +% Common code for \cs{sin} etc: +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathtrigtwo}[2][]{% + \ifblank{#1}{}{^{#1}}% + \ifblank{#2}{}{\left(#2\right)}% +}} + +\CustomizeMathJax{\newcommand{\LWRskmathtrig}[1]{% + \operatorname{#1}% + \LWRskmathtrigtwo% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\renewcommand{\sin}{\LWRskmathtrig{sin}}} +\CustomizeMathJax{\renewcommand{\arcsin}{\LWRskmathtrig{arcsin}}} + +\CustomizeMathJax{\renewcommand{\cos}{\LWRskmathtrig{cos}}} +\CustomizeMathJax{\renewcommand{\arccos}{\LWRskmathtrig{arccos}}} + +\CustomizeMathJax{\renewcommand{\tan}{\LWRskmathtrig{tan}}} +\CustomizeMathJax{\renewcommand{\arctan}{\LWRskmathtrig{arctan}}} + +\CustomizeMathJax{\renewcommand{\cot}{\LWRskmathtrig{cot}}} + +\CustomizeMathJax{\renewcommand{\sinh}{\LWRskmathtrig{sinh}}} +\CustomizeMathJax{\renewcommand{\cosh}{\LWRskmathtrig{cosh}}} +\CustomizeMathJax{\renewcommand{\tanh}{\LWRskmathtrig{tanh}}} +% \end{macrocode} +% +% Common code for \cs{ln} and \cs{log}: +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathlogtwo}[2][]{% + \ifblank{#1}{}{_{#1}}% + \ifblank{#2}{}{\left(#2\right)}% +}} + +\CustomizeMathJax{\newcommand{\LWRskmathlog}[1]{% + \operatorname{#1}% + \LWRskmathlogtwo% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\renewcommand{\ln}{\LWRskmathlog{ln}}} +\CustomizeMathJax{\renewcommand{\log}{\LWRskmathlog{log}}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathexpparens}[1]{% + \operatorname{exp}% + \ifblank{#1}{}{\left(#1\right)}% +}} +% \end{macrocode} +% +% See the \pkg{skmath} source for the original of the following: +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathexpnostar}[1]{% + \mathchoice + {\ee^{#1}} + {\LWRskmathexpparens{#1}} + {\LWRskmathexpparens{#1}} + {\LWRskmathexpparens{#1}} +}} + +\CustomizeMathJax{\renewcommand{\exp}{\ifstar\LWRskmathexpparens\LWRskmathexpnostar}} +% \end{macrocode} +% +% Common code for \cs{min} etc: +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathminstar}[2][]{% + \operatorname{\LWRskmathminname}% + \ifblank{#1}{}{% + _{\mathchoice{\mathclap{#1}}{#1}{#1}{#1}} + }% + \ifblank{#2}{}{#2}% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathminnostar}[2][]{% + \ifblank{#1}% + {\operatorname{\LWRskmathminname}}% + {% + \underset% + {\mathchoice{\mathclap{#1}}{#1}{#1}{#1}}% + {\operatorname{\LWRskmathminname}}% + }% + \ifblank{#2}{}{\left\{#2\right\}}% +}} +% \end{macrocode} +% +% \cs{LWRskmathminname} seems to be recursion-safe since it is used immediately. +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRskmathmin}[1]{% + \def\LWRskmathminname{#1}% + \ifstar\LWRskmathminstar\LWRskmathminnostar% +}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\renewcommand{\min}{\LWRskmathmin{min}}} +\CustomizeMathJax{\renewcommand{\argmin}{\arg\LWRskmathmin{min}}} + +\CustomizeMathJax{\renewcommand{\max}{\LWRskmathmin{max}}} +\CustomizeMathJax{\renewcommand{\argmax}{\arg\LWRskmathmin{max}}} +\CustomizeMathJax{\renewcommand{\sup}{\LWRskmathmin{sup}}} +\CustomizeMathJax{\renewcommand{\inf}{\LWRskmathmin{inf}}} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{\let\bar\overline} + +\CustomizeMathJax{\let\vec\boldsymbol} +% \end{macrocode} +% +% Remember the original definitions: +% \begin{macrocode} +\CustomizeMathJax{\let\LWRskmathRe\Re} +\CustomizeMathJax{\let\LWRskmathIm\Im} +% \end{macrocode} +% +% Redefine depending on \optn{notation=iso}: +% \begin{macrocode} +\bool_if:NTF\g__skmath_iso_complex_parts_bool{ + \CustomizeMathJax{\renewcommand{\Re}[1]{% + \LWRskmathRe% + \ifblank{#1}{}{\left(#1\right)}% + }} + \CustomizeMathJax{\renewcommand{\Im}[1]{% + \LWRskmathIm% + \ifblank{#1}{}{\left(#1\right)}% + }} +}{ + \CustomizeMathJax{\renewcommand{\Re}[1]{% + \operatorname{Re}% + \ifblank{#1}{}{#1}% + }} + \CustomizeMathJax{\renewcommand{\Im}[1]{% + \operatorname{Im}% + \ifblank{#1}{}{#1}% + }} +} + +\ExplSyntaxOff +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% +% \iffalse %<*slantsc> % \fi % @@ -78507,6 +80266,110 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % \iffalse +%<*tensor> +% \fi +% +% \part{lwarp-tensor.sty} +% +% \section{tensor} +% +% \credits{Philip G. Ratcliffe} +% +% \DescribePackage{tensor} +% \pkg{tensor} is used as-is for \SVG\ math, and +% is emulated for \brand{MathJax}. +% +% Compressed spacing and left justification are not possible with \brand{MathJax}. +% \trouble[spacing]{tensor=\pkg{tensor}} +% +% \changes{v0.895}{2021/01/23}{\pkg{tensor}: Added \brand{MathJax}.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{tensor}[2004/12/20] +% \end{macrocode} +% +% For \brand{MathJax}. +% Special handling is required to parse the superscript and subscript arguments. +% +% When a superscript or subscript is seen, it is processed and then the +% remainder is processesed recursively. +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\def\LWRtensorindicesthreesub#1#2{{_{#2}}\LWRtensorindicesthree}} +\CustomizeMathJax{\def\LWRtensorindicesthreesup#1#2{{^{#2}}\LWRtensorindicesthree}} +% \end{macrocode} +% +% If not a superscript nor a subscript, processing stops. +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRtensorindicesthreenotsup}{}} +% \end{macrocode} +% +% Check ahead for a superscript or a subscript. +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRtensorindicesthreenotsub}{ + \ifnextchar ^ \LWRtensorindicesthreesup \LWRtensorindicesthreenotsup +}} + +\CustomizeMathJax{\newcommand{\LWRtensorindicesthree}{ + \ifnextchar _ \LWRtensorindicesthreesub \LWRtensorindicesthreenotsub +}} +% \end{macrocode} +% +% Ignore star. +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRtensorindicestwo}{ + \ifstar\LWRtensorindicesthree\LWRtensorindicesthree +}} +% \end{macrocode} +% +% Remove the outer brace of the argument. +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\indices}[1]{\LWRtensorindicestwo#1}} +% \end{macrocode} +% +% Attempting to use \cs{vphantom} here does not work: +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\LWRtensortwo}[3][]{{}\indices{#1}{#2}\indices{#3}}} +% \end{macrocode} +% +% Ignore star. +% \begin{macrocode} +\CustomizeMathJax{\newcommand{\tensor}{\ifstar\LWRtensortwo\LWRtensortwo}} +% \end{macrocode} +% +% In text mode, \cs{nuclide} is converted to an \SVG\ image. +% \begin{macrocode} +\CustomizeMathJax{% + \newcommand{\LWRnuclidetwo}[2][]{% + {% + \vphantom{\mathrm{#2}}% + {}^{\LWRtensornucleonnumber}_{#1}% + \mathrm{#2}% + }% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\CustomizeMathJax{% + \newcommand{\nuclide}[1][]{% + \def\LWRtensornucleonnumber{#1}% + \LWRnuclidetwo% + }% +} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% \iffalse %<*termcal> % \fi % @@ -79767,6 +81630,42 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % +% \iffalse +%<*tikz-imagelabels> +% \fi +% +% \part{lwarp-tikz-imagelabels.sty} +% +% \section{tikz-imagelabels} +% +% \credits{Tobias Plüss} +% +% \DescribePackage{tikz-imagelabels} +% \pkg{tikz-imagelabels} is patched for use by \pkg{lwarp}. +% +% \changes{v0.895}{2021/01/19}{\pkg{tikz-imagelabels}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{tikz-imagelabels}[2019/06/27] +% \end{macrocode} +% +% \begin{macrocode} +\BeforeBeginEnvironment{annotationimage}{% + \begin{lateximage}[-tikz-imagelabels-~\PackageDiagramAltText]% +} + +\AfterEndEnvironment{annotationimage}{\end{lateximage}} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% % % % \iffalse @@ -82333,7 +84232,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % and thus not display correctly in \brand{MathJax}. % % Symbol font commands are emulated, but not all combinations are -% supported by MathJax, especially with the dedicated Greek macros. +% supported by \brand{MathJax}, especially with the dedicated Greek macros. % Symbol macros such as \cs{symbfsf} may not be sans or bold. % For Greek, use the Unicode equivalent, if necessary. % @@ -82661,7 +84560,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \LWR@formatted{unitfrac} % \end{macrocode} % -% For Mathjax: +% For \brand{Mathjax}: % \changes{v0.891}{2020/09/08}{\pkg{units}: Added \cs{mathinner}, improved fraction.} % \begin{macrocode} \begin{warpMathJax} @@ -84008,7 +85907,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \begin{macrocode} \DeclareDocumentCommand{\LWR@textcurrentcolor}{m}{% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \LWR@findcurrenttextcolor% \InlineClass[color:\LWR@origpound\LWR@tempcolor]{textcolor}{% \renewcommand*{\LWR@currenttextcolor}{\LWR@origpound\LWR@tempcolor}% @@ -84030,7 +85929,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \begin{macrocode} \NewDocumentCommand{\LWR@colorstyle}{m m}{% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% % \end{macrocode} % Use the \pkg{xcolor} package to convert to an \HTML\ color space: % \begin{macrocode} @@ -84055,7 +85954,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \begin{macrocode} \NewDocumentCommand{\LWR@backgroundcolor}{O{named} m m}{% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \InlineClass[background:\LWR@colorstyle{#1}{#2}]{backgroundcolor}{% #3% }% @@ -84122,7 +86021,7 @@ padding:\LWR@printlength{\fboxsep}% % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@textcolor}{o m m}{% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \IfValueTF{#1}{% \color[#1]{#2}% }{% @@ -84166,7 +86065,7 @@ padding:\LWR@printlength{\fboxsep}% % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@colorbox}{O{named} m +m}{% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \InlineClass[% background:\LWR@colorstyle{#1}{#2} ; % padding:\LWR@printlength{\fboxsep}% @@ -84189,7 +86088,7 @@ padding:\LWR@printlength{\fboxsep}% % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@colorboxBlock}{O{named} m +m}{% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% % \end{macrocode} % \changes{v0.62}{2018/11/11}{\pkg{xcolor}: Fix: Horiz white space.} % \begin{macrocode} @@ -84231,7 +86130,7 @@ padding:\LWR@printlength{\fboxsep}% \NewDocumentCommand{\LWR@HTML@fcolorbox}{O{named} m O{#1} m +m}{% \LWR@traceinfo{HTML fcolorbox #2 #4}% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \LWR@forceminwidth{\fboxrule}% \ifthenelse{\equal{#4}{none}}% {% no background color @@ -84267,7 +86166,7 @@ padding:\LWR@printlength{\fboxsep}% \NewDocumentCommand{\LWR@HTML@fcolorboxBlock}{O{named} m O{#1} m +m}{% \LWR@traceinfo{HTML fcolorboxBlock #2 #4}% \begingroup% -\LWR@FBcancel% +\LWR@hook@processingtags% \LWR@forceminwidth{\fboxrule}% % \end{macrocode} % \changes{v0.62}{2018/11/11}{\pkg{xcolor}: Fix: Horiz white space.} @@ -84345,7 +86244,7 @@ width:\LWR@printlength{\LWR@tempwidth}% % \begin{macrocode} \NewDocumentEnvironment{LWR@HTML@fcolorminipage}{O{named} m O{#1} m O{c} o o m} {% -\LWR@FBcancel% +\LWR@hook@processingtags% \setlength{\LWR@tempwidth}{#8}% \IfValueT{#6}{\setlength{\LWR@tempheight}{#6}}% \LWR@forceminwidth{\fboxrule}% @@ -84625,6 +86524,42 @@ height:\LWR@printlength{\LWR@tempheight}% % % % \iffalse +%<*xevlna> +% \fi +% +% \part{lwarp-xevlna.sty} +% +% \section{xevlna} +% +% \credits{Zdeněk Wagner} +% +% \DescribePackage{xevlna} +% \pkg{xevlna} is patched for use by \pkg{lwarp}. +% +% Non-breakable spaces are inserted into \HTML. +% +% \changes{v0.895}{2021/01/13}{\pkg{xevlna}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{xevlna}[2016/09/05] +% \end{macrocode} +% +% \begin{macrocode} +\def\ProcessCSpreposition{\ifx\next\xevlnaXeTeXspace\HTMLentity{nbsp}\fi} + +\appto{\LWR@hook@processingtags}{\xevlnaDisable}% +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% \iffalse %<*xfakebold> % \fi % diff --git a/macros/latex/contrib/lwarp/lwarp.ins b/macros/latex/contrib/lwarp/lwarp.ins index 22bd7d3004..97c0deaed8 100644 --- a/macros/latex/contrib/lwarp/lwarp.ins +++ b/macros/latex/contrib/lwarp/lwarp.ins @@ -51,6 +51,7 @@ version 2005/12/01 or later. \file{lwarp-algorithm2e.sty}{\from{lwarp.dtx}{algorithm2e}} \file{lwarp-algorithmicx.sty}{\from{lwarp.dtx}{algorithmicx}} \file{lwarp-alltt.sty}{\from{lwarp.dtx}{alltt}} +\file{lwarp-amscdx.sty}{\from{lwarp.dtx}{amscdx}} \file{lwarp-amsmath.sty}{\from{lwarp.dtx}{amsmath}} \file{lwarp-amsthm.sty}{\from{lwarp.dtx}{amsthm}} \file{lwarp-anonchap.sty}{\from{lwarp.dtx}{anonchap}} @@ -159,6 +160,7 @@ version 2005/12/01 or later. \file{lwarp-enumerate.sty}{\from{lwarp.dtx}{enumerate}} \file{lwarp-enumitem.sty}{\from{lwarp.dtx}{enumitem}} \file{lwarp-epigraph.sty}{\from{lwarp.dtx}{epigraph}} +\file{lwarp-epsf.sty}{\from{lwarp.dtx}{epsf}} \file{lwarp-epsfig.sty}{\from{lwarp.dtx}{epsfig}} \file{lwarp-epstopdf.sty}{\from{lwarp.dtx}{epstopdf}} \file{lwarp-epstopdf-base.sty}{\from{lwarp.dtx}{epstopdf-base}} @@ -254,6 +256,8 @@ version 2005/12/01 or later. \file{lwarp-index.sty}{\from{lwarp.dtx}{index}} \file{lwarp-inputtrc.sty}{\from{lwarp.dtx}{inputtrc}} \file{lwarp-intopdf.sty}{\from{lwarp.dtx}{intopdf}} +\file{lwarp-isomath.sty}{\from{lwarp.dtx}{isomath}} +\file{lwarp-isotope.sty}{\from{lwarp.dtx}{isotope}} \file{lwarp-jurabib.sty}{\from{lwarp.dtx}{jurabib}} \file{lwarp-karnaugh-map.sty}{\from{lwarp.dtx}{karnaugh-map}} \file{lwarp-keyfloat.sty}{\from{lwarp.dtx}{keyfloat}} @@ -274,6 +278,7 @@ version 2005/12/01 or later. \file{lwarp-listliketab.sty}{\from{lwarp.dtx}{listliketab}} \file{lwarp-lltjext.sty}{\from{lwarp.dtx}{lltjext}} \file{lwarp-longtable.sty}{\from{lwarp.dtx}{longtable}} +\file{lwarp-lpic.sty}{\from{lwarp.dtx}{lpic}} \file{lwarp-lscape.sty}{\from{lwarp.dtx}{lscape}} \file{lwarp-ltablex.sty}{\from{lwarp.dtx}{ltablex}} \file{lwarp-ltcaption.sty}{\from{lwarp.dtx}{ltcaption}} @@ -285,6 +290,7 @@ version 2005/12/01 or later. \file{lwarp-luamplib.sty}{\from{lwarp.dtx}{luamplib}} \file{lwarp-luatexko.sty}{\from{lwarp.dtx}{luatexko}} \file{lwarp-luatodonotes.sty}{\from{lwarp.dtx}{luatodonotes}} +\file{lwarp-luavlna.sty}{\from{lwarp.dtx}{luavlna}} \file{lwarp-lyluatex.sty}{\from{lwarp.dtx}{lyluatex}} \file{lwarp-magaz.sty}{\from{lwarp.dtx}{magaz}} \file{lwarp-makeidx.sty}{\from{lwarp.dtx}{makeidx}} @@ -304,8 +310,11 @@ version 2005/12/01 or later. \file{lwarp-mathptmx.sty}{\from{lwarp.dtx}{mathptmx}} \file{lwarp-mathspec.sty}{\from{lwarp.dtx}{mathspec}} \file{lwarp-mathtools.sty}{\from{lwarp.dtx}{mathtools}} +\file{lwarp-mattens.sty}{\from{lwarp.dtx}{mattens}} +\file{lwarp-maybemath.sty}{\from{lwarp.dtx}{maybemath}} \file{lwarp-mcaption.sty}{\from{lwarp.dtx}{mcaption}} \file{lwarp-mdframed.sty}{\from{lwarp.dtx}{mdframed}} +\file{lwarp-mdwmath.sty}{\from{lwarp.dtx}{mdwmath}} \file{lwarp-media9.sty}{\from{lwarp.dtx}{media9}} \file{lwarp-memhfixc.sty}{\from{lwarp.dtx}{memhfixc}} \file{lwarp-menukeys.sty}{\from{lwarp.dtx}{menukeys}} @@ -391,6 +400,7 @@ version 2005/12/01 or later. \file{lwarp-physunits.sty}{\from{lwarp.dtx}{physunits}} \file{lwarp-picinpar.sty}{\from{lwarp.dtx}{picinpar}} \file{lwarp-pifont.sty}{\from{lwarp.dtx}{pifont}} +\file{lwarp-pinlabel.sty}{\from{lwarp.dtx}{pinlabel}} \file{lwarp-placeins.sty}{\from{lwarp.dtx}{placeins}} \file{lwarp-plarydshln.sty}{\from{lwarp.dtx}{plarydshln}} \file{lwarp-plext.sty}{\from{lwarp.dtx}{plext}} @@ -421,6 +431,7 @@ version 2005/12/01 or later. \file{lwarp-repltext.sty}{\from{lwarp.dtx}{repltext}} \file{lwarp-resizegather.sty}{\from{lwarp.dtx}{resizegather}} \file{lwarp-returntogrid.sty}{\from{lwarp.dtx}{returntogrid}} +\file{lwarp-rlepsf.sty}{\from{lwarp.dtx}{rlepsf}} \file{lwarp-rmathbr.sty}{\from{lwarp.dtx}{rmathbr}} \file{lwarp-rmpage.sty}{\from{lwarp.dtx}{rmpage}} \file{lwarp-romanbar.sty}{\from{lwarp.dtx}{romanbar}} @@ -457,6 +468,7 @@ version 2005/12/01 or later. \file{lwarp-simplebnf.sty}{\from{lwarp.dtx}{simplebnf}} \file{lwarp-SIunits.sty}{\from{lwarp.dtx}{SIunits}} \file{lwarp-siunitx.sty}{\from{lwarp.dtx}{siunitx}} +\file{lwarp-skmath.sty}{\from{lwarp.dtx}{skmath}} \file{lwarp-slantsc.sty}{\from{lwarp.dtx}{slantsc}} \file{lwarp-slashed.sty}{\from{lwarp.dtx}{slashed}} \file{lwarp-soul.sty}{\from{lwarp.dtx}{soul}} @@ -491,6 +503,7 @@ version 2005/12/01 or later. \file{lwarp-tagpdf.sty}{\from{lwarp.dtx}{tagpdf}} \file{lwarp-tascmac.sty}{\from{lwarp.dtx}{tascmac}} \file{lwarp-tcolorbox.sty}{\from{lwarp.dtx}{tcolorbox}} +\file{lwarp-tensor.sty}{\from{lwarp.dtx}{tensor}} \file{lwarp-termcal.sty}{\from{lwarp.dtx}{termcal}} \file{lwarp-textarea.sty}{\from{lwarp.dtx}{textarea}} \file{lwarp-textcomp.sty}{\from{lwarp.dtx}{textcomp}} @@ -508,6 +521,7 @@ version 2005/12/01 or later. \file{lwarp-thumb.sty}{\from{lwarp.dtx}{thumb}} \file{lwarp-thumbs.sty}{\from{lwarp.dtx}{thumbs}} \file{lwarp-tikz.sty}{\from{lwarp.dtx}{tikz}} +\file{lwarp-tikz-imagelabels.sty}{\from{lwarp.dtx}{tikz-imagelabels}} \file{lwarp-titleps.sty}{\from{lwarp.dtx}{titleps}} \file{lwarp-titleref.sty}{\from{lwarp.dtx}{titleref}} \file{lwarp-titlesec.sty}{\from{lwarp.dtx}{titlesec}} @@ -563,6 +577,7 @@ version 2005/12/01 or later. \file{lwarp-xechangebar.sty}{\from{lwarp.dtx}{xechangebar}} \file{lwarp-xellipsis.sty}{\from{lwarp.dtx}{xellipsis}} \file{lwarp-xetexko-vertical.sty}{\from{lwarp.dtx}{xetexko-vertical}} +\file{lwarp-xevlna.sty}{\from{lwarp.dtx}{xevlna}} \file{lwarp-xfakebold.sty}{\from{lwarp.dtx}{xfakebold}} \file{lwarp-xfrac.sty}{\from{lwarp.dtx}{xfrac}} \file{lwarp-xltabular.sty}{\from{lwarp.dtx}{xltabular}} diff --git a/macros/latex/contrib/lwarp/lwarp.pdf b/macros/latex/contrib/lwarp/lwarp.pdf index 5f5cf08adf..e49cbc84fb 100644 Binary files a/macros/latex/contrib/lwarp/lwarp.pdf and b/macros/latex/contrib/lwarp/lwarp.pdf differ diff --git a/macros/latex/contrib/lwarp/lwarpmk.lua b/macros/latex/contrib/lwarp/lwarpmk.lua index ce441dfd01..95c5d37a13 100755 --- a/macros/latex/contrib/lwarp/lwarpmk.lua +++ b/macros/latex/contrib/lwarp/lwarpmk.lua @@ -1,8 +1,8 @@ #!/usr/bin/env texlua --- Copyright 2016-2020 Brian Dunn +-- Copyright 2016-2021 Brian Dunn -printversion = "v0.894" +printversion = "v0.895" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () -- cgit v1.2.3