diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/latex-lab')
40 files changed, 1683 insertions, 932 deletions
diff --git a/Master/texmf-dist/tex/latex/latex-lab/bib-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/bib-latex-lab-testphase.ltx index b15043fd884..ee69798ec39 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/bib-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/bib-latex-lab-testphase.ltx @@ -33,8 +33,8 @@ %% %% %% File: latex-lab-bib.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabbibdate{2023-07-20} -\def\ltlabbibversion{0.81a} +\def\ltlabbibdate{2024-02-12} +\def\ltlabbibversion{0.81b} \ProvidesFile{bib-latex-lab-testphase.ltx} [\ltlabbibdate\space v\ltlabbibversion\space latex-lab wrapper bib] diff --git a/Master/texmf-dist/tex/latex/latex-lab/block-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/block-latex-lab-testphase.ltx index 98dd43bb43d..937f08d1e1c 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/block-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/block-latex-lab-testphase.ltx @@ -32,9 +32,9 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-block.dtx (C) Copyright 2021-2023 LaTeX Project -\def\ltlabblockdate{2023-09-01} -\def\ltlabblockversion{0.8h} +%% File: latex-lab-block.dtx (C) Copyright 2021-2024 LaTeX Project +\def\ltlabblockdate{2024-03-23} +\def\ltlabblockversion{0.8n} \ProvidesFile{block-latex-lab-testphase.ltx} [\ltlabblockdate\space v\ltlabblockversion\space blockenv implementation] diff --git a/Master/texmf-dist/tex/latex/latex-lab/documentmetadata-support.ltx b/Master/texmf-dist/tex/latex/latex-lab/documentmetadata-support.ltx index fa6a346a3a8..91ae548e191 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/documentmetadata-support.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/documentmetadata-support.ltx @@ -33,12 +33,18 @@ %% %% %% File: documentmetadata-support.dtx -\def\documentmetadatasupportversion{1.0f} -\def\documentmetadatasupportdate{2023-09-01} +\def\documentmetadatasupportversion{1.0h} +\def\documentmetadatasupportdate{2024-03-26} + \RequirePackage{pdfmanagement-testphase} \ExplSyntaxOn\makeatletter +\clist_if_exist:NF \g__pdfmanagement_firstaidoff_clist + { \clist_new:N \g__pdfmanagement_firstaidoff_clist } +\tl_if_exist:NF \g__pdfmanagement_testphase_tl + { \tl_new:N \g__pdfmanagement_testphase_tl } + \cs_set_protected:Npn \DocumentMetadata #1 { \cs_if_eq:NNTF \documentclass \@twoclasseserror @@ -54,10 +60,24 @@ \ExplSyntaxOn\makeatletter \file_input:n {l3backend-testphase-\c_sys_backend_str.def} \ExplSyntaxOff\makeatother - \keys_set_filter:nnn { document / metadata } { init } { lang=en-US, #1 } + \keys_set_filter:nnn { document / metadata } { init } { #1 } \bool_if:NT \g__pdfmanagement_active_bool { \PassOptionsToPackage{customdriver=hgeneric-testphase}{hyperref} + \g@addto@macro\@kernel@after@begindocument + { + \pdfdict_get:nnN {g__pdf_Core/Catalog}{Lang}\l__pdfmanagement_tmpa_tl + \quark_if_no_value:NT\l__pdfmanagement_tmpa_tl + { + \tl_if_empty:eTF { \BCPdata{main.language} } + { \tl_set:Ne \l__pdfmanagement_tmpb_tl { \BCPdata{language} } } + { \tl_set:Ne \l__pdfmanagement_tmpb_tl { \BCPdata{main.language} } } + \msg_warning:nne { meta } { lang-missing }{ \l__pdfmanagement_tmpb_tl } + \exp_last_unbraced:Ne + \AddToDocumentProperties{[document]{lang}{\l__pdfmanagement_tmpb_tl}} + \pdfmanagement_add:nne {Catalog} {Lang}{(\l__pdfmanagement_tmpb_tl)} + } + } } \hook_use_once:n {pdfmanagement/add} \cs_set_protected:Npn \DocumentMetadata ##1 @@ -105,7 +125,7 @@ % this uses internal command from pdfmeta, it should probably move there ... ,pdfstandard .code:n = { - \exp_args:Nnx + \exp_args:Nne \keys_set:nn {document / metadata} {_pdfstandard=\str_uppercase:n{#1}} } ,_pdfstandard .choices:nn = @@ -117,6 +137,30 @@ } \AddToDocumentProperties [document]{pdfstandard}{#1} } + ,_pdfstandard / A-4F .code:n = + { + \prop_if_exist:cTF { g__pdfmeta_standard_pdf/A-4F_prop } + { + \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4F_prop } + } + { + \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4_prop } + \prop_gput:Nnn \g__pdfmeta_standard_prop{conformance}{F} + } + \AddToDocumentProperties [document]{pdfstandard}{A-4F} + } + ,_pdfstandard / A-4E .code:n = + { + \prop_if_exist:cTF { g__pdfmeta_standard_pdf/A-4E_prop } + { + \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4E_prop } + } + { + \prop_gset_eq:Nc \g__pdfmeta_standard_prop { g__pdfmeta_standard_pdf/A-4_prop } + \prop_gput:Nnn \g__pdfmeta_standard_prop{conformance}{E} + } + \AddToDocumentProperties [document]{pdfstandard}{A-4E} + } ,_pdfstandard / unknown .code:n = { \msg_warning:nnn{pdf}{unknown-standard}{#1} @@ -130,7 +174,7 @@ { \RequirePackage{tagpdf} \AddToDocumentProperties [document]{testphase/tagpdf}{loaded} - \tagpdfsetup{activate,paratagging,interwordspace} + \tagpdfsetup{activate,para/tagging,activate/spaces} \AddToDocumentProperties [document]{tagging}{active} \AddToDocumentProperties [document]{tagging/para}{active} \AddToDocumentProperties [document]{tagging/interwordspace}{active} @@ -167,7 +211,7 @@ package/tagpdf/after } { - \tagpdfsetup{paratagging-show} + \tagpdfsetup{debug/show=para} } } ,debug / log .code:n = @@ -177,7 +221,7 @@ package/tagpdf/after } { - \tagpdfsetup{log=#1} + \tagpdfsetup{debug/log=#1} } } ,debug / tagpdf .code:n = @@ -210,6 +254,11 @@ { LaTeX-lab~package~'#1'~not~found. } +\msg_new:nnn { meta } { lang-missing } + { + The~language~has~not~been~set~in~\token_to_str:N + \DocumentMetadata.\\Setting~it~to~'#1'~as~fallback. + } \ExplSyntaxOff\makeatother \endinput %% diff --git a/Master/texmf-dist/tex/latex/latex-lab/firstaid-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/firstaid-latex-lab-testphase.ltx index f8719fcdfbf..7003ae1856d 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/firstaid-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/firstaid-latex-lab-testphase.ltx @@ -32,9 +32,9 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-firstaid.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabfirstaiddate{2023-07-20} -\def\ltlabfirstaidversion{0.85a} +%% File: latex-lab-firstaid.dtx (C) Copyright 2023-2024 LaTeX Project +\def\ltlabfirstaiddate{2024-05-25} +\def\ltlabfirstaidversion{0.85d} \ProvidesFile{firstaid-latex-lab-testphase.ltx} [\ltlabfirstaiddate\space v\ltlabfirstaidversion\space diff --git a/Master/texmf-dist/tex/latex/latex-lab/float-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/float-latex-lab-testphase.ltx index 3f8eefffbdd..59fdaa63d95 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/float-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/float-latex-lab-testphase.ltx @@ -33,8 +33,8 @@ %% %% %% File: latex-lab-float.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabfloatdate{2023-07-20} -\def\ltlabfloatversion{0.81a} +\def\ltlabfloatdate{2024-03-23} +\def\ltlabfloatversion{0.81e} \ProvidesFile{float-latex-lab-testphase.ltx} [\ltlabfloatdate\space v\ltlabfloatversion\space latex-lab wrapper float] diff --git a/Master/texmf-dist/tex/latex/latex-lab/graphic-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/graphic-latex-lab-testphase.ltx index b8d2878c302..3cc259063d4 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/graphic-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/graphic-latex-lab-testphase.ltx @@ -32,9 +32,9 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 LaTeX Project -\def\ltlabgraphicdate{2023-10-13} -\def\ltlabgraphicversion{0.80b} +%% File: latex-lab-graphic.dtx (C) Copyright 2022-2024 LaTeX Project +\def\ltlabgraphicdate{2024-03-13} +\def\ltlabgraphicversion{0.80d} \ProvidesFile{graphic-latex-lab-testphase.ltx} [\ltlabgraphicdate\space v\ltlabgraphicversion\space latex-lab wrapper graphic] diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-amsmath.ltx b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-amsmath.ltx index c2431ca4eff..cab7e10f301 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-amsmath.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-amsmath.ltx @@ -34,7 +34,7 @@ %% %% File: latex-lab-amsmath.dtx \ProvidesFile{latex-lab-amsmath.ltx} - [2023-01-05 v0.1a amsmath adaptions] + [2024-02-12 v0.1b amsmath adaptions] \RequirePackage{tagpdf-base} \ExplSyntaxOn \AddToHook{package/amsmath/after} @@ -43,7 +43,7 @@ \def\intertext##1{% \ifvmode\else\\\@empty\fi \noalign{% - \penalty\postdisplaypenalty\vskip\belowdisplayskip + \penalty\postdisplaypenalty\vskip-\belowdisplayskip \vbox{ \ifmeasuring@\tag_stop:\fi \normalbaselines @@ -51,13 +51,87 @@ \else \parshape\@ne \@totalleftmargin \linewidth \fi \tag_mc_end_push: - \tagpdfsetup{paratag=Span}% + \tagpdfsetup{para/tag=P}% + \tagpdfparaOn \noindent\ignorespaces##1\par \tag_mc_begin_pop:n{}}% \penalty\predisplaypenalty\vskip\abovedisplayskip% }% }} } +\AddToHook{package/amstext/after} + { + \tag_if_active:T + { + \sys_if_engine_luatex:TF + { + \def\text@#1{{% + \ifcase\mathstyle + \hbox{{#1}}\or + \hbox{{#1}}\or + \hbox{{#1}}\or + \hbox{{#1}}\or + \hbox{{\let\f@size\sf@size\selectfont#1}}\or + \hbox{{\let\f@size\sf@size\selectfont#1}}\or + \hbox{{\let\f@size\ssf@size\selectfont#1}}\or + \hbox{{\let\f@size\ssf@size\selectfont#1}}\or + \ERROR + \fi + \check@mathfonts + }} + } + { + \def\text@#1 + {{ + \int_gincr:N\g__math_mathchoice_int + \tag_stop: + \mathchoice + { + \__math_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{0} + \textdef@\displaystyle\f@size{#1} + } + { + \__math_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{2} + \textdef@\textstyle\f@size{\firstchoice@false #1} + } + { + \__math_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{4} + \textdef@\textstyle\sf@size{\firstchoice@false #1} + } + { + \__math_tag_if_mathstyle:en{mathchoice-\int_use:N\g__math_mathchoice_int}{6} + \textdef@\textstyle \ssf@size{\firstchoice@false #1} + } + \check@mathfonts + }} + } + } + } +\AddToHook{package/amsbsy/after} + { + \def\pmb@@#1#2#3{\leavevmode\hbox_set:Nn\l__math_tmpa_box{xxx#3} + \dimen@-\box_wd:N\l__math_tmpa_box + \kern-.5\ex@\box_use:N\l__math_tmpa_box + \tag_mc_end:\tag_mc_begin:n{artifact} + \tag_mc_reset_box:N\l__math_tmpa_box + \kern\dimen@\kern.25\ex@\raise.4\ex@\box_use:N\l__math_tmpa_box + \kern\dimen@\kern.25\ex@\box_use_drop:N\l__math_tmpa_box + \tag_mc_end:\tag_mc_begin:n{} + } + \def\pmb@#1#2{\hbox_set:Nn\l__math_tmpa_box{$\m@th#1{#2}$} + \setboxz@h{$\m@th#1\mkern.5mu$}\pmbraise@\wdz@ + \binrel@{#2} + \dimen@-\box_wd:N\l__math_tmpa_box + \binrel@@{ + \mkern-.8mu\box_use:N\l__math_tmpa_box + \tag_mc_end:\tag_mc_begin:n{artifact} + \tag_mc_reset_box:N\l__math_tmpa_box + \kern\dimen@\mkern.4mu\raise\pmbraise@\box_use:N\l__math_tmpa_box + \kern\dimen@\mkern.4mu\box_use_drop:N\l__math_tmpa_box + \tag_mc_end:\tag_mc_begin:n{} + } + } + } \ExplSyntaxOff \endinput %% diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footmisc.ltx b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footmisc.ltx index a4c95e4cb11..954efe086a5 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footmisc.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footmisc.ltx @@ -33,8 +33,8 @@ %% %% %% File: latex-lab-footnotes.dtx -\def\ltlabfootnotedate{2023-09-04} -\def\ltlabfootnoteversion{0.8c} +\def\ltlabfootnotedate{2024-03-12} +\def\ltlabfootnoteversion{0.8d} %% %% Copyright (c) 1995-2011 Robin Fairbairns @@ -306,8 +306,9 @@ \else \ifFN@hangfoot - \long\def\@makefntext#1{% + \long\def\footmisc@hang@makefntext#1{% \bgroup + \SuspendTagging{footmisc}% \setbox\@tempboxa\hbox{% \ifdim\footnotemargin>\z@ \hb@xt@\footnotemargin{\@makefnmark\hss}% @@ -322,14 +323,23 @@ \parshape \@ne \leftmargin \linewidth \footnotesize \@setpar{{\@@par}}% + \ResumeTagging{footmisc}% \leavevmode - \llap{\box\@tempboxa}% + \UseSocket{tagsupport/fntext/mark}% + {\llap{% + \ifdim\footnotemargin>\z@ + \hb@xt@\footnotemargin{\@makefnmark\hss}% + \else + \@makefnmark + \fi + }}% \parskip\hangfootparskip\relax \parindent\hangfootparindent\relax \footnotelayout#1% \par \egroup } + \let \@makefntext \footmisc@hang@makefntext \else @@ -580,7 +590,6 @@ \endgroup \@footnotemark } - \endinput %% %% End of file `latex-lab-footmisc.ltx'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footnotes.ltx b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footnotes.ltx index 38876d0c908..2277a40c6f8 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footnotes.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-footnotes.ltx @@ -33,8 +33,8 @@ %% %% %% File: latex-lab-footnotes.dtx -\def\ltlabfootnotedate{2023-09-04} -\def\ltlabfootnoteversion{0.8c} +\def\ltlabfootnotedate{2024-03-12} +\def\ltlabfootnoteversion{0.8d} \ProvidesFile{latex-lab-footnotes.ltx} [\ltlabfootnotedate\space v\ltlabfootnoteversion\space @@ -95,7 +95,9 @@ \NewHook{fntext/begin} \NewHook{fntext/end} \bool_new:N \g_fnote_debug_bool -\bool_gset_true:N \g_fnote_debug_bool + +\cs_new_protected:Npn \DebugFNotesOn { \bool_gset_true:N \g_fnote_debug_bool } +\cs_new_protected:Npn \DebugFNotesOff { \bool_gset_false:N \g_fnote_debug_bool } \cs_new_protected:Npn \__fnote_debug_footnotemark: { \bool_if:NT \g_fnote_debug_bool @@ -274,10 +276,14 @@ \tl_if_in:NnTF \l__fnote_patch_tl { \hb@xt@ } { \cs_set_eq:NN \__fnote_tmp:w \__fnote_patch_hb@xt@:w } { - \tl_if_in:NnTF \l__fnote_patch_tl { \@makefnmark } - { \cs_set_eq:NN \__fnote_tmp:w \__fnote_patch_@makefnmark:w } - { \ERROR - \cs_set_eq:NN \__fnote_tmp:w \exp_stop_f: } + \tl_if_in:NnTF \l__fnote_patch_tl { \makebox } + { \cs_set_eq:NN \__fnote_tmp:w \__fnote_patch_makebox:w } + { + \tl_if_in:NnTF \l__fnote_patch_tl { \@makefnmark } + { \cs_set_eq:NN \__fnote_tmp:w \__fnote_patch_@makefnmark:w } + { \ERROR + \cs_set_eq:NN \__fnote_tmp:w \exp_stop_f: } + } } } \tl_set:Nf \l__fnote_patch_tl @@ -289,6 +295,8 @@ { \exp_stop_f: #1 \@makefntext@processX { \hbox #2 } } \cs_new:Npn \__fnote_patch_hb@xt@:w #1 \hb@xt@ #2 # { \exp_stop_f: #1 \@makefntext@processX { \hb@xt@ #2 } } +\cs_new:Npn \__fnote_patch_makebox:w #1 \makebox #2 # + { \exp_stop_f: #1 \@makefntext@processX { \makebox #2 } } \cs_new:Npn \__fnote_patch_@makefnmark:w #1 \@makefnmark { \exp_stop_f: #1 \@makefntext@processX { \use:n } { \@makefnmark } } \cs_new:Npn \@makefntext@processX #1#2{\UseSocket{tagsupport/fntext/mark}{#1{#2}}} @@ -300,7 +308,8 @@ \cs_set_eq:NN \@makefntext \fnote_makefntext:n } { - \__fnote_patch: + \cs_if_eq:NNF \@makefntext \footmisc@hang@makefntext + { \__fnote_patch: } } } diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-kernel-changes.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-kernel-changes.sty index f2c99285c91..1282f9d899c 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-kernel-changes.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-kernel-changes.sty @@ -33,9 +33,9 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-toc-kernel-changes.dtx (C) Copyright 2022-2023 LaTeX Project -\def\ltlabkerneldate{2023-10-16} -\def\ltlabkernelversion{0.85b} +%% File: latex-lab-toc-kernel-changes.dtx (C) Copyright 2022-2024 LaTeX Project +\def\ltlabkerneldate{2024-02-12} +\def\ltlabkernelversion{0.85c} \ProvidesPackage{latex-lab-kernel-changes} [\ltlabkerneldate\space v\ltlabkernelversion\space General kernel and class changes] @@ -89,9 +89,9 @@ } } \ExplSyntaxOff -%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project -\def\ltlabsecdate{2023-10-16} -\def\ltlabsecversion{0.84b} +%% File: latex-lab-sec.dtx (C) Copyright 2022-2024 LaTeX Project +\def\ltlabsecdate{2024-02-12} +\def\ltlabsecversion{0.84c} \ifdefined\directlua \ifnum\outputmode > 0 \pdfvariable gentounicode =1 @@ -116,11 +116,11 @@ \fi \IfBooleanTF {#1} { - \tl_gset:Nx \@currentHref {#3} + \tl_gset:Ne \@currentHref {#3} } { \int_gincr:N\g__kernel_target_int - \tl_gset:Nx \@currentHref {target*.\int_use:N\g__kernel_target_int} + \tl_gset:Ne \@currentHref {target*.\int_use:N\g__kernel_target_int} } } \ExplSyntaxOff diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-math.ltx b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-math.ltx index 1ced324bb10..343a184d379 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-math.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-math.ltx @@ -33,24 +33,476 @@ %% %% %% File: latex-lab-math.dtx -\def\ltlabmathdate{2023-09-11} -\def\ltlabmathversion{0.5c} +\def\ltlabmathdate{2024-04-16} +\def\ltlabmathversion{0.5j} \ProvidesFile{latex-lab-math.ltx} [\ltlabmathdate\space v\ltlabmathversion\space Grab all the math(s) and tag it (experiments)] \AddToHook{begindocument/before}{\RequirePackage{latex-lab-testphase-block}} \ExplSyntaxOn -\tl_gput_right:Nn \@kernel@before@begindocument - { \RequirePackage { amsmath } } +\AddToHook{begindocument/before}{ \RequirePackage { amsmath } } \bool_new:N \l__math_collected_bool +\bool_new:N \l__math_fakemath_bool \tl_new:N \g__math_grabbed_env_tl \tl_new:N \g__math_grabbed_math_tl +\tl_new:N \l__math_tmpa_tl +\skip_new:N \l__math_tmpa_skip +\tl_new:N \l__math_content_alt_tl +\tl_new:N \l__math_content_actual_tl +\tl_new:N \l__math_content_AF_source_tl +\tl_new:N \l__math_content_AF_source_tmpa_tl +\tl_new:N \l__math_content_AF_mathml_tl +\cs_new_protected:Npn \__tag_tool_close_P: + { + \tag_if_active:T + { + \tag_mc_end: %end P-chunk, should perhaps be \tag_mc_end_push: ... + \__tag_gincr_para_end_int: + \__tag_check_para_end_show:nn{red}{} %debug: show para + \tag_struct_end: + } + } +\tl_new:N\l__math_attribute_class_tl +\tagpdfsetup + {role/new-attribute = {inline} {/O /Layout /Placement/Inline}, + role/new-attribute = {display} {/O /Layout /Placement/Block}, + } +\bool_new:N\l__tag_math_texsource_AF_bool +\bool_new:N\l__tag_math_texsource_pane_bool +\bool_new:N\l__tag_math_mathml_AF_bool +\bool_new:N\g__tag_math_mathml_AF_bool +\bool_new:N\l__tag_math_mathml_pane_bool +\bool_new:N\l__tag_math_alt_bool +\int_new:N\g__math_mathml_total_int +\int_new:N\g__math_mathml_int +\int_new:N\g__math_math_total_int +\int_new:N\g__math_mathml_AF_found_int +\int_new:N\g__math_mathml_AF_attached_int +\clist_new:N\l__tag_math_mathml_files_clist +\clist_put_right:Ne\l__tag_math_mathml_files_clist {\c_sys_jobname_str-mathml} + +\cs_new_protected:Npn \__math_AF_mml:nnnn #1 #2 #3 #4 + { + \int_gincr:N \g__math_mathml_total_int + \tl_if_exist:cF { g__math_mathml_#3_tl } + { + \int_gincr:N \g__math_mathml_int + \pdfdict_put:nne {l_pdffile/Filespec} {Desc}{(mathml-#1)} + \pdffile_embed_stream:nnN {#4}{mathml-#1.xml}\l__math_tmpa_tl + \bool_if:NT \l__tag_math_mathml_pane_bool + {\pdfmanagement_add:nne {Catalog/Names}{EmbeddedFiles}{\l__math_tmpa_tl}} + \tl_new:c{g__math_mathml_#3_tl} + \tl_gset_eq:cN{g__math_mathml_#3_tl}\l__math_tmpa_tl + } + } +\cs_new_protected:Npn \__math_AF_html_reader:w#1</h2>#2<p>#3</p>#4<p>#5</p>#6<math{ + \begingroup + \char_set_catcode_other:N\{ + \char_set_catcode_other:N\} + \char_set_catcode_other:N\# + \char_set_catcode_other:N\% + \__math_AF_html_reader_verb:w{#1}{#3}{#5}<math +} +\cs_new_protected:Npn\__math_AF_html_reader_verb:w#1#2#3#4~</div>{ + \endgroup + \__math_AF_mml:nnnn{#1}{#2}{#3}{#4} + } + +\socket_new:nn {tagsupport/math/mathml/write}{0} +\socket_new_plug:nnn{tagsupport/math/mathml/write}{On} + { + \str_set:NV\l__math_tmpa_str\l__math_content_AF_source_tl + \str_replace_all:Nnn\l__math_tmpa_str{&}{&} + \str_replace_all:Nnn\l__math_tmpa_str{<}{<} + \iow_now:Ne \g__math_writedummy_iow + { + \iow_newline: + <div> + \iow_newline: + <h2>\c_backslash_str mml\c_space_tl \int_use:N \g__math_math_total_int </h2> + \iow_newline: + <p>\l__math_tmpa_str</p> + \iow_newline: + <p>\l__math_content_hash_tl </p> + \iow_newline: + <math></math> + \iow_newline: + </div> + \iow_newline: + } + } + +\keys_define:nn { __tag / setup } + { + math/mathml/write-dummy .code:n = + { + \bool_gset_true:N \g__tag_math_mathml_AF_bool + \tl_if_exist:NF\g__math_writedummy_iow + { + \iow_new:N \g__math_writedummy_iow + \iow_open:Nn \g__math_writedummy_iow + { + \c_sys_jobname_str-mathml-dummy.html + } + \iow_now:Ne \g__math_writedummy_iow + { + <!DOCTYPE~html> + \iow_newline: + <html> + } + \AssignSocketPlug {tagsupport/math/mathml/write}{On} + \AddToHook{enddocument/afterlastpage} + { + \iow_now:Nn \g__math_writedummy_iow {</html>} + \iow_close:N \g__math_writedummy_iow + } + } + }, + math/mathml/write-dummy .usage:n=preamble + } +\box_new:N\l__math_tmpa_box +\cs_new_protected:Npn \__math_AF_process_mathml_files: + { + \hbox_set:Nn \l__math_tmpa_box + { + \pdfdict_put:nnn { l_pdffile/Filespec }{AFRelationship} { /Supplement } + \pdfdict_put:nne + { l_pdffile }{Subtype} + { \pdf_name_from_unicode_e:n{application/mathml+xml} } + \char_set_catcode_other:N \# + \cs_set_eq:NN\mml \__math_AF_html_reader:w + \clist_map_inline:Nn \l__tag_math_mathml_files_clist + { + \file_if_exist:nTF {##1.html} + { + \typeout{Info:~reading~mathml~file~##1} + \file_input:n {##1.html} + \bool_gset_true:N\g__tag_math_mathml_AF_bool + } + { + \typeout{Info:~mathml~file~##1~does~not~exist}%info message + } + } + } + \bool_if:NT\g__tag_math_mathml_AF_bool + { + \typeout{Info:~Activating~mathml~support} + \AssignSocketPlug{tagsupport/math/struct/begin}{test-mathml} + \AssignSocketPlug{tagsupport/math/struct/end}{test-mathml} + \AssignSocketPlug{tagsupport/math/substruct/begin}{single} + \AssignSocketPlug{tagsupport/math/substruct/end}{single} + \AddToHook{enddocument/info} + { + \iow_term:n{MathML~statistic} + \iow_term:n{================} + \iow_term:e{==>~\int_use:N\g__math_mathml_total_int\c_space_tl + MathML~fragments~read} + \iow_term:e{==>~\int_use:N\g__math_mathml_int\c_space_tl + different~MathML~fragments} + \iow_term:e{==>~\int_use:N\g__math_math_total_int\c_space_tl + math~fragments~found} + \iow_term:e{==>~\int_use:N\g__math_mathml_AF_found_int\c_space_tl + fitting~MathML~AF~found} + \iow_term:e{==>~\int_use:N\g__math_mathml_AF_attached_int\c_space_tl + MathML~AF~attached} + } + } + } +\AddToHook{begindocument}{\__math_AF_process_mathml_files:} +\int_new:N \l__math_mathstyle_int +\int_new:N \g__math_mathchoice_int +\property_new:nnnn{mathstyle}{now}{-1}{\int_use:N \l__math_mathstyle_int } +\cs_new_protected:Npn \__math_tag_if_mathstyle:nn #1 #2 + %#1 refers to label + %#2 is a number for the mathstyle (typically 0,2,4,6) + { + \int_set:Nn \l__math_mathstyle_int {#2} + \property_record:nn {#1} { mathstyle } + \int_compare:nNnTF { \property_ref:nn {#1}{ mathstyle} } = { #2 } + { \tag_start: }{ \tag_stop: } + } +\cs_generate_variant:Nn \__math_tag_if_mathstyle:nn {en} +\keys_define:nn { __tag / setup } + { + math/mathml/sources .clist_set:N = \l__tag_math_mathml_files_clist, + math/alt/use .bool_set:N = \l__tag_math_alt_bool, + viewer/pane/mathml .bool_set:N = \l__tag_math_mathml_pane_bool, + viewer/pane/mathml .initial:n = true, + viewer/pane/mathsource .bool_set:N = \l__tag_math_texsource_pane_bool, + math/mathml/AF .bool_set:N = \l__tag_math_mathml_AF_bool, + math/mathml/AF .initial:n = true, + math/tex/AF .bool_set:N = \l__tag_math_texsource_AF_bool, + math/tex/AF .initial:n = true + } +\socket_new:nn {tagsupport/math/inline/begin}{0} +\socket_new:nn {tagsupport/math/inline/end}{0} +\socket_new:nn {tagsupport/math/inline/formula/begin}{1} % +\socket_new:nn {tagsupport/math/inline/formula/end}{0} +\socket_new_plug:nnn + {tagsupport/math/inline/begin} + {MC} + {\tag_mc_end_push:} +\socket_new_plug:nnn + {tagsupport/math/inline/end} + {MC} + {\tag_mc_begin_pop:n{}} +\socket_new_plug:nnn + {tagsupport/math/inline/formula/begin} + {default} + { + \socket_use:n{tagsupport/math/content} + \socket_use:n{tagsupport/math/struct/begin} + % inner formula if multiple parts (not really implemented yet) + \socket_use:n{tagsupport/math/substruct/begin} + #1 + \socket_use:n{tagsupport/math/end} + } +\socket_new_plug:nnn + {tagsupport/math/inline/formula/end} + {default} + { + \socket_use:n{tagsupport/math/substruct/end} + \socket_use:n{tagsupport/math/struct/end} + } +\socket_new:nn {tagsupport/math/display/begin}{0} +\socket_new:nn {tagsupport/math/display/end}{0} +\socket_new:nn {tagsupport/math/display/formula/begin}{1} % +\socket_new:nn {tagsupport/math/display/formula/end}{0} + +\socket_new_plug:nnn + {tagsupport/math/display/begin} + {default} + { \__tag_tool_close_P: } +\socket_new_plug:nnn + {tagsupport/math/display/end} + {default} + { + } + +\socket_new_plug:nnn + {tagsupport/math/display/formula/begin} + {default} + { + \socket_use:n{tagsupport/math/content} + \socket_use:n{tagsupport/math/struct/begin} + \socket_use:n{tagsupport/math/substruct/begin} + #1 + \socket_use:n{tagsupport/math/end} + } +\socket_new_plug:nnn + {tagsupport/math/display/formula/end} + {default} + { + \socket_use:n{tagsupport/math/substruct/end} + \socket_use:n{tagsupport/math/struct/end} + } +\tl_new:N\l__math_content_template_tl +\tl_set:Nn \l__math_content_template_tl + { + LaTeX~ formula~ starts~ + \exp_not:N\begin{\g__math_grabbed_env_tl} + \c_space_tl + \exp_not:V\g__math_grabbed_math_tl + \c_space_tl + \exp_not:N\end{\g__math_grabbed_env_tl} + \c_space_tl LaTeX~ formula~ ends~ + } + +\tl_new:N\l__math_texsource_template_tl +\tl_const:Nn\c__math_inline_env_tl {math} +\tl_set:Nn \l__math_texsource_template_tl + { + \tl_if_eq:NNTF\g__math_grabbed_env_tl\c__math_inline_env_tl + { + $ + \exp_not:V\g__math_grabbed_math_tl + $ + } + { + \exp_not:N\begin{\g__math_grabbed_env_tl} + \exp_not:V\g__math_grabbed_math_tl + \exp_not:N\end{\g__math_grabbed_env_tl} + } + } + +\socket_new:nn {tagsupport/math/content}{0} +\socket_new_plug:nnn + {tagsupport/math/content} + {actual+source} + { + \tl_set:Ne\l__math_content_actual_tl + { + \l__math_content_template_tl + } + \tl_set:Ne \l__math_content_AF_source_tl + { + \l__math_texsource_template_tl + } + \tl_set:Nn \l__math_content_AF_mathml_tl {} + \tl_set:Nn \l__math_content_alt_tl {} + } +\socket_new_plug:nnn + {tagsupport/math/content} + {alt+source} + { + \tl_set:Ne\l__math_content_alt_tl + { + \l__math_content_template_tl + } + \tl_set:Ne \l__math_content_AF_source_tl + { + \l__math_texsource_template_tl + } + \tl_set:Nn \l__math_content_AF_mathml_tl {} + \tl_set:Nn \l__math_content_actual_tl {} + } +\socket_assign_plug:nn {tagsupport/math/content}{alt+source} +\socket_new:nn {tagsupport/math/struct/begin}{0} +\socket_new:nn {tagsupport/math/struct/end}{0} +\socket_new_plug:nnn + {tagsupport/math/struct/begin} + {default} + { + \bool_if:NTF\l__tag_math_texsource_AF_bool + { \tl_set_eq:NN \l__math_content_AF_source_tmpa_tl \l__math_content_AF_source_tl } + { \tl_clear:N \l__math_content_AF_source_tmpa_tl } + \tag_struct_begin:n + { + tag=Formula, + texsource = \l__math_content_AF_source_tmpa_tl, + title-o = \g__math_grabbed_env_tl, + actualtext = \l__math_content_actual_tl, + alt = \l__math_content_alt_tl + } + } +\socket_new_plug:nnn + {tagsupport/math/struct/end} + {default} + { \tag_struct_end: } + +\socket_assign_plug:nn {tagsupport/math/struct/begin}{default} +\socket_assign_plug:nn {tagsupport/math/struct/end}{default} +\cs_generate_variant:Nn \str_mdfive_hash:n {o} +\tl_new:N\l__math_content_hash_tl +\tl_new:N\l__math_grabbed_math_tl +\socket_new_plug:nnn + {tagsupport/math/struct/begin} + {test-mathml} + { + \int_gincr:N\g__math_math_total_int + \tl_set:Ne\l__math_content_hash_tl + {\str_mdfive_hash:o { \l__math_content_AF_source_tl }} + \tl_set_eq:NN\l__math_grabbed_math_tl\g__math_grabbed_math_tl + \tl_if_eq:NnTF\g__math_grabbed_env_tl {math} + { + \tl_set:Nn\l__math_attribute_class_tl{inline} + } + { + \tl_set:Nn\l__math_attribute_class_tl{display} + } + \bool_if:NF\l__tag_math_alt_bool + { \tl_set:Nn \l__math_content_alt_tl{} } + \tl_if_exist:cTF { g__math_mathml_ \l__math_content_hash_tl _tl } + { + \int_gincr:N\g__math_mathml_AF_found_int + \bool_if:NTF \l__tag_math_mathml_AF_bool + { + \int_gincr:N\g__math_mathml_AF_attached_int + \typeout {Inserting~mathml~with~Hash~\l__math_content_hash_tl} + } + { + \typeout {Ignoring~mathml~with~Hash~\l__math_content_hash_tl} + } + } + { + \typeout{WARNING:~mathml~missing~for~hash~\l__math_content_hash_tl} + } + \socket_use:n {tagsupport/math/mathml/write} % write hash if request + \bool_if:NTF\l__tag_math_texsource_AF_bool + { \tl_set_eq:NN \l__math_content_AF_source_tmpa_tl \l__math_content_AF_source_tl } + { \tl_clear:N \l__math_content_AF_source_tmpa_tl } + \tag_struct_begin:n + { + tag=Formula, + attribute-class=\l__math_attribute_class_tl, % + AFref = + \bool_if:NT\l__tag_math_mathml_AF_bool + { + \cs_if_exist_use:c {g__math_mathml_ \l__math_content_hash_tl _tl} + }, + texsource = \l__math_content_AF_source_tmpa_tl, % should be after mathml AF! + title-o = \g__math_grabbed_env_tl, % + alt = \l__math_content_alt_tl + } + } +\socket_new_plug:nnn + {tagsupport/math/struct/end} + {test-mathml} + { + \tag_struct_end: + } +\socket_new:nn {tagsupport/math/substruct/begin}{0} +\socket_new:nn {tagsupport/math/substruct/end}{0} +\socket_new_plug:nnn + {tagsupport/math/substruct/begin} + {default} + { \grabaformulapartandstart } +\socket_new_plug:nnn + {tagsupport/math/substruct/end} + {default} + { + \tagmcend + \if@subformulas + \tagstructend + \fi + } +\socket_assign_plug:nn {tagsupport/math/substruct/begin}{default} +\socket_assign_plug:nn {tagsupport/math/substruct/end}{default} + +\socket_new_plug:nnn + {tagsupport/math/substruct/begin} + {single} + { + \typeout{====>subpart~splitting~deactivated} + \typeout{====>grabbed~math=\meaning\g__math_grabbed_math_tl} + \tag_mc_begin:n{} + } +\socket_new_plug:nnn + {tagsupport/math/substruct/end} + {single} + { \tag_mc_end:} +\socket_new:nn {tagsupport/math/end}{0} + +\cs_new_protected:Npn \__tag_math_disable: + { + \socket_assign_plug:nn {tagsupport/math/inline/begin}{noop} + \socket_assign_plug:nn {tagsupport/math/inline/end}{noop} + \socket_assign_plug:nn {tagsupport/math/inline/formula/begin}{identity} + \socket_assign_plug:nn {tagsupport/math/inline/formula/end}{noop} + \socket_assign_plug:nn {tagsupport/math/display/begin}{noop} + \socket_assign_plug:nn {tagsupport/math/display/end}{noop} + \socket_assign_plug:nn {tagsupport/math/display/formula/begin}{identity} + \socket_assign_plug:nn {tagsupport/math/display/formula/end}{noop} + } +\cs_new_protected:Npn \__tag_math_enable: + { + \socket_assign_plug:nn {tagsupport/math/inline/begin}{MC} + \socket_assign_plug:nn {tagsupport/math/inline/end}{MC} + \socket_assign_plug:nn {tagsupport/math/inline/formula/begin}{default} + \socket_assign_plug:nn {tagsupport/math/inline/formula/end}{default} + \socket_assign_plug:nn {tagsupport/math/display/begin}{default} + \socket_assign_plug:nn {tagsupport/math/display/end}{default} + \socket_assign_plug:nn {tagsupport/math/display/formula/begin}{default} + \socket_assign_plug:nn {tagsupport/math/display/formula/end}{default} + } +\AtBeginDocument{\tag_if_active:T{\__tag_math_enable: }} \cs_new_protected:Npn \__math_process:nn #1#2 { \legacy_if:nF { measuring@ } { - \tl_if_in:nnF {#2} { \m@th } + \tl_if_in:nnTF {#2} { \m@th } + { \bool_set_true:N\l__math_fakemath_bool } { \tl_trim_spaces_apply:nN {#2} \__math_process_auxi:nn {#1} } } } @@ -70,62 +522,39 @@ \tl_if_blank:nF {#1} { \__math_process:nn { math } {#1} % $ - \legacy_if:nTF { measuring@ } - { #1 $ } - { - \tl_if_in:nnTF {#1} { \m@th } - { #1 $ } - { - \tagmcend %end P-chunk, in code: \tag_mc_end_push: - \@kernel@math@begin - #1 $ - \@kernel@math@end - \tagmcbegin{} % restart P-chunk (whatsits in pdftex) - } - } + \bool_lazy_or:nnTF + {\legacy_if_p:n { measuring@ }} + { \l__math_fakemath_bool } + { #1 $ } + { + \tag_socket_use:n {math/inline/begin} %end P-MC + \tag_socket_use:nn {math/inline/formula/begin}{#1} + $ + \tag_socket_use:n {math/inline/formula/end} + \tag_socket_use:n {math/inline/end} % restart P-MC + } } } - -\skip_new:N \l__math_tmpa_skip - \cs_new_protected:Npn \__math_grab_dollardollar:w % $$ #1 $$ { \tl_if_blank:nF {#1} { - \__math_tag_dollardollar_display:nn { equation* }{#1} - #1 + \__math_process:nn { equation* } {#1} + \socket_use:n {tagsupport/math/display/begin} + \socket_use:nn{tagsupport/math/display/formula/begin}{#1} $$ } } -\cs_new_protected:Npn \@kernel@close@P { - \tag_if_active:T - { - \tagmcend %end P-chunk, should perhaps be \tag_mc_end_push: ... - \int_gincr:N \g__tag_para_end_int - \bool_if:NT \l__tag_para_show_bool - { \tag_mc_begin:n{artifact} - \rlap{\color_select:n{red}\tiny\ \int_use:N\g__tag_para_end_int} - \tag_mc_end: - } - \tag_struct_end: - } -} - -\cs_new_protected:Npn \__math_tag_dollardollar_display:nn #1#2 { - \__math_process:nn {#1} {#2} - \@kernel@close@P - \@kernel@math@begin -%% -} - -\cs_new_protected:Npn \__math_tag_dollardollar_display_end: { - \tagpdfparaOff - \para_raw_end: - \tagpdfparaOn - \l__math_tmpa_skip \lastskip - \@kernel@math@end - \penalty \postdisplaypenalty +\cs_new_protected:Npn \__math_tag_dollardollar_display_end: + { + % \typeout{== tag dollarldollar display end} + % \ShowTagging{struct-stack} + \para_raw_end: + \tagpdfparaOn + \l__math_tmpa_skip \lastskip + \socket_use:n{tagsupport/math/display/formula/end} + \penalty \postdisplaypenalty \skip_vertical:n { -\l__math_tmpa_skip * 2 } \@doendpe % this has no \end{...} to take care of it } @@ -135,7 +564,6 @@ { \tl_if_blank:nF {#1} { - \__math_process:nn { math } {#1} $ #1 $ } \bool_set_false:N \l__math_collected_bool @@ -162,7 +590,7 @@ \keys_set:nn { __math } {#2} \cs_gset_eq:cc { __math_env_ #1 _begin: } {#1} \cs_gset_eq:cc { __math_env_ #1 _end: } { end #1 } - \ExpandArgs { nnx } \RenewDocumentEnvironment {#1} { b } + \ExpandArgs { nne } \RenewDocumentEnvironment {#1} { b } { \exp_not:N \bool_if:NTF \exp_not:N \l__math_collected_bool { @@ -171,28 +599,19 @@ \cs_if_exist:cTF { __math_env #1 _aux: } { \exp_not:c { __math_env #1 _aux: } - ####1 \exp_not:N \__math_env_end: {#1} + ##1 \exp_not:N \__math_env_end: {#1} } - { \exp_not:N \__math_process:nn {#1} {####1} } + { \exp_not:N \__math_process:nn {#1} {##1} } \exp_not:n { \@kernel@math@registered@begin } \bool_set_true:N \exp_not:N \l__math_collected_bool } \exp_not:c { __math_env_ #1 _begin: } - ####1 + ##1 \exp_not:c { __math_env_ #1 _end: } } - { - } - } - -\cs_set_protected:Npn \__cs_tmp:w #1 - { - \group_begin: - \exp_args:No \__cs_generate_internal_variant:n - { \tl_to_str:n {#1} } - \group_end: + { + } } -\__cs_tmp:w { nnxx } \cs_new_protected:Npn \math_register_halign_env:nn #1#2 { @@ -200,7 +619,7 @@ \keys_set:nn { __math } {#2} \cs_gset_eq:cc { __math_env_ #1 _begin: } {#1} \cs_gset_eq:cc { __math_env_ #1 _end: } { end #1 } - \ExpandArgs { nnxx } \RenewDocumentEnvironment {#1} { b } + \ExpandArgs { nnee } \RenewDocumentEnvironment {#1} { b } { \exp_not:N \bool_if:NTF \exp_not:N \l__math_collected_bool { @@ -209,27 +628,26 @@ \cs_if_exist:cTF { __math_env #1 _aux: } { \exp_not:c { __math_env #1 _aux: } - ####1 \exp_not:N \__math_env_end: {#1} + ##1 \exp_not:N \__math_env_end: {#1} } - { \exp_not:N \__math_process:nn {#1} {####1} } + { \exp_not:N \__math_process:nn {#1} {##1} } \exp_not:n { \@kernel@math@registered@begin } \bool_set_true:N \exp_not:N \l__math_collected_bool } \exp_not:c { __math_env_ #1 _begin: } - ####1 + ##1 + } + { + \exp_not:c { __math_env_ #1 _end: } } - { - \exp_not:c { __math_env_ #1 _end: } - } } - \cs_new_protected:Npn \math_register_odd_env:nn #1#2 { \tl_set:Nn \l__math_env_name_tl {#1} \keys_set:nn { __math } {#2} \cs_gset_eq:cc { __math_env_ #1 _begin: } {#1} \cs_gset_eq:cc { __math_env_ #1 _end: } { end #1 } - \ExpandArgs { nnxx } \RenewDocumentEnvironment {#1} { b } + \ExpandArgs { nnee } \RenewDocumentEnvironment {#1} { b } { \exp_not:N \bool_if:NTF \exp_not:N \l__math_collected_bool { @@ -238,14 +656,14 @@ \cs_if_exist:cTF { __math_env #1 _aux: } { \exp_not:c { __math_env #1 _aux: } - ####1 \exp_not:N \__math_env_end: {#1} + ##1 \exp_not:N \__math_env_end: {#1} } - { \exp_not:N \__math_process:nn {#1} {####1} } + { \exp_not:N \__math_process:nn {#1} {##1} } \exp_not:n { \@kernel@math@registered@begin } \bool_set_true:N \exp_not:N \l__math_collected_bool } \exp_not:c { __math_env_ #1 _begin: } - ####1 + ##1 } { \exp_not:c { __math_env_ #1 _end: } @@ -257,27 +675,31 @@ \cs_new:Npn \@kernel@math@registered@begin { \mode_if_vertical:TF { - \exp_args:Noo\str_if_eq:nnF \g__tag_struct_tag_tl { \l__tag_para_main_tag_tl } % needs correction! + \tag_if_active:T + { + \exp_args:Noo\str_if_eq:nnF \g__tag_struct_tag_tl { \l__tag_para_main_tag_tl } % needs correction! { \__block_beginpar_vmode: } % needs correction! + } } { - \@kernel@close@P + \__tag_tool_close_P: } - \@kernel@math@begin + \socket_use:nn{tagsupport/math/display/formula/begin}{} \tagpdfparaOff } \cs_new:Npn \@kernel@math@registered@end { \para_raw_end: \tagpdfparaOn - \@kernel@math@end + \socket_use:n{tagsupport/math/display/formula/end} \@endpetrue } \cs_new_protected:Npn \math_register_env:n #1 { \math_register_env:nn {#1} { } } + \NewDocumentCommand \RegisterMathEnvironment { O{} m } { \math_register_env:nn {#2} {#1} } \cs_new_protected:Npn \__math_env_forward:w #1 \__math_env_end: #2 @@ -311,47 +733,15 @@ { \cs_gset_protected:Npn \[ % \] { - \bool_if:NTF \l__math_collected_bool - { \begin { equation* } } - { \__math_grab_eqn:w } + \__math_grab_eqn:w + % \bool_if:NTF \l__math_collected_bool } % \[ \cs_gset_protected:Npn \] { - \bool_if:NTF \l__math_collected_bool - { \end{ equation* } } - { \@badmath } + \@badmath } } -\tl_new:N\tmpmathcontent - -\def\@kernel@math@begin { - \tl_gset:Nx\tmpmathcontent - { - LaTeX~ formula~ starts~ - \exp_not:N\begin{\g__math_grabbed_env_tl} - \space - \exp_not:V\g__math_grabbed_math_tl - \space - \exp_not:N\end{\g__math_grabbed_env_tl} - \space LaTeX~ formula~ ends~ - } - \tagstructbegin{tag=Formula, - AFinline-o=\tmpmathcontent, - title-o=\g__math_grabbed_env_tl, - actualtext=\tmpmathcontent - } - \grabaformulapartandstart -} -\def\@kernel@math@end { - \tagmcend - \if@subformulas - \tagstructend - \else - \fi - \tagstructend -} - \exp_args:No \tex_everymath:D { \tex_the:D \tex_everymath:D @@ -379,18 +769,34 @@ } \math_register_env:n { eqnarray } \math_register_env:n { eqnarray* } -\clist_map_inline:nn - { tabular } - { - \AddToHook{ env / #1 / begin } - { \bool_set_true:N \l__math_collected_bool } - } +\RequirePackage{array} +\tl_if_in:NnT\@tabular{$} + { + \def\@tabular{% + \leavevmode + \UseTaggingSocket{tbl/hmode/begin}% + \hbox \bgroup + \bool_set_true:N \l__math_collected_bool + $ + \bool_set_false:N \l__math_collected_bool + \col@sep\tabcolsep \let\d@llarbegin\begingroup + \let\d@llarend\endgroup + \@tabarray} + } \cs_new_eq:NN \__math_m@th: \m@th \cs_gset_protected:Npn \m@th { \bool_set_true:N \l__math_collected_bool \__math_m@th: } +\tl_gput_right:Nn\@kernel@before@begindocument + { + \bool_set_true:N\l__math_collected_bool + } +\tl_gput_right:Nn\@kernel@after@begindocument + { + \bool_set_false:N\l__math_collected_bool + } \tl_gput_right:Nn \@kernel@before@begindocument { \renewenvironment{gather*}{% @@ -467,6 +873,8 @@ \def\measuring@true{\let\ifmeasuring@\iftrue\tag_stop:} \math_register_halign_env:nn {align}{} \math_register_halign_env:nn {align*}{} + \math_register_halign_env:nn {alignat}{} + \math_register_halign_env:nn {alignat*}{} \math_register_halign_env:nn {flalign}{} \math_register_halign_env:nn {flalign*}{} \math_register_halign_env:nn {gather}{} @@ -487,26 +895,6 @@ \tagmcend \tagstructend \tagmcbegin{}% \fi } - \def\intertext@{% - \def\intertext##1{% - \ifvmode\else\\\@empty\fi - \noalign{% - \penalty\postdisplaypenalty\vskip-\belowdisplayskip - \vbox{ - \ifmeasuring@\tag_stop:\fi - \normalbaselines - \ifdim\linewidth=\columnwidth - \else \parshape\@ne \@totalleftmargin \linewidth - \fi - \tag_mc_end_push: - \tagpdfsetup{paratag=P}% - \tagpdfparaOn - \noindent\ignorespaces##1\par - \tag_mc_begin_pop:n{}}% - \penalty\predisplaypenalty\vskip\abovedisplayskip% - }% - } - } \@namedef{math@cr @ @ @ gather}{% \ifst@rred\nonumber\fi &\relax @@ -538,6 +926,11 @@ \restore@math@cr } +\cs_new:Npn \__math_split_at_nl:NN #1#2 { + \tl_set:Nf \l__math_tmpa_tl { + \exp_after:wN \__math_split_at_nl_first:w #1 \\ \q_nil \\ \s_stop } + \exp_after:wN \__math_split_at_nl_aux:nnNN \l__math_tmpa_tl #1 #2 +} \cs_new:Npn \__math_split_at_nl_first:w #1 \\ #2 \\ #3 \s_stop { \quark_if_nil:nTF {#2} @@ -547,8 +940,15 @@ #2 \\ #3 \s_stop } } -\cs_new:Npn \__math_split_chk_if_begin:ww #1 \begin #2 #3 \s_mark - #4 \\ \q_nil \\ \s_stop + +\cs_new_protected:Npn \__math_split_at_nl_aux:nnNN #1 #2 #3 #4 + { + \tl_gset:Nn #4 {#1} + \tl_gset:Nn #3 {#2} + } + +\cs_new:Npn \__math_split_chk_if_begin:ww + #1 \begin #2 #3 \s_mark #4 \\ \q_nil \\ \s_stop { \quark_if_nil:nTF {#2} { {#1} {#4} } @@ -558,7 +958,9 @@ { } { 1 } } } + \cs_new:Npn \__math_split_cleanup_begin_q_nil:w #1 \begin \q_nil {#1} + \cs_new:Npn \__math_split_collect_one_end:w #1 \end #2 #3 \s_stop #4 #5 { \exp_args:Nf \__math_split_check_count_begins:nnnn @@ -567,14 +969,16 @@ } \cs_new:Npn \__math_split_count_begins:n #1 { \int_eval:n { 0 \__math_split_count_begins:w #1 \begin \q_nil } } + \cs_new:Npn \__math_split_count_begins:w #1 \begin #2 { \quark_if_nil:nF {#2} { +1 \__math_split_count_begins:w } } + \cs_new:Npn \__math_split_check_count_begins:nnnn #1 #2 #3 #4 { \int_compare:nNnTF {#1} = {#2} { \exp_last_unbraced:Nf \__math_split_final_cleanup:nn - { \split:n { \__math_split_guard:n {#3} #4 } } + { \__math_split:n { \__math_split_guard:n {#3} #4 } } } { \exp_args:No \use_ii_i:nn @@ -594,28 +998,10 @@ { \exp_end: { #4 #1 } } { \__math_split_final_cleanup:w #3 \s_mark { #4 #1 #2 } } } -\NewDocumentCommand \splitnl { mm +m } - { - \tl_set:Nf \l_tmpa_tl { \split:n {#3} } - \show \l_tmpa_tl - \exp_after:wN \__splitnl_aux:nnNN \l_tmpa_tl #1 #2 - } -\cs_new:Npn \split:n #1 { +\cs_new:Npn \__math_split:n #1 { \__math_split_at_nl_first:w #1 \\ \q_nil \\ \s_stop } -\cs_new:Npn \__math_split_at_nl:NN #1#2 { - \tl_set:Nf \l_tmpa_tl { - \exp_after:wN \__math_split_at_nl_first:w #1 \\ \q_nil \\ \s_stop } - \exp_after:wN \__math_split_at_nl_aux:nnNN \l_tmpa_tl #1 #2 -} - -\cs_new_protected:Npn \__math_split_at_nl_aux:nnNN #1 #2 #3 #4 - { - \tl_gset:Nn #4 {#1} - \tl_gset:Nn #3 {#2} -} - \newif\if@subformulas \tl_new:N \result @@ -634,6 +1020,7 @@ \global\@subformulastrue \edef\resulttitle{\g__math_grabbed_env_tl\space (part)} \tagstructbegin{tag=Formula, + alt = subformula, title-o=\resulttitle } } diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathpkg.ltx b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathpkg.ltx index ca7d617a0a6..71a110c602f 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathpkg.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathpkg.ltx @@ -35,7 +35,6 @@ %% File: latex-lab-mathpkg.dtx \ProvidesFile{latex-lab-mathpkg.ltx} [2023-01-05 v0.1a mathpkg adaptions] -\RequirePackage{tagpdf-base} \AddToHook{package/breqn/after}{ \RegisterMathEnvironment{dmath} \RegisterMathEnvironment{dgroup*} @@ -46,6 +45,23 @@ \AddToHook{package/cases/after}{ \RegisterMathEnvironment{subnumcases} } +\ExplSyntaxOn +\AddToHook{package/bm/after} + { + \def\bm@pmb@@#1#2#3{{% + \hbox_set:Nn\l__math_tmpa_box{$\m@th#1#3$}% + \dimen@#2\wd\tw@ + \rlap{\box_use:N\l__math_tmpa_box}% + \tag_mc_end:\tag_mc_begin:n{artifact} + \tag_mc_reset_box:N\l__math_tmpa_box + \kern\dimen@ + \raise1.5\dimen@\rlap{\box_use:N\l__math_tmpa_box}% + \kern\dimen@ + \box_use_drop:N\l__math_tmpa_box + \tag_mc_end:\tag_mc_begin:n{}% + }} + } +\ExplSyntaxOff \endinput %% %% End of file `latex-lab-mathpkg.ltx'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathtools.ltx b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathtools.ltx index 575490f5803..43663b8f9ef 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathtools.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-mathtools.ltx @@ -60,7 +60,7 @@ \def\intertext##1{% \ifvmode\else\\\@empty\fi \noalign{% - \penalty\postdisplaypenalty\vskip\belowdisplayskip + \penalty\postdisplaypenalty\vskip-\belowdisplayskip \vskip-\lineskiplimit % CCS \vskip\normallineskiplimit % CCS \vskip\l_MT_above_intertext_sep @@ -77,7 +77,7 @@ \else \parshape\@ne \@totalleftmargin \linewidth \fi \tag_mc_end_push: - \tagpdfsetup{paratag=Span} + \tagpdfsetup{para/tag=Span} \noindent\ignorespaces##1\par \tag_mc_begin_pop:n{}}% \penalty\predisplaypenalty\vskip\abovedisplayskip% @@ -106,7 +106,8 @@ \parshape\@ne \@totalleftmargin \linewidth \MH_fi: \tag_mc_end_push: - \tagpdfsetup{paratag=Span} + \tagpdfsetup{para/tag=Span} + \tagpdfparaOn \noindent\ignorespaces#1\par \tag_mc_begin_pop:n{}} \penalty\predisplaypenalty\vskip\abovedisplayshortskip% @@ -134,7 +135,8 @@ \parshape\@ne \@totalleftmargin \linewidth \MH_fi: \tag_mc_end_push: - \tagpdfsetup{paratag=Span} + \tagpdfsetup{para/tag=P} + \tagpdfparaOn \noindent\ignorespaces#1\par \tag_mc_begin_pop:n{}}% \penalty\predisplaypenalty\vskip\abovedisplayshortskip% diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-bib.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-bib.sty index 9261393042e..4cfa0b055c8 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-bib.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-bib.sty @@ -33,8 +33,8 @@ %% %% %% File: latex-lab-bib.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabbibdate{2023-07-20} -\def\ltlabbibversion{0.81a} +\def\ltlabbibdate{2024-02-12} +\def\ltlabbibversion{0.81b} \ProvidesExplPackage {latex-lab-testphase-bib} {\ltlabbibdate} {\ltlabbibversion} {Code related to the tagging of bibliography and cite command} \RequirePackage{latex-lab-testphase-block} @@ -90,7 +90,7 @@ \AddToHookWithArguments{bibcite/before} { \tag_mc_end_push: - \exp_args:Nx\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} + \exp_args:Ne\tagstructbegin{tag=Reference,ref=cite.#1\@extra@b@citeb} \tagmcbegin{} } \AddToHookWithArguments{bibcite/after}[tag] @@ -118,7 +118,7 @@ { \leavevmode \tag_mc_end_push: - \exp_args:Nx\tag_struct_begin:n{tag=Reference,ref=cite.#1\@extra@b@citeb} + \exp_args:Ne\tag_struct_begin:n{tag=Reference,ref=cite.#1\@extra@b@citeb} \tag_mc_begin:n{} } \AddToHook{cmd/hyper@natlinkend/after} diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-block.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-block.sty index 2764ca6d8bb..a4d646636fc 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-block.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-block.sty @@ -32,18 +32,16 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-block.dtx (C) Copyright 2021-2023 LaTeX Project -\def\ltlabblockdate{2023-09-01} -\def\ltlabblockversion{0.8h} +%% File: latex-lab-block.dtx (C) Copyright 2021-2024 LaTeX Project +\def\ltlabblockdate{2024-03-23} +\def\ltlabblockversion{0.8n} \ProvidesPackage {latex-lab-testphase-block} [\ltlabblockdate\space v\ltlabblockversion\space blockenv implementation] -\RequirePackage{xtemplate} \RequirePackage{latex-lab-kernel-changes} \ExplSyntaxOn \tl_new:N \l__block_item_align_tl \tl_new:N\l__block_legacy_env_params_tl - \def\@doendpe{\@endpetrue \def\par { @@ -62,11 +60,11 @@ \cs_new_eq:NN \__kernel_displayblock_doendpe: \prg_do_nothing: \def\@endpetrue {\global\let\if@endpe\iftrue} \def\@endpefalse{\global\let\if@endpe\iffalse} -\DeclareObjectType{blockenv}{1} -\DeclareObjectType{block}{1} -\DeclareObjectType{para}{1} -\DeclareObjectType{list}{1} -\DeclareObjectType{item}{1} +\NewTemplateType{blockenv}{1} +\NewTemplateType{block}{1} +\NewTemplateType{para}{1} +\NewTemplateType{list}{1} +\NewTemplateType{item}{1} \DeclareTemplateInterface{blockenv}{display}{1} { env-name : tokenlist , @@ -119,7 +117,7 @@ item-instance : instance{item} = basic , item-skip : skip = \itemsep , item-penalty : integer = \UseName{@itempenalty} , - item-indent : length = 0pt , % was \itemindent + item-indent : length = \itemindent , label-width : length = \labelwidth , label-sep : length = \labelsep , legacy-support : boolean = false , @@ -301,14 +299,14 @@ \@definecounter {#2} \IfNoValueTF {#4} { % @ynthm - \tl_gset:cx { the #2 } + \tl_gset:ce { the #2 } { \@thmcounter{#2} } } { % @xnthm \@newctr{#1}[#4] - \tl_gset:cx { the #2 } + \tl_gset:ce { the #2 } { \expandafter\noexpand\csname the#4\endcsname \@thmcountersep @@ -517,7 +515,7 @@ fixed-word-spaces = \l__par_fixed_word_spaces_bool , % name?? final-hyphen-demerits = \finalhyphendemerits , cr-cmd = \\ , - para-class = \l_tag_para_attr_class_tl , + para-class = \l__tag_para_attr_class_tl , } { \tl_if_empty:nF {#1} { \SetTemplateKeys{para}{std}{#1} } @@ -814,8 +812,11 @@ \RenewDocumentCommand{\item}{ ={label}o } { \@inmatherr \item - \tl_if_empty:oTF \__block_item_instance:n %%FMi? - { \msg_error:nnn { __block } { item-in-nonlist } { \item[{#1}] } } + \cs_if_free:NTF \__block_item_instance:n + { + \@latex@error{Lonely~\string\item--perhaps~a~missing~ + list~environment}\@ehc + } { \legacy_if:nTF { @newlist } { \__kernel_list_item_begin: } @@ -1131,15 +1132,16 @@ \DeclareInstance{item}{description}{std} { label-format = \normalfont\bfseries #1 , + label-align = left } \tag_if_active:T { \tagpdfsetup { - newattribute = {justify} {/O /Layout /TextAlign/Justify}, - newattribute = {center} {/O /Layout /TextAlign/Center}, - newattribute = {raggedright}{/O /Layout /TextAlign/Start}, - newattribute = {raggedleft} {/O /Layout /TextAlign/End}, + role/new-attribute = {justify} {/O /Layout /TextAlign/Justify}, + role/new-attribute = {center} {/O /Layout /TextAlign/Center}, + role/new-attribute = {raggedright}{/O /Layout /TextAlign/Start}, + role/new-attribute = {raggedleft} {/O /Layout /TextAlign/End}, } } \DeclareInstance{para}{center}{std} @@ -1203,15 +1205,20 @@ { \int_compare:nNnT \l__block_flattened_level_int < 2 { - \int_gincr:N \g__tag_para_main_begin_int - \tagstructbegin{tag=\l__tag_para_main_tag_tl} + \__tag_gincr_para_main_begin_int: + \tag_struct_begin:n + { + tag=\l__tag_para_main_tag_tl, + attribute-class=\l__tag_para_main_attr_class_tl, + } + \__tag_para_main_store_struct: } } } \cs_set:Npn \__block_beginpar_hmode:N #1 { \tag_mc_end: - \int_gincr:N \g__tag_para_end_int + \__tag_gincr_para_end_int: \__block_debug_typeout:n{increment~ /P \on@line } \bool_if:NT \l__tag_para_show_bool { \tag_mc_begin:n{artifact} @@ -1234,7 +1241,7 @@ { \__block_debug_typeout:n{Structure-end~ \l__tag_para_main_tag_tl\space after~ displayblock \on@line } - \int_gincr:N \g__tag_para_main_end_int + \__tag_gincr_para_main_end_int: \tag_struct_end: %text-unit } } @@ -1257,16 +1264,21 @@ { \bool_if:NF \l__tag_para_flattened_bool { - \int_gincr:N \g__tag_para_main_begin_int - \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} + \__tag_gincr_para_main_begin_int: + \tag_struct_begin:n + { + tag=\l__tag_para_main_tag_tl, + attribute-class=\l__tag_para_main_attr_class_tl, + } + \__tag_para_main_store_struct: } } - \int_gincr:N \g__tag_para_begin_int + \__tag_gincr_para_begin_int: \__block_debug_typeout:n{increment~ P \on@line } \tag_struct_begin:n { tag=\l__tag_para_tag_tl - ,attribute-class=\l_tag_para_attr_class_tl + ,attribute-class=\l__tag_para_attr_class_tl } \__tag_check_para_begin_show:nn {green}{#1} \tag_mc_begin:n {} @@ -1274,15 +1286,20 @@ \cs_new_protected:Npn \__block_start_para_structure_unconditionally:n #1 { \bool_if:NF \l__tag_para_flattened_bool { - \int_gincr:N \g__tag_para_main_begin_int - \tag_struct_begin:n{tag=\l__tag_para_main_tag_tl} + \__tag_gincr_para_main_begin_int: + \tag_struct_begin:n + { + tag=\l__tag_para_main_tag_tl, + attribute-class=\l__tag_para_main_attr_class_tl, + } + \__tag_para_main_store_struct: } - \int_gincr:N \g__tag_para_begin_int + \__tag_gincr_para_begin_int: \__block_debug_typeout:n{increment~ P \on@line } \tag_struct_begin:n { tag=\l__tag_para_tag_tl - ,attribute-class=\l_tag_para_attr_class_tl + ,attribute-class=\l__tag_para_attr_class_tl } \__tag_check_para_begin_show:nn {green}{#1} \tag_mc_begin:n {} @@ -1292,14 +1309,14 @@ { \bool_if:NT \l__tag_para_bool { - \int_gincr:N \g__tag_para_end_int + \__tag_gincr_para_end_int: \__block_debug_typeout:n{increment~ /P \on@line } \tag_mc_end: \__tag_check_para_end_show:nn {red}{} \tag_struct_end: \bool_if:NF \l__tag_para_flattened_bool { - \int_gincr:N \g__tag_para_main_end_int + \__tag_gincr_para_main_end_int: \tag_struct_end: } } @@ -1334,7 +1351,7 @@ \DeclareRobustCommand*\begin[1]{% \UseHook{env/#1/before}% \@ifundefined{#1}% - {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}% + {\def\reserved@a{\@latex@error{Environment~#1~undefined}\@eha}}% {\def\reserved@a{\def\@currenvir{#1}% \edef\@currenvline{\on@line}% \@execute@begin@hook{#1}% @@ -1349,7 +1366,7 @@ { \bool_if:NF \l__tag_para_flattened_bool { - \int_gincr:N \g__tag_para_main_end_int + \__tag_gincr_para_main_end_int: \tag_struct_end: } \@endpefalse @@ -1369,7 +1386,7 @@ \__block_debug_typeout:n{block-end \on@line} \legacy_if:nT { @endpe } { - \int_gincr:N \g__tag_para_main_end_int + \__tag_gincr_para_main_end_int: \__block_debug_typeout:n{close~ /text-unit \on@line} \tagstructend } @@ -1384,11 +1401,11 @@ { \tagpdfsetup { + role/new-attribute = {itemize}{/O /List /ListNumbering/Unordered}, + role/new-attribute = {enumerate}{/O /List /ListNumbering/Ordered}, + role/new-attribute = {description}{/O /List /ListNumbering/Description}, % default if unknown - newattribute = {list}{/O /List /ListNumbering/None}, - newattribute = {itemize}{/O /List /ListNumbering/Unordered}, - newattribute = {enumerate}{/O /List /ListNumbering/Ordered}, - newattribute = {description}{/O /List /ListNumbering/Description}, + role/new-attribute = {list}{/O /List /ListNumbering/Unordered}, } } \def\LItag{LI} @@ -1413,7 +1430,7 @@ \cs_set:Npn \__block_list_item_end: { \legacy_if:nT { @endpe } { - \int_gincr:N \g__tag_para_main_end_int + \__tag_gincr_para_main_end_int: \tagstructend % text-unit } \tagstructend \tagstructend % end LBody, LI @@ -1421,7 +1438,7 @@ \cs_set:Npn \__block_list_end: { \legacy_if:nT { @endpe } { - \int_gincr:N \g__tag_para_main_end_int + \__tag_gincr_para_main_end_int: \tagstructend % text-unit \__block_debug_typeout:n{Structure-end~ P~ at~ list-end \on@line } } diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-firstaid.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-firstaid.sty index 7ea7fe54bec..552dfee1832 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-firstaid.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-firstaid.sty @@ -32,14 +32,59 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-firstaid.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabfirstaiddate{2023-07-20} -\def\ltlabfirstaidversion{0.85a} +%% File: latex-lab-firstaid.dtx (C) Copyright 2023-2024 LaTeX Project +\def\ltlabfirstaiddate{2024-05-25} +\def\ltlabfirstaidversion{0.85d} \ProvidesPackage {latex-lab-testphase-firstaid} [% \ltlabfirstaiddate\space v\ltlabfirstaiddate\space Temporary patches to external packages needed for the tagging project] +\ExplSyntaxOn +\providecommand\FirstAidNeededT[3]{ + \exp_args:Ncx\str_if_eq:onF{ver@#1.#2}{#3} + { \typeout{==>~ First~ Aid~ for~ #1.#2~ no~ longer~ applied!^^J + \@spaces Expected:^^J + \@spaces\@spaces #3^^J + \@spaces but~ found:^^J + \@spaces\@spaces \use:c{ver@#1.#2}^^J + \@spaces so~ I'm~ assuming~ it~ got~ fixed. + } } + \exp_args:Ncx\str_if_eq:onT{ver@#1.#2}{#3} +} +\ExplSyntaxOff +\AddToHook{class/amsart/after} + {\def\@author{\authors}} +\AddToHook{class/amsbook/after} + {\def\@author{\authors}} +\AddToHook{package/verse/after}[latex-lab-firstaid]{% + \FirstAidNeededT{verse}{sty}{2014/05/10 v2.4b verse typesetting}% + {% + \AtBeginDocument{% + \renewenvironment{verse}[1][\linewidth]{% + \stepcounter{verse@envctr}% + \setcounter{poemline}{0}\refstepcounter{poemline}% + \setcounter{vslineno}{1}% + \let\\=\@vscentercr + \list{}{\itemsep \z@ + \itemindent -\vindent + \listparindent\itemindent + \parsep \stanzaskip + \ifdim #1 < \linewidth + \rightmargin \z@ + \setlength{\leftmargin}{\linewidth}% + \addtolength{\leftmargin}{-#1}% + \addtolength{\leftmargin}{-0.5\leftmargin}% + \else + \rightmargin \leftmargin + \fi + \addtolength{\leftmargin}{\vindent}}% + \item[]% + }% + {\endlist}% + }% + }% +} \AddToHook{file/blindtext.sty/after}[latex-lab-firstaid]{% \FirstAidNeededT{blindtext}{sty}{\blindfiledate\space\blindfileversion\space% blindtext-Package}% @@ -89,6 +134,31 @@ {\refstepcounter@optarg[#1]{#2}}% }% } +\ExplSyntaxOn +\AddToHook{package/booktabs/after} + { + \def\@cmidrulea{ + \multispan\@cmidla + &\multispan\@cmidlb + \unskip\hskip\cmrkern@l + { + \tag_mc_begin:n{artifact} + \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@} + \hskip\cmrkern@r + \tag_mc_end: \int_gdecr:N \g__tbl_row_int + \cr} + + \def\@cmidruleb{% + \multispan\@cmidlb + \unskip\hskip \cmrkern@l% + { + \tag_mc_begin:n{artifact} + \CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill\kern\z@} + \hskip\cmrkern@r + \tag_mc_end: \int_gdecr:N \g__tbl_row_int + \cr} + } +\ExplSyntaxOff \endinput %% %% End of file `latex-lab-testphase-firstaid.sty'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-float.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-float.sty index 8b38e4aedef..a944c944b20 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-float.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-float.sty @@ -33,8 +33,8 @@ %% %% %% File: latex-lab-float.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabfloatdate{2023-07-20} -\def\ltlabfloatversion{0.81a} +\def\ltlabfloatdate{2024-03-23} +\def\ltlabfloatversion{0.81e} \ProvidesExplPackage {latex-lab-testphase-float} {\ltlabfloatdate} {\ltlabfloatversion} {Code related to the tagging of floats} \prop_new:N \g__tag_float_sect_prop @@ -51,7 +51,7 @@ \seq_map_inline:Nn\g__tag_float_types_seq { \tag_struct_begin:n{tag=##1s,stash} - \prop_gput:Nnx\g__tag_float_sect_prop {##1-struct}{\int_use:N\c@g__tag_struct_abs_int} + \prop_gput:Nne\g__tag_float_sect_prop {##1-struct}{\int_use:N\c@g__tag_struct_abs_int} \tag_struct_end: } } @@ -93,7 +93,7 @@ { \__tag_float_end: \__tag_float_begin: - \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int} + \MakeLinkTarget*{floatstructure.\int_use:N\c@g__tag_struct_abs_int} } } @@ -120,12 +120,12 @@ { \exp_args:Ne \tag_struct_begin:n{tag=float,parent=0\prop_item:No\g__tag_float_sect_prop{\@captype-struct}}% - \prop_gput:Nxx \g__tag_float_sect_prop {\@captype-used}{true} + \prop_gput:Nee \g__tag_float_sect_prop {\@captype-used}{true} } { \tag_struct_begin:n{tag=float} } - \tl_set:Nx\@current@float@struct{\tag_get:n{struct_num}}% + \tl_set:Ne\@current@float@struct{\tag_get:n{struct_num}}% \typeout{Float structure: \@current@float@struct} } @@ -147,7 +147,7 @@ \fi \ifhmode \@bsphack - \@nameuse{__tag_float_stoppar:} %<---end P + \@nameuse{__tag_float_stop_par:}% <---end P \@floatpenalty -\@Mii \else \@floatpenalty-\@Miii @@ -198,7 +198,7 @@ \hsize\columnwidth \@parboxrestore \@floatboxreset - \MakeLinkTarget[tagstructure]{g__tag_struct_abs_int}% + \MakeLinkTarget*{floatstructure.\number\value{g__tag_struct_abs_int}}% }% \def\end@float{% \@endfloatbox @@ -214,7 +214,7 @@ \penalty\@floatpenalty \else \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack - \@nameuse{__tag_float_start_par:} %restart P safe here?? + \@nameuse{__tag_float_start_par:}% restart P safe here?? \fi \fi } @@ -234,7 +234,7 @@ \penalty\@floatpenalty \else \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack - \@nameuse{__tag_float_start_par:} %restart P safe here?? + \@nameuse{__tag_float_start_par:}% restart P safe here?? \fi \fi \else @@ -246,10 +246,17 @@ \let\@kernel@refstepcounter\refstepcounter %as long it is not in the kernel \def\caption{% \ifx\@captype\@undefined - \@latex@error{\noexpand\caption outside float}\@ehd + \@latex@error{\noexpand\caption\c_space_tl outside~float}\@ehd \expandafter\@gobble \else - \@kernel@refstepcounter\@captype + \tl_if_empty:NTF\@current@float@struct + { + \refstepcounter\@captype + } + { + \@kernel@refstepcounter\@captype + \xdef\@currentHref{floatstructure.\@current@float@struct}% + } \expandafter\@firstofone \fi {\@dblarg{\@caption\@captype}}% @@ -260,14 +267,18 @@ { \long\def\@makecaption#1#2{% \vskip\abovecaptionskip - \xdef\@currentHref{tagstructure.\@current@float@struct}% \tag_stop:n{caption} \sbox\@tempboxa{#1:~#2}% \tag_start:n{caption} \tagtool{para=false} + \tl_if_empty:NT \@current@float@struct + { \tl_set:Ne \@current@float@struct {\tag_get:n{struct_num}} } \tag_struct_begin:n{tag=Caption,parent=\@current@float@struct} - \seq_gpop_right:cN {g__tag_struct_kids_\@current@float@struct _seq}\l__tag_tmpa_tl - \seq_gput_left:cV {g__tag_struct_kids_\@current@float@struct _seq}\l__tag_tmpa_tl + \tag_if_active:T + { + \seq_gpop_right:cN {g__tag_struct_kids_\@current@float@struct _seq}\l__tag_tmpa_tl + \seq_gput_left:cV {g__tag_struct_kids_\@current@float@struct _seq}\l__tag_tmpa_tl + } \ifdim \wd\@tempboxa >\hsize \tag_struct_begin:n{tag=Lbl} \tag_mc_begin:n{} diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-graphic.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-graphic.sty index 19aed304798..2ea6e529d73 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-graphic.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-graphic.sty @@ -32,12 +32,13 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-graphic.dtx (C) Copyright 2022-2023 LaTeX Project -\def\ltlabgraphicdate{2023-10-13} -\def\ltlabgraphicversion{0.80b} +%% File: latex-lab-graphic.dtx (C) Copyright 2022-2024 LaTeX Project +\def\ltlabgraphicdate{2024-03-13} +\def\ltlabgraphicversion{0.80d} \ProvidesExplPackage {latex-lab-testphase-graphic} {\ltlabgraphicdate} {\ltlabgraphicversion} {Code related to the tagging of graphics} \RequirePackage{l3opacity} +\cs_generate_variant:Nn \__tag_prop_gput:Nnn {cne} \cs_new_protected:Npn\__tag_graphic_savepos:n #1 { \tex_savepos:D @@ -88,7 +89,7 @@ \msg_new:nnn {tag}{alt-text-missing} { Alternative~text~for~graphic~is~missing.\\ - Using~'#1'~instead + Using~the~file~name~'#1'~instead. } \cs_new_protected:Npn\Gin@tag@struct@begin { @@ -190,8 +191,9 @@ \wd\z@\Gin@req@width \Gin@tag@bbox@attribute %new \box\z@ + \fi \Gin@tag@struct@end %new - \fi} + } } \AddToHook{package/graphicx/after}[latex-lab] { @@ -559,7 +561,7 @@ {red} {\int_use:N\g__tag_graphic_int} } - \__tag_prop_gput:cnx + \__tag_prop_gput:cne { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } { A } { @@ -626,7 +628,7 @@ {red} {\int_use:N\g__tag_graphic_int} } - \__tag_prop_gput:cnx + \__tag_prop_gput:cne { g__tag_struct_\int_eval:n {\c@g__tag_struct_abs_int}_prop } { A } { diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-marginpar.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-marginpar.sty new file mode 100644 index 00000000000..e40ab0ca2a8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-marginpar.sty @@ -0,0 +1,109 @@ +%% +%% This is file `latex-lab-testphase-marginpar.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-marginpar.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-marginpar.dtx +%% +\def\ltlabmarginpardate{2024-02-12} +\def\ltlabmarginparversion{0.85b} + +\ProvidesExplPackage {latex-lab-testphase-marginpar} {\ltlabmarginpardate} {\ltlabmarginparversion} + {Changes related to the tagging of the margin notes} +\int_new:N \g__kernel_marginpar_int +\socket_new:nn {tagsupport/marginpar/begin}{0} +\socket_new:nn {tagsupport/marginpar/end}{0} +\socket_new_plug:nnn {tagsupport/marginpar/begin}{default} + { + \if_mode_horizontal: + \tag_mc_end: + \tag_struct_begin:n{tag=Aside,parent=\g__tag_para_main_struct_tl}% + \else: + \tag_struct_begin:n{tag=Aside}% + \fi: + } +\socket_new_plug:nnn {tagsupport/marginpar/end}{default} + { + \tag_struct_end: + \if_mode_horizontal: \tag_mc_begin:n{} \fi: + } +\socket_assign_plug:nn {tagsupport/marginpar/begin}{default} +\socket_assign_plug:nn {tagsupport/marginpar/end}{default} + +\long\def \@savemarbox #1#2{% + \UseTaggingSocket{marginpar/begin} + \global\setbox #1% + \color@vbox + \vtop{% + \hsize\marginparwidth + \@parboxrestore + \@marginparreset + #2\par + \@minipagefalse + \outer@nobreak + }% + \color@endbox + \UseTaggingSocket{marginpar/end} +} +\long\def\@ympar#1{% + \@savemarbox\@marbox{#1}% + \global\setbox\@currbox\copy\@marbox + \tag_stop: + \@xympar + \tag_start:} +\long\def\@xmpar[#1]#2{% + \int_gincr:N\g__kernel_marginpar_int + \property_if_recorded:eTF { tag_marginpar-opt-\int_use:N\g__kernel_marginpar_int } + { + \@savemarbox\@marbox {#1 + \property_record:ee + { tag_marginpar-opt-\int_use:N\g__kernel_marginpar_int }{page} + }% + \tag_stop: + \@savemarbox\@currbox{#2}% + \tag_start: + } + { + \@savemarbox\@currbox{#2}% + \tag_stop: + \@savemarbox\@marbox{#1 + \property_record:ee + { tag_marginpar-opt-\int_use:N\g__kernel_marginpar_int }{page}} + \tag_start: + } + \tag_stop: + \@xympar + \tag_start: + } +\endinput +%% +%% End of file `latex-lab-testphase-marginpar.sty'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-minipage.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-minipage.sty index 1f8c5eb5b42..3b35a7beb38 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-minipage.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-minipage.sty @@ -32,7 +32,8 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-minipage.dtx (C) Copyright 2023 LaTeX Project +%% File: latex-lab-minipage.dtx +%% \def\ltlabminipagedate{2023-10-30} \def\ltlabminipageversion{0.81c} \ProvidesExplPackage {latex-lab-testphase-minipage} diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-new-or-1.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-new-or-1.sty index 167c5d6130e..38bc8993446 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-new-or-1.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-new-or-1.sty @@ -32,7 +32,7 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2023 Frank Mittelbach +%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2024 Frank Mittelbach \def\ltlabneworIdate{2023-07-20} \def\ltlabneworIversion{0.85a} \ProvidesPackage{latex-lab-testphase-new-or-1} diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-sec.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-sec.sty index 9e98894969c..6fee3cc5a94 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-sec.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-sec.sty @@ -32,9 +32,9 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project -\def\ltlabsecdate{2023-10-16} -\def\ltlabsecversion{0.84b} +%% File: latex-lab-sec.dtx (C) Copyright 2022-2024 LaTeX Project +\def\ltlabsecdate{2024-02-12} +\def\ltlabsecversion{0.84c} \ProvidesExplPackage {latex-lab-testphase-sec} {\ltlabsecdate} {\ltlabsecversion} {Code related to the tagging of sectioning commands} \RequirePackage{latex-lab-kernel-changes} @@ -50,7 +50,7 @@ tag= {\int_compare:nNnTF {#1}={-1}{Part}{Sect}} ,#2 } - \seq_gpush:Nx \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{\int_eval:n{#1}}} + \seq_gpush:Ne \g__tag_sec_stack_seq {{\g__tag_struct_tag_tl}{\int_eval:n{#1}}} } \msg_new:nnn { tag } {wrong-sect-nesting} { @@ -74,7 +74,7 @@ \__tag_sec_end:n {#1} } { - \msg_warning:nnxx {tag}{wrong-sect-nesting} + \msg_warning:nnee {tag}{wrong-sect-nesting} { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpa_tl } { \exp_last_unbraced:NV\use_i:nn \l__tag_tmpb_tl } } @@ -292,6 +292,7 @@ \cs_new_protected:Npn \@kernel@tag@hangfrom #1 { \tagstructbegin{tag=\l__tag_para_tag_tl} + \cs_if_exist_use:N \__tag_gincr_para_begin_int: \tagstructbegin{tag=Lbl} \setbox\@tempboxa \hbox diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-table.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-table.sty index e6c89d16715..4af648e77c4 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-table.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-table.sty @@ -32,37 +32,29 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-table.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabtbldate{2023-10-30} -\def\ltlabtblversion{0.85d} +%% File: latex-lab-table.dtx (C) Copyright 2023-2024 LaTeX Project +\def\ltlabtbldate{2024-05-25} +\def\ltlabtblversion{0.85i} \ProvidesExplPackage {latex-lab-testphase-table} {\ltlabtbldate} {\ltlabtblversion} {Code related to the tagging of tables} \RequirePackage{array} \tl_new:N \l__tbl_celltag_tl \tl_set:Nn \l__tbl_celltag_tl {TD} +\tl_new:N \l__tbl_pcelltag_tl +\tl_set:Nn \l__tbl_pcelltag_tl {TD} \tl_new:N \l__tbl_rowtag_tl \tl_set:Nn \l__tbl_rowtag_tl {TR} +\tl_new:N \l__tbl_tabletag_tl +\tl_set:Nn \l__tbl_tabletag_tl {Table} \tl_new:N \l__tbl_cellattribute_tl \tl_set:Nn \l__tbl_cellattribute_tl {} \tl_new:N \l__tbl_rowattribute_tl \tl_set:Nn \l__tbl_rowattribute_tl {} -\int_new:N \g__tbl_missing_cells_int \clist_new:N \l__tbl_tmpa_clist -\seq_new:N \l__tbl_tmpa_seq \tl_new:N \l__tbl_tmpa_tl -\NewSocket{tagsupport/tblcell/begin}{0} -\NewSocket{tagsupport/tblcell/end}{0} -\NewSocket{tagsupport/tblrow/begin}{0} -\NewSocket{tagsupport/tblrow/end}{0} -\NewSocket{tagsupport/tbl/init}{0} -\NewSocket{tagsupport/tbl/finalize}{0} -\NewSocket{tagsupport/tbl/finalize/longtable}{0} -\NewSocket{tagsupport/tblhmode/begin}{0} -\NewSocket{tagsupport/tblhmode/end}{0} -\NewSocket{tagsupport/tblvmode/begin}{0} -\NewSocket{tagsupport/tblvmode/end}{0} -\NewSocketPlug{tagsupport/tblcell/begin}{TD} +\NewSocketPlug{tagsupport/tbl/cell/begin}{TD} { + \__tbl_show_curr_cell_data: \tag_struct_begin:n { tag =\l__tbl_celltag_tl, @@ -75,16 +67,17 @@ } \tag_mc_begin:n{} } -\NewSocketPlug{tagsupport/tblcell/end}{TD} +\NewSocketPlug{tagsupport/tbl/cell/end}{TD} { \tag_mc_end: \tag_struct_end: } -\NewSocketPlug{tagsupport/tblcell/begin}{TDpbox} +\NewSocketPlug{tagsupport/tbl/pcell/begin}{TDpbox} { + \__tbl_show_curr_cell_data: \tag_struct_begin:n { - tag =\l__tbl_celltag_tl, + tag =\l__tbl_pcelltag_tl, attribute-class =\l__tbl_cellattribute_tl } \seq_gput_right:Ne \g__tbl_struct_cur_seq { \tag_get:n {struct_num} } @@ -95,11 +88,11 @@ \tagpdfparaOn \tl_set:Nn \l__tag_para_main_tag_tl {Div} } -\NewSocketPlug{tagsupport/tblcell/end}{TDpbox} +\NewSocketPlug{tagsupport/tbl/pcell/end}{TDpbox} { \tag_struct_end: } -\NewSocketPlug{tagsupport/tblrow/begin}{TR} +\NewSocketPlug{tagsupport/tbl/row/begin}{TR} { \seq_gclear:N \g__tbl_struct_cur_seq \tag_struct_begin:n @@ -109,36 +102,53 @@ } \seq_gput_right:Ne \g__tbl_struct_rows_seq { \tag_get:n {struct_num} } } -\NewSocketPlug{tagsupport/tblrow/end}{TR} +\NewSocketPlug{tagsupport/tbl/row/end}{TR} { - \__tag_tbl_add_missing_cells:n { \g__tbl_missing_cells_int } + \tag_if_active:T + { + \__tbl_add_missing_cells: \seq_gput_right:Ne \g__tbl_struct_cells_seq { \seq_use:Nn \g__tbl_struct_cur_seq {,} } - \int_compare:nNnTF { \g__tbl_row_int } = { \seq_count:N\g__tbl_struct_cells_seq } + \int_compare:nNnTF { \g__tbl_row_int } = + { \seq_count:N \g__tbl_struct_cells_seq } { - \typeout + \__tbl_trace:n {==>~ stucture~stored~for~row~\int_use:N\g__tbl_row_int :~ \seq_use:Nn \g__tbl_struct_cur_seq {,} } } - { \ERROR } % should not happen ... + { \ERRORtbl/row } % should not happen ... \tag_struct_end: } + } \NewSocketPlug{tagsupport/tbl/init}{Table} { \tag_if_active:T { \bool_set_false:N \l__tag_para_bool + \__tbl_init_struct_data: } } \NewSocketPlug{tagsupport/tbl/finalize}{Table} { \__tbl_set_header_rows: + \__tbl_restore_struct_data: } -\NewSocketPlug{tagsupport/tbl/finalize/longtable}{Table} +\NewSocketPlug{tagsupport/tbl/longtable/init}{Table} + { + \seq_gclear:N\g__tbl_struct_rows_seq + \seq_gclear:N\g__tbl_struct_cells_seq + \seq_gclear:N\g__tbl_struct_cur_seq + \seq_gclear:N\g__tbl_LT@firsthead_rows_seq + \seq_gclear:N\g__tbl_LT@head_rows_seq + \seq_gclear:N\g__tbl_LT@lastfoot_rows_seq + \seq_gclear:N\g__tbl_LT@foot_rows_seq + } + +\NewSocketPlug{tagsupport/tbl/longtable/finalize}{Table} { \bool_lazy_and:nnTF { \seq_if_empty_p:N \g__tbl_LT@head_rows_seq } @@ -180,7 +190,7 @@ \prop_if_exist:cT { g__tag_struct_ \l__tbl_tmpa_tl _prop } { - \__tbl_struct_prop_gput:Vnn \l__tbl_tmpa_tl {S}{/Artifact} + \exp_args:No \__tag_struct_prop_gput:nnn {\l__tbl_tmpa_tl} {S}{/Artifact} } } } @@ -251,24 +261,35 @@ \prop_if_exist:cT { g__tag_struct_ \l__tbl_tmpa_tl _prop } { - \__tbl_struct_prop_gput:Vnn \l__tbl_tmpa_tl {S}{/Artifact} + \exp_args:No\__tag_struct_prop_gput:nnn {\l__tbl_tmpa_tl} {S}{/Artifact} } } } } } } -\NewSocketPlug{tagsupport/tblhmode/begin}{Table} +\NewSocketPlug{tagsupport/tbl/longtable/head}{Table} + { + \tagmcbegin{artifact} + \tag_mc_reset_box:N\LT@head + \tagmcend + } +\NewSocketPlug{tagsupport/tbl/longtable/foot}{Table} + { + \tagmcbegin{artifact} + \tag_mc_reset_box:N \LT@foot + \tagmcend + } +\NewSocketPlug{tagsupport/tbl/hmode/begin}{Table} { - \mode_leave_vertical: \tag_mc_end_push: \bool_lazy_and:nnT { \bool_if_exist_p:N \l__tag_para_bool } { \l__tag_para_bool } { \tag_struct_end:n { text } } - \tag_struct_begin:n {tag=Table} + \tag_struct_begin:n {tag=\l__tbl_tabletag_tl} \tl_gset:Ne \g__tbl_struct_table_tl { \tag_get:n {struct_num} } } -\NewSocketPlug{tagsupport/tblhmode/end}{Table} +\NewSocketPlug{tagsupport/tbl/hmode/end}{Table} { \tag_struct_end: \bool_lazy_and:nnT @@ -276,105 +297,113 @@ { \tag_struct_begin:n { tag=\l__tag_para_tag_tl } } \tag_mc_begin_pop:n{} } -\NewSocketPlug{tagsupport/tblvmode/begin}{Table} +\NewSocketPlug{tagsupport/tbl/vmode/begin}{Table} { - \tag_struct_begin:n {tag=Table} + \tag_struct_begin:n {tag=\l__tbl_tabletag_tl} \tl_gset:Ne \g__tbl_struct_table_tl { \tag_get:n {struct_num} } } -\NewSocketPlug{tagsupport/tblvmode/end}{Table} +\NewSocketPlug{tagsupport/tbl/vmode/end}{Table} { \tag_struct_end: \par } -\AddToHook{env/tabular/before} {\UseSocket{tagsupport/tblhmode/begin}} -\AddToHook{env/tabular/after} {\UseSocket{tagsupport/tblhmode/end}} -\AddToHook{env/tabular*/before} {\UseSocket{tagsupport/tblhmode/begin}} -\AddToHook{env/tabular*/after} {\UseSocket{tagsupport/tblhmode/end}} -\AddToHook{env/tabularx/before} {\UseSocket{tagsupport/tblhmode/begin}} -\AddToHook{env/tabularx/after} {\UseSocket{tagsupport/tblhmode/end}} -\AddToHook{env/longtable/before}{\UseSocket{tagsupport/tblvmode/begin}} -\AddToHook{env/longtable/after} {\UseSocket{tagsupport/tblvmode/end}} -\AddToHook{env/array/begin} {\__tag_tbl_disable:} -\tag_if_active:T - { \cs_generate_variant:Nn \__tag_attr_new_entry:nn {ee} } -\cs_new_protected:Npn \__tbl_set_colspan:n #1 +\NewSocketPlug{tagsupport/tbl/colspan}{code} { - \tag_if_active:T - { - \int_compare:nNnT {#1}>{1} - { - \prop_get:NeNF \g__tag_attr_entries_prop - {colspan-\int_eval:n{#1}} - \l__tbl_tmpa_tl - { - \__tag_attr_new_entry:ee - {colspan-\int_eval:n{#1}} - {/O /Table /ColSpan~\int_eval:n{#1}} - } - \tl_set:Ne \l__tbl_cellattribute_tl + \int_compare:nNnT {#1}>{1} + { + \prop_get:NeNF \g__tag_attr_entries_prop + {colspan-\int_eval:n{#1}} + \l__tbl_tmpa_tl + { + \__tag_attr_new_entry:ee {colspan-\int_eval:n{#1}} - } - } + {/O /Table /ColSpan~\int_eval:n{#1}} + } + \tl_set:Ne \l__tbl_cellattribute_tl + {colspan-\int_eval:n{#1}} + } } +\tag_if_active:T + { \cs_generate_variant:Nn \__tag_attr_new_entry:nn {ee} } + +\AddToHook{cmd/array/before}{\__tag_tbl_disable:} \cs_new_protected:Npn \__tag_tbl_disable: { - \AssignSocketPlug{tagsupport/tblcell/begin}{noop} - \AssignSocketPlug{tagsupport/tblcell/end}{noop} - \AssignSocketPlug{tagsupport/tblrow/begin}{noop} - \AssignSocketPlug{tagsupport/tblrow/end}{noop} + \AssignSocketPlug{tagsupport/tbl/cell/begin}{noop} + \AssignSocketPlug{tagsupport/tbl/cell/end}{noop} + \AssignSocketPlug{tagsupport/tbl/pcell/begin}{noop} + \AssignSocketPlug{tagsupport/tbl/pcell/end}{noop} + \AssignSocketPlug{tagsupport/tbl/row/begin}{noop} + \AssignSocketPlug{tagsupport/tbl/row/end}{noop} \AssignSocketPlug{tagsupport/tbl/init}{noop} \AssignSocketPlug{tagsupport/tbl/finalize}{noop} - \AssignSocketPlug{tagsupport/tbl/finalize/longtable}{noop} - \AssignSocketPlug{tagsupport/tblhmode/begin}{noop} - \AssignSocketPlug{tagsupport/tblhmode/end}{noop} - \AssignSocketPlug{tagsupport/tblvmode/begin}{noop} - \AssignSocketPlug{tagsupport/tblvmode/end}{noop} + \AssignSocketPlug{tagsupport/tbl/longtable/init}{noop} + \AssignSocketPlug{tagsupport/tbl/longtable/head}{noop} + \AssignSocketPlug{tagsupport/tbl/longtable/foot}{noop} + \AssignSocketPlug{tagsupport/tbl/longtable/finalize}{noop} + \AssignSocketPlug{tagsupport/tbl/hmode/begin}{noop} + \AssignSocketPlug{tagsupport/tbl/hmode/end}{noop} + \AssignSocketPlug{tagsupport/tbl/vmode/begin}{noop} + \AssignSocketPlug{tagsupport/tbl/vmode/end}{noop} + \AssignSocketPlug{tagsupport/tbl/colspan}{noop} } \cs_new_protected:Npn \__tag_tbl_enable: { - \AssignSocketPlug{tagsupport/tblcell/begin}{TD} - \AssignSocketPlug{tagsupport/tblcell/end}{TD} - \AssignSocketPlug{tagsupport/tblrow/begin}{TR} - \AssignSocketPlug{tagsupport/tblrow/end}{TR} + \AssignSocketPlug{tagsupport/tbl/cell/begin}{TD} + \AssignSocketPlug{tagsupport/tbl/cell/end}{TD} + \AssignSocketPlug{tagsupport/tbl/pcell/begin}{TDpbox} + \AssignSocketPlug{tagsupport/tbl/pcell/end}{TDpbox} + \AssignSocketPlug{tagsupport/tbl/row/begin}{TR} + \AssignSocketPlug{tagsupport/tbl/row/end}{TR} \AssignSocketPlug{tagsupport/tbl/init}{Table} \AssignSocketPlug{tagsupport/tbl/finalize}{Table} - \AssignSocketPlug{tagsupport/tbl/finalize/longtable}{Table} - \AssignSocketPlug{tagsupport/tblhmode/begin}{Table} - \AssignSocketPlug{tagsupport/tblhmode/end}{Table} - \AssignSocketPlug{tagsupport/tblvmode/begin}{Table} - \AssignSocketPlug{tagsupport/tblvmode/end}{Table} + \AssignSocketPlug{tagsupport/tbl/longtable/head}{Table} + \AssignSocketPlug{tagsupport/tbl/longtable/foot}{Table} + \AssignSocketPlug{tagsupport/tbl/longtable/init}{Table} + \AssignSocketPlug{tagsupport/tbl/longtable/finalize}{Table} + \AssignSocketPlug{tagsupport/tbl/hmode/begin}{Table} + \AssignSocketPlug{tagsupport/tbl/hmode/end}{Table} + \AssignSocketPlug{tagsupport/tbl/vmode/begin}{Table} + \AssignSocketPlug{tagsupport/tbl/vmode/end}{Table} + \AssignSocketPlug{tagsupport/tbl/colspan}{code} } \keys_define:nn { __tag / setup } { - table-tagging .choices:nn = { true, on } + table/tagging .choices:nn = { true, on } { \__tag_tbl_enable: }, - table-tagging .choices:nn = { false, off } + table/tagging .choices:nn = { false, off } { \__tag_tbl_disable: }, - table-tagging .default:n = true, - table-tagging .initial:n = true + table/tagging .choice:, + table/tagging / presentation .code:n = + { + \__tag_tbl_enable: + \tl_set:Nn\l__tbl_rowtag_tl {NonStruct} + \tl_set:Nn\l__tbl_pcelltag_tl {NonStruct} + \tl_set:Nn\l__tbl_celltag_tl {text} + \tl_set:Nn\l__tbl_tabletag_tl {Div} + \clist_clear:N \l__tbl_header_rows_clist + }, + table/tagging .default:n = true, + table/tagging .initial:n = true + } +\keys_define:nn { __tag / setup } + { + table-tagging .meta:n = {table/tagging={#1}} } -\AddToHook{begindocument} - { - \cs_if_exist:NT \@kernel@before@head - { - \tl_put_right:Nn \@kernel@before@head {\__tag_tbl_disable:} - \tl_put_right:Nn \@kernel@before@foot {\__tag_tbl_disable:} - } - } \AddToHook{begindocument} { \tag_if_active:T { \tagpdfsetup { - newattribute = + role/new-attribute = {TH-col}{/O /Table /Scope /Column}, - newattribute = + role/new-attribute = {TH-row}{/O /Table /Scope /Row}, - newattribute = + role/new-attribute = {TH-both}{/O /Table /Scope /Both}, } \seq_gput_left:Ne\g__tag_attr_class_used_seq @@ -387,15 +416,6 @@ } \clist_new:N \l__tbl_header_rows_clist -\cs_if_free:NTF \__tag_struct_prop_gput:nnn - { - \cs_new_protected:Npn \__tbl_struct_prop_gput:nnn #1#2#3 - { \prop_gput:cnn { g__tag_struct_#1_prop }{#2}{#3} } - } - { \cs_new_protected:Npn \__tbl_struct_prop_gput:nnn #1#2#3 - { \__tag_struct_prop_gput:nnn {#1}{#2}{#3} } - } -\cs_generate_variant:Nn \__tbl_struct_prop_gput:nnn {nne,Vnn} \cs_new_protected:Npn \__tbl_set_header_rows: { \clist_map_inline:Nn \l__tbl_header_rows_clist @@ -408,196 +428,47 @@ { \prop_if_exist:cT { g__tag_struct_####1_prop } { - \__tbl_struct_prop_gput:nnn{ ####1 }{S}{/TH} + \__tag_struct_prop_gput:nnn{ ####1 }{S}{/TH} \prop_get:cnNTF { g__tag_struct_####1_prop } { C } \l__tbl_tmpa_tl - {\__tbl_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l__tbl_tmpa_tl]} } - {\__tbl_struct_prop_gput:nnn{ ####1 }{C}{/TH-col}} + {\__tag_struct_prop_gput:nne{ ####1 }{C}{[/TH-col~\l__tbl_tmpa_tl]} } + {\__tag_struct_prop_gput:nnn{ ####1 }{C}{/TH-col}} } } } } \keys_define:nn { __tag / setup } { - table-header-rows .clist_set:N = \l__tbl_header_rows_clist + table/header-rows .clist_set:N = \l__tbl_header_rows_clist, + table-header-rows .meta:n = {table/header-rows={#1}} } \cs_new_protected:Npn \__tbl_show_curr_cell_data: { - \typeout { ==>~ current~cell~data:~ - \int_use:N \g__tbl_row_int , - \int_use:N \g__tbl_col_int , - \g__tbl_span_tl - } -} -\def\insert@column{% - \__tbl_show_curr_cell_data: - \UseSocket{tagsupport/tblcell/begin}% - \the@toks \the \@tempcnta - \ignorespaces \@sharp \unskip - \the@toks \the \count@ \relax - \UseSocket{tagsupport/tblcell/end}% -} -\def\@classz{\@classx - \@tempcnta \count@ - \prepnext@tok - \@addtopreamble{\ifcase \@chnum - \hfil - \hskip1sp% - \d@llarbegin - \insert@column - \d@llarend \do@row@strut \hfil \or - \hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \hfil \or - \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \do@row@strut \or - \setbox\ar@mcellbox\vbox - \@startpbox{\@nextchar} - \AssignSocketPlug{tagsupport/tblcell/begin}{TDpbox} - \AssignSocketPlug{tagsupport/tblcell/end}{TDpbox} - \insert@column \@endpbox - \ar@align@mcell - \do@row@strut \or - \vtop \@startpbox{\@nextchar} - \AssignSocketPlug{tagsupport/tblcell/begin}{TDpbox} - \AssignSocketPlug{tagsupport/tblcell/end}{TDpbox} - \insert@column \@endpbox\do@row@strut \or - \vbox \@startpbox{\@nextchar} - \AssignSocketPlug{tagsupport/tblcell/begin}{TDpbox} - \AssignSocketPlug{tagsupport/tblcell/end}{TDpbox} - \insert@column \@endpbox\do@row@strut - \fi}\prepnext@tok} -\def\@array[#1]#2{% - \@tempdima \ht \strutbox - \advance \@tempdima by\extrarowheight - \setbox \@arstrutbox \hbox{\vrule - \@height \arraystretch \@tempdima - \@depth \arraystretch \dp \strutbox - \@width \z@}% - \tl_set_eq:NN \l__tbl_saved_table_cols_tl \g__tbl_table_cols_tl - \begingroup - \@mkpream{#2} - \__tbl_determine_table_cols: - \xdef\@preamble{% - \noexpand - \ar@ialign - \@halignto - \bgroup \@arstrut - \UseSocket{tagsupport/tblrow/begin}% - \__tbl_init_cell_data: - \@preamble - \tabskip \z@ \cr}% - \endgroup - \@arrayleft - \UseSocket{tagsupport/tbl/init} - \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi - \bgroup - \let \@sharp ##\let \protect \relax - \lineskip \z@ - \baselineskip \z@ - \m@th - \let\\\@arraycr \let\tabularnewline\\\let\par\@empty - \@preamble} -\let\@@array\@array -\cs_new_protected:Npn \__tbl_init_cell_data: { - \int_gset:Nn \g__tbl_col_int {1} - \tl_gset:Nn \g__tbl_span_tl {1} -} -\cs_new_protected:Npn \__tbl_update_cell_data: { - \int_gadd:Nn \g__tbl_col_int { \g__tbl_span_tl } - \tl_gset:Nn \g__tbl_span_tl {1} -} -\cs_new:Npn \__tbl_determine_table_cols: { - \seq_set_split:NnV\l__tbl_tmpa_seq {&}\@preamble - \tl_gset:Ne \g__tbl_table_cols_tl { \seq_count:N \l__tbl_tmpa_seq } - \typeout{ ==>~ Table~ has~ \g__tbl_table_cols_tl \space columns } -} -\protected\def\@arraycr{ - \relax - \__tbl_store_missing_cells:n{@arraycr} - % - \iffalse{\fi\ifnum 0=`}\fi - \@ifstar \@xarraycr \@xarraycr} -\cs_new:Npn \__tbl_store_missing_cells:n #1 { - \int_compare:nNnT \g__tbl_col_int > 0 - { - \int_gset:Nn \g__tbl_missing_cells_int - { - \g__tbl_table_cols_tl - - \g__tbl_col_int - - \g__tbl_span_tl - + 1 - } - \int_compare:nNnT \g__tbl_missing_cells_int < 0 \ERROR % should not happen - \typeout{==>~ - (#1)~ - This~ row~ needs~ - \int_use:N \g__tbl_missing_cells_int \space - additional~ cell(s) - } - } + \__tbl_trace:n { ==>~ current~cell~data:~ + \int_use:N \g__tbl_row_int , + \int_use:N \g__tbl_col_int , + \g__tbl_span_tl + } } -\cs_new:Npn \__tag_tbl_add_missing_cells:n #1 +\NewSocket{tbl/celldata/missingcount}{1} +\NewSocketPlug{tbl/celldata/missingcount}{code}{\tbl_count_missing_cells:n{#1}} +\AssignSocketPlug{tbl/celldata/missingcount}{code} + +\cs_new:Npn \__tbl_add_missing_cells: { - \int_compare:nNnT {#1}>{0} - { - \typeout{==>~ - ~Inserting~\int_eval:n{#1}~additional~cell(s)~into~previous~row:} - } - \int_step_inline:nn { #1 } + \int_compare:nNnT \g__tbl_missing_cells_int > 0 { - \UseSocket{tagsupport/tblcell/begin} - \UseSocket{tagsupport/tblcell/end} + \__tbl_trace:n {==>~ + ~Inserting~\int_use:N \g__tbl_missing_cells_int \space + additional~cell(s)~into~previous~row:} + \int_step_inline:nn { \g__tbl_missing_cells_int } + { + \UseTaggingSocket{tbl/cell/begin} + \UseTaggingSocket{tbl/cell/end} + } } } -\def\endarray{ - \__tbl_store_missing_cells:n{endarray} - \crcr \egroup - \UseSocket{tagsupport/tbl/finalize} - \int_gset:Nn \g__tbl_col_int { \l__tbl_saved_col_tl } - \int_gset:Nn \g__tbl_row_int { \l__tbl_saved_row_tl } - \tl_gset_eq:NN \g__tbl_span_tl \l__tbl_saved_span_tl - \tl_gset_eq:NN \g__tbl_table_cols_tl \l__tbl_saved_table_cols_tl - \tl_gset_eq:NN \g__tbl_struct_table_tl \l__tbl_saved_struct_table_tl - \seq_gset_eq:NN \g__tbl_struct_rows_seq \l__tbl_saved_struct_rows_seq - \seq_gset_eq:NN \g__tbl_struct_cells_seq\l__tbl_saved_struct_cells_seq - \seq_gset_eq:NN \g__tbl_struct_cur_seq \l__tbl_saved_struct_cur_seq - \typeout{==>~ restored~cell~data:~ - \int_use:N \g__tbl_row_int, - \int_use:N \g__tbl_col_int, - \l__tbl_saved_span_tl \space - ( - \int_compare:nNnTF \g__tbl_table_cols_tl = 0 - { outer~ level } - { max:~ \g__tbl_table_cols_tl } - ) - } - \egroup - \@arrayright \gdef\@preamble{}% -} -\def\@addamp { - \if@firstamp - \@firstampfalse - \else - \edef\@preamble{\@preamble & - \__tbl_update_cell_data: - } - \fi -} -\int_new:N \g__tbl_col_int -\int_new:N \g__tbl_row_int -\tl_new:N \g__tbl_span_tl -\tl_new:N \g__tbl_table_cols_tl - -\tl_gset:Nn \g__tbl_span_tl {1} -\tl_gset:Nn \g__tbl_table_cols_tl {0} % indicates outer level -\tl_new:N \l__tbl_saved_col_tl -\tl_new:N \l__tbl_saved_row_tl -\tl_new:N \l__tbl_saved_span_tl -\tl_new:N \l__tbl_saved_table_cols_tl - -\tl_set:Nn \l__tbl_saved_col_tl{0} -\tl_set:Nn \l__tbl_saved_row_tl{0} -\tl_set:Nn \l__tbl_saved_span_tl{1} -\tl_set:Nn \l__tbl_saved_table_cols_tl{0} % indicates outer level \tl_new:N \g__tbl_struct_table_tl \tl_new:N \l__tbl_saved_struct_table_tl \seq_new:N \g__tbl_struct_rows_seq @@ -606,300 +477,24 @@ \seq_new:N \l__tbl_saved_struct_cells_seq \seq_new:N \g__tbl_struct_cur_seq \seq_new:N \l__tbl_saved_struct_cur_seq -\def\ar@ialign{% - \tl_set:No \l__tbl_saved_col_tl {\int_use:N \g__tbl_col_int } - \tl_set:No \l__tbl_saved_row_tl {\int_use:N \g__tbl_row_int } - \tl_set_eq:NN \l__tbl_saved_span_tl \g__tbl_span_tl + +\cs_new_protected:Npn \__tbl_init_struct_data: { \tl_set_eq:NN \l__tbl_saved_struct_table_tl \g__tbl_struct_table_tl \seq_set_eq:NN \l__tbl_saved_struct_rows_seq \g__tbl_struct_rows_seq \seq_set_eq:NN \l__tbl_saved_struct_cells_seq \g__tbl_struct_cells_seq \seq_set_eq:NN \l__tbl_saved_struct_cur_seq \g__tbl_struct_cur_seq - \typeout{==>~ saved~cell~data:~ - \l__tbl_saved_row_tl, - \l__tbl_saved_col_tl, - \l__tbl_saved_span_tl \space - ( - \int_compare:nNnTF \l__tbl_saved_table_cols_tl = 0 - { outer~ level } - { max:~ \l__tbl_saved_table_cols_tl } - ) - } - \int_gzero:N \g__tbl_row_int - \int_gzero:N \g__tbl_col_int - \tl_gset:Nn \g__tbl_span_tl {1} \seq_gclear:N\g__tbl_struct_rows_seq \seq_gclear:N\g__tbl_struct_cells_seq \seq_gclear:N\g__tbl_struct_cur_seq - \everycr{% - \noalign{% - \int_compare:nNnT \g__tbl_col_int > 0 - { \UseSocket{tagsupport/tblrow/end} } - \int_gincr:N \g__tbl_row_int % this row about to start - \int_gzero:N \g__tbl_col_int % we are before first col - }% - }% - \tabskip\z@skip\halign} -\long\def\multicolumn#1#2#3{% - % alternative: determine first col with vmode test ... - % \ifvmode - % \multispan{#1}\typeout{A==> vmode}% - % \else - % \multispan{#1}\typeout{A==> not vmode} - % \fi - % but this makes the \crcr handling really complicated which would - % then need to become something like - % \ifvmode \expandafter \@gobble - % \else \expandafter \@iden \fi {\cr\noalign{do something}}% - % so not used. - % Instead: - \multispan{#1}\begingroup - \int_compare:nNnTF \g__tbl_col_int = 0 - { - \UseSocket{tagsupport/tblrow/begin} - \int_gset:Nn \g__tbl_col_int {1} - } - { - \int_gadd:Nn \g__tbl_col_int { \g__tbl_span_tl } - } - \tl_gset:Nn \g__tbl_span_tl {#1} - \def\@addamp{\if@firstamp\@firstampfalse \else - \@preamerr 5\fi}% - \@mkpream{#2}\@addtopreamble\@empty - \endgroup - \__tbl_set_colspan:n {#1} - \def\@sharp{#3}% - \@arstrut \@preamble - \null - \ignorespaces} -\let\@kernel@refstepcounter\refstepcounter -\def\hyper@nopatch@longtable{} -\def\__tbl_patch_LT@array[#1]#2{% - \UseSocket{tagsupport/tbl/init}% - \@kernel@refstepcounter{table}\stepcounter{LT@tables}% - \tl_gset:Ne \@currentHref {table.\cs_if_exist_use:N\theHtable} - \int_gzero:N \g__tbl_row_int - \seq_gclear:N\g__tbl_struct_rows_seq - \seq_gclear:N\g__tbl_struct_cells_seq - \seq_gclear:N\g__tbl_struct_cur_seq - \seq_gclear:N\g__tbl_LT@firsthead_rows_seq - \seq_gclear:N\g__tbl_LT@head_rows_seq - \seq_gclear:N\g__tbl_LT@lastfoot_rows_seq - \seq_gclear:N\g__tbl_LT@foot_rows_seq - \if l#1% - \LTleft\z@ \LTright\fill - \else\if r#1% - \LTleft\fill \LTright\z@ - \else\if c#1% - \LTleft\fill \LTright\fill - \fi\fi\fi - \let\LT@mcol\multicolumn - \let\LT@@tabarray\@tabarray - \let\LT@@hl\hline - \def\@tabarray{% - \let\hline\LT@@hl - \LT@@tabarray}% - \let\\\LT@tabularcr - \let\tabularnewline\\% - \def\newpage{\noalign{\break}}% - \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}% - \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}% - \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption - \@tempdima\ht\strutbox - \let\@endpbox\LT@endpbox - \ifx\extrarowheight\@undefined - \let\@acol\@tabacol - \let\@classz\@tabclassz \let\@classiv\@tabclassiv - \def\@startpbox{\vtop\LT@startpbox}% - \let\@@startpbox\@startpbox - \let\@@endpbox\@endpbox - \let\LT@LL@FM@cr\@tabularcr - \else - \advance\@tempdima\extrarowheight - \col@sep\tabcolsep - \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr - \fi - \setbox\@arstrutbox\hbox{\vrule - \@height \arraystretch \@tempdima - \@depth \arraystretch \dp \strutbox - \@width \z@}% - \let\@sharp##\let\protect\relax - \begingroup - \@mkpream{#2}% - \__tbl_determine_table_cols: - \xdef\LT@bchunk{% - \int_gzero:N \g__tbl_col_int - \global\advance\c@LT@chunks\@ne - \global\LT@rows\z@\setbox\z@\vbox\bgroup - \LT@setprevdepth - \tabskip\LTleft \noexpand\halign to\hsize\bgroup - \tabskip\z@ \@arstrut - \UseSocket{tagsupport/tblrow/begin}% - \__tbl_init_cell_data: - \@preamble \tabskip\LTright \cr}% - \endgroup - \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols - \LT@make@row - \m@th\let\par\@empty - \everycr{% - \noalign{% - \typeout{--longtable-->~chunk~row:~ \the\LT@rows \space - row:~ \the\g__tbl_row_int \space - column:~ \the\g__tbl_col_int - } - \int_compare:nNnT \g__tbl_col_int > 0 - { - \UseSocket{tagsupport/tblrow/end} - } - \int_gzero:N \g__tbl_col_int % before first col - \int_compare:nNnT \LT@rows < \LTchunksize - { \int_gincr:N \g__tbl_row_int } % this row about to start - }% - }% - \lineskip\z@\baselineskip\z@ - \LT@bchunk} -\def\__tbl_patch_endlongtable{% - \__tbl_store_missing_cells:n{endlongtable} - \crcr - \noalign{% - \UseSocket{tagsupport/tbl/finalize/longtable} - \int_gzero:N \g__tbl_row_int % this prevents considering the next - % \crcr as another row end. - \let\LT@entry\LT@entry@chop - \xdef\LT@save@row{\LT@save@row}}% - \LT@echunk - \LT@start - \unvbox\z@ - \LT@get@widths - \if@filesw - {\let\LT@entry\LT@entry@write\immediate\write\@auxout{% - \gdef\expandafter\noexpand - \csname LT@\romannumeral\c@LT@tables\endcsname - {\LT@save@row}}}% - \fi - \ifx\LT@save@row\LT@@save@row - \else - \LT@warn{Column~\@width s~have~changed\MessageBreak - in~table~\thetable}% - \LT@final@warn - \fi - \endgraf\penalty -\LT@end@pen - \ifvoid\LT@foot\else - \global\advance\vsize\ht\LT@foot - \global\advance\@colroom\ht\LT@foot - \dimen@\pagegoal\advance\dimen@\ht\LT@foot\pagegoal\dimen@ - \fi - \endgroup - \global\@mparbottom\z@ - \endgraf\penalty\z@\addvspace\LTpost - \ifvoid\footins\else\insert\footins{}\fi} -\def\__tbl_patch_LT@t@bularcr{% - \global\advance\LT@rows\@ne - \ifnum\LT@rows=\LTchunksize - \__tbl_store_missing_cells:n{echunk} - \gdef\LT@setprevdepth{% - \prevdepth\z@ - \global\let\LT@setprevdepth\relax}% - \expandafter\LT@xtabularcr - \else - \ifnum0=`{}\fi - \expandafter\LT@LL@FM@cr - \fi} +} -\def\__tbl_patch_LT@end@hd@ft#1{% - \__tbl_store_missing_cells:n{head/foot} - \int_step_inline:nn - { \LT@rows + 1 } - { - \seq_gput_left:ce - {g__tbl_\cs_to_str:N #1 _rows_seq } - { \int_eval:n {\g__tbl_row_int + 1 - ##1 } } - } - \int_gset:Nn \LT@rows { \LTchunksize } - \LT@echunk - \ifx\LT@start\endgraf - \LT@err - {Longtable head or foot not at start of table}% - {Increase LTchunksize}% - \fi - \setbox#1\box\z@ - \LT@get@widths - \LT@bchunk} +\cs_new_protected:Npn \__tbl_restore_struct_data: { + \tl_gset_eq:NN \g__tbl_struct_table_tl \l__tbl_saved_struct_table_tl + \seq_gset_eq:NN \g__tbl_struct_rows_seq \l__tbl_saved_struct_rows_seq + \seq_gset_eq:NN \g__tbl_struct_cells_seq\l__tbl_saved_struct_cells_seq + \seq_gset_eq:NN \g__tbl_struct_cur_seq \l__tbl_saved_struct_cur_seq +} -\def\__tbl_patch_LT@start{% - \let\LT@start\endgraf - \endgraf\penalty\z@\vskip\LTpre\endgraf - \ifdim \pagetotal<\pagegoal \else - \dimen@=\pageshrink - \advance \dimen@ 1sp % - \kern\dimen@\penalty 9999\endgraf \kern-\dimen@ - \fi - \dimen@\pagetotal - \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi - \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi - \advance\dimen@ \ht\LT@foot - \edef\LT@reset@vfuzz{\vfuzz\the\vfuzz\vbadness\the\vbadness\relax}% - \vfuzz\maxdimen - \vbadness\@M - \setbox\tw@\copy\z@ - \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox - \setbox\tw@\vbox{\unvbox\tw@}% - \LT@reset@vfuzz - \advance\dimen@ \ht - \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi - \advance\dimen@\dp - \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi - \advance\dimen@ -\pagegoal - \ifdim \dimen@>\z@ - \vfil\break - \else - \ifdim\pageshrink>\z@\pageshrink\z@\fi - \fi - \global\@colroom\@colht - \ifvoid\LT@foot\else - \global\advance\vsize-\ht\LT@foot - \global\advance\@colroom-\ht\LT@foot - \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@ - \maxdepth\z@ - \fi - \MakeLinkTarget{table} - \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak - \tagmcbegin{artifact} - \tag_mc_reset_box:N\LT@head - \tagmcend - \output{\LT@output}} -\def\__tbl_patch_LT@output{% - \ifnum\outputpenalty <-\@Mi - \ifnum\outputpenalty > -\LT@end@pen - \LT@err{floats and marginpars not allowed in a longtable}\@ehc - \else - \setbox\z@\vbox{\unvbox\@cclv}% - \ifdim \ht\LT@lastfoot>\ht\LT@foot - \dimen@\pagegoal - \advance\dimen@\ht\LT@foot - \advance\dimen@-\ht\LT@lastfoot - \ifdim\dimen@<\ht\z@ - \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}% - \@makecol - \@outputpage - \global\vsize\@colroom - \setbox\z@\vbox{\box\LT@head}% - \fi - \fi - \unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi - \tagmcbegin{artifact} - \tag_mc_reset_box:N \LT@foot - \tagmcend - \fi - \else - \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% - \tagmcbegin{artifact} - \tag_mc_reset_box:N \LT@foot - \tagmcend - \@makecol - \@outputpage - \global\vsize\@colroom - \copy\LT@head\nobreak - \fi} \def\__tbl_patch_LT@makecaption#1#2#3{% \LT@mcol\LT@cols c{% % test can go after merge @@ -922,56 +517,10 @@ \hss}}} \AddToHook{package/longtable/after} { - \seq_new:N \g__tbl_LT@firsthead_rows_seq - \seq_new:N \g__tbl_LT@head_rows_seq - \seq_new:N \g__tbl_LT@lastfoot_rows_seq - \seq_new:N \g__tbl_LT@foot_rows_seq - \cs_set_eq:NN \LT@array\__tbl_patch_LT@array - \cs_set_eq:NN \endlongtable\__tbl_patch_endlongtable - \cs_set_eq:NN \LT@start\__tbl_patch_LT@start - \cs_set_eq:NN \LT@output\__tbl_patch_LT@output - \cs_set_eq:NN \LT@t@bularcr\__tbl_patch_LT@t@bularcr - \cs_set_eq:NN \LT@end@hd@ft\__tbl_patch_LT@end@hd@ft \cs_set_eq:NN \LT@makecaption\__tbl_patch_LT@makecaption } -\def\__tbl_patch_TX@endtabularx{% - \expandafter\expandafter\expandafter - \TX@find@endtabularxa\csname end\TX@\endcsname - \endtabularx\TX@\endtabularx\TX@find@endtabularxa - \expandafter\TX@newcol\expandafter{\tabularxcolumn{\TX@col@width}}% - \let\verb\TX@verb - \def\@elt##1{\global\value{##1}\the\value{##1}\relax}% - \edef\TX@ckpt{\cl@@ckpt}% - \let\@elt\relax - \TX@old@table\maxdimen - \TX@col@width\TX@target - \global\TX@cols\@ne - \TX@typeout@ - {\@spaces Table Width\@spaces Column Width\@spaces X Columns}% - \tag_stop:n{tabularx} - \TX@trial{\def\NC@rewrite@X{% - \global\advance\TX@cols\@ne\NC@find p{\TX@col@width}}}% - \loop - \TX@arith - \ifTX@ - \TX@trial{}% - \repeat - \tag_start:n{tabularx} - {\let\@footnotetext\TX@ftntext\let\@xfootnotenext\TX@xftntext - \csname tabular*\expandafter\endcsname\expandafter\TX@target - \the\toks@ - \csname endtabular*\endcsname}% - \global\TX@ftn\expandafter{\expandafter}\the\TX@ftn - \ifnum0=`{\fi}% - \expandafter\expandafter\expandafter - \TX@find@endtabularxbb - \expandafter\end\expandafter{\TX@}% - \endtabularx\TX@\endtabularx\TX@find@endtabularxb -} -\AddToHook{package/tabularx/after} - {\cs_set_eq:NN \TX@endtabularx\__tbl_patch_TX@endtabularx } \endinput %% %% End of file `latex-lab-testphase-table.sty'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-text.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-text.sty index 7cae4fc4897..749ab3aa08a 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-text.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-text.sty @@ -32,7 +32,7 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-text.dtx (C) Copyright 2023 LaTeX Project +%% File: latex-lab-text.dtx (C) Copyright 2023-2024 LaTeX Project \def\ltlabtextdate{2023-07-20} \def\ltlabtextversion{0.85a} diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-title.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-title.sty new file mode 100644 index 00000000000..f3518622dfa --- /dev/null +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-title.sty @@ -0,0 +1,300 @@ +%% +%% This is file `latex-lab-testphase-title.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-title.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-title.dtx (C) Copyright 2023-2024 LaTeX Project +\def\ltlabtitledate{2024-02-09} +\def\ltlabtitleversion{0.85c} + + +\ProvidesExplPackage {latex-lab-testphase-title} {\ltlabtitledate} {\ltlabtitleversion} + {Changes related to the tagging of the title} +\cs_new_protected:Npn \__tag_patch_thanks:n #1 + { + \rlap{\footnotemark} + \protected@xdef\@thanks{\@thanks + \protect\footnotetext[\the\c@footnote]{#1}} + } +\cs_new_protected:Npn \__tag_patch_maketitle: + { + \par + \begingroup + \cs_if_exist_use:N\__tag_tbl_disable: + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \cs_set_eq:NN \thanks \__tag_patch_thanks:n + \if@twocolumn + \ifnum \col@number=\@ne + \@maketitle + \else + \twocolumn[\@maketitle]% + \fi + \else + \newpage + \global\@topnum\z@ % Prevents figures from going at top of page. + \@maketitle + \fi + \thispagestyle{plain}\@thanks + \endgroup + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax + } +\cs_new_protected:Npn \__tag_patch_@maketitle: + { + \newpage + \null + \vskip 2em% + \begin{center}% + \let \footnote \thanks + \pdf_version_compare:NnTF > {1.7} + {{\LARGE \tag_struct_begin:n{tag=Title}\@title \par\tag_struct_end:}} + {{\LARGE \tagtool{paratag=Title}\@title \par}}% + \vskip 1.5em% + {\large + \lineskip .5em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1em% + {\large \@date}% + \end{center}% + \par + \vskip 1.5em + } + +\cs_new_protected:Npn \__tag_patch_maketitle_page: + {\begin{titlepage}% + \cs_if_exist_use:N\__tag_tbl_disable: + \let\footnotesize\small + \let\footnoterule\relax + \let \footnote \thanks + \null\vfil + \vskip 60\p@ + \begin{center}% + \pdf_version_compare:NnTF > {1.7} + {{\LARGE \tag_struct_begin:n{tag=Title}\@title \par\tag_struct_end:}} + {{\LARGE \tagtool{paratag=Title}\@title \par}}% + \vskip 3em% + {\large + \lineskip .75em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1.5em% + {\large \@date \par}% % Set date in \large size. + \end{center}\par + \@thanks + \vfil\null + \end{titlepage}% + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax + } + +\AddToHook{class/article/after} + { + \if@titlepage + \cs_set_eq:NN \maketitle \__tag_patch_maketitle_page: + \else + \cs_set_eq:NN \maketitle \__tag_patch_maketitle: + \cs_set_eq:NN \@maketitle \__tag_patch_@maketitle: + \fi + } +\AddToHook{class/report/after} + { + \if@titlepage + \cs_set_eq:NN \maketitle \__tag_patch_maketitle_page: + \else + \cs_set_eq:NN \maketitle \__tag_patch_maketitle: + \cs_set_eq:NN \@maketitle \__tag_patch_@maketitle: + \fi + } +\AddToHook{class/book/after} + { + \if@titlepage + \cs_set_eq:NN \maketitle \__tag_patch_maketitle_page: + \else + \cs_set_eq:NN \maketitle \__tag_patch_maketitle: + \cs_set_eq:NN \@maketitle \__tag_patch_@maketitle: + \fi + } +\str_new:N \g__tag_title_tmpa_str +\str_new:N \l__tag_title_tmpa_str +\tl_new:N \l__tag_title_tmpa_tl +\seq_new:N \l__tag_title_tmpa_seq +\providecommand\texorpdfstring[2]{#1}% +\protected\def\@title{\@latex@error{No \noexpand\title given}\@ehc} +\protected\def\@author{\@latex@warning@no@line{No \noexpand\author given}} +\cs_new_protected:Npn \__tag_title_pdfstring:nnN #1 #2 #3 % #1 text, #2 e.g. utf16/hex + { + \group_begin: + \cs_set_eq:NN\texorpdfstring\use_ii:nn + \str_set:Ne \l__tag_title_tmpa_str {\text_purify:n { #1 } } + \pdf_string_from_unicode:nVN { #2 } \l__tag_title_tmpa_str \l__tag_title_tmpa_str + \str_gset_eq:NN \g__tag_title_tmpa_str\l__tag_title_tmpa_str + \group_end: + \str_set_eq:NN #3 \g__tag_title_tmpa_str + } +\cs_generate_variant:Nn\__tag_title_pdfstring:nnN {e} + +\tl_new:N \g__tag_title_title_tl +\RenewDocumentCommand\title{O{}m} + { + \gdef\@title{#2} + \tl_gset_eq:NN\g__tag_title_title_tl\@title + \keys_set:nn {hyp}{#1} + } +\regex_new:N\l__tag_title_optlang_regex +\regex_set:Nn\l__tag_title_optlang_regex {\A\[([A-Za-z\-]+)\](.*)} +\cs_generate_variant:Nn \regex_extract_once:NnN{NVN} +\cs_generate_variant:Nn \clist_item:nn {on} +\keys_define:nn { hyp } + { + pdftitle .code:n = + { + \tl_if_blank:nTF {#1} + { + \pdfmanagement_remove:nn {Info}{Title} + } + { + \tl_set:Ne\l__tag_title_tmpa_tl {\clist_item:on{#1}{1}} + \regex_extract_once:NVN + \l__tag_title_optlang_regex + \l__tag_title_tmpa_tl + \l__tag_title_tmpa_seq + \seq_if_empty:NTF\l__tag_title_tmpa_seq + { + \__tag_title_pdfstring:nnN {#1}{utf16/hex}\l__tag_title_tmpa_str + } + { + \__tag_title_pdfstring:enN + {\seq_item:Nn \l__tag_title_tmpa_seq{3}}{utf16/hex}\l__tag_title_tmpa_str + } + \str_if_eq:VnF\l__tag_title_tmpa_str{<FEFF>} + { + \pdfmanagement_add:nne {Info}{Title}{\l__tag_title_tmpa_str} + } + } + \AddToDocumentProperties[hyperref]{pdftitle}{#1} + } + ,pdfsubtitle .code:n = { \AddToDocumentProperties[hyperref]{pdfsubtitle}{#1} } + } +\tl_new:N \g__tag_title_author_tl +\RenewDocumentCommand\author{O{}m} + { + \gdef\@author{#2} + \tl_gset_eq:NN\g__tag_title_author_tl\@author + \keys_set:nn {hyp}{#1} + } + +\keys_define:nn { hyp } + { + pdfauthor .code:n = + { + \tl_if_blank:nTF {#1} + { + \pdfmanagement_remove:nn {Info}{Author} + } + { + \tl_set:Ne\l__tag_title_tmpa_tl {\clist_item:on{#1}{1}} + \regex_extract_once:NVN + \l__tag_title_optlang_regex + \l__tag_title_tmpa_tl + \l__tag_title_tmpa_seq + \seq_if_empty:NTF\l__tag_title_tmpa_seq + { + \__tag_title_pdfstring:nnN {#1}{utf16/hex}\l__tag_title_tmpa_str + } + { + \__tag_title_pdfstring:enN + {\seq_item:Nn \l__tag_title_tmpa_seq{3}}{utf16/hex}\l__tag_title_tmpa_str + } + \str_if_eq:VnF\l__tag_title_tmpa_str{<FEFF>} + { + \pdfmanagement_add:nne {Info}{Author}{\l__tag_title_tmpa_str} + } + } + \AddToDocumentProperties[hyperref]{pdfauthor}{#1} + } + } +\AddToHook{cmd/maketitle/before} + { + \tl_gset_eq:NN \g__tag_title_author_tl\@author + \tl_gset_eq:NN \g__tag_title_title_tl\@title + } +\AddToHook{shipout/lastpage} + { + \tl_if_empty:eT{\GetDocumentProperties{hyperref/pdftitle}} + { + \group_begin: + \cs_set_eq:NN\thanks \use_none:n + \str_set:Ne \l__tag_title_tmpa_str {\text_purify:n { \g__tag_title_title_tl } } + \keys_set:ne{hyp}{pdftitle={\exp_not:V\l__tag_title_tmpa_str}} + \group_end: + } + \tl_if_empty:eT{\GetDocumentProperties{hyperref/pdfauthor}} + { + \group_begin: + \cs_set_eq:NN\thanks \use_none:n + \cs_set:Npn \and {,} + \str_set:Ne \l__tag_title_tmpa_str {\text_purify:n { \g__tag_title_author_tl } } + \keys_set:ne{hyp}{pdfauthor={\exp_not:V\l__tag_title_tmpa_str}} + \group_end: + } + \tl_if_empty:eF{\GetDocumentProperties{document/pdfstandard-UA}} + { + \pdfmanagement_add:nnn {Catalog / ViewerPreferences } { DisplayDocTitle } { true } + } + } +\DeclareHookRule{shipout/lastpage}{latex-lab-testphase-title}{before}{pdfmanagement-testphase} + +\endinput +%% +%% End of file `latex-lab-testphase-title.sty'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-toc.sty b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-toc.sty index bf1cb9bb87f..e4cb035ba10 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-toc.sty +++ b/Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-toc.sty @@ -35,14 +35,14 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-toc.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc.dtx (C) Copyright 2022-2024 LaTeX Project \def\ltlabtocdate{2023-10-16} \def\ltlabtocversion{0.85b} \ProvidesExplPackage {latex-lab-testphase-toc} {\ltlabtocdate} {\ltlabtocversion} { Code related to the tagging of toc-like lists} -%% File: latex-lab-toc-kernel-changes.dtx (C) Copyright 2022-2023 LaTeX Project -\def\ltlabkerneldate{2023-10-16} -\def\ltlabkernelversion{0.85b} +%% File: latex-lab-toc-kernel-changes.dtx (C) Copyright 2022-2024 LaTeX Project +\def\ltlabkerneldate{2024-02-12} +\def\ltlabkernelversion{0.85c} \RequirePackage{latex-lab-kernel-changes} \def\@contentsline@cfgpoint@before#1#2#3#4{} \def\@contentsline@cfgpoint@after#1#2#3#4{} @@ -64,7 +64,7 @@ \makeatletter \@starttoc@cfgpoint@before{#1}% \@input{\jobname.#1}% - \@starttoc@cfgpoint@after{#1} + \@starttoc@cfgpoint@after{#1}% \if@filesw \expandafter\newwrite\csname tf@#1\endcsname \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax @@ -275,7 +275,7 @@ \endgroup \fi} } -%% File: latex-lab-toc.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc.dtx (C) Copyright 2022-2024 LaTeX Project \def\ltlabtocdate{2023-10-16} \def\ltlabtocversion{0.85b} \tl_new:N \l__tag_toc_tmpa_tl @@ -372,7 +372,7 @@ { \int_compare_p:nNn { \g__tag_toc_level_int } > {-100} } { \int_compare_p:nNn { \use:c{toclevel@#1} } > { \g__tag_toc_level_int } } { - \seq_gpush:Nx \g__tag_toc_stack_seq {{TOC}\use:c{toclevel@#1}} + \seq_gpush:Ne \g__tag_toc_stack_seq {{TOC}\use:c{toclevel@#1}} \tag_struct_begin:n{tag=TOC} } \int_compare:nNnT @@ -383,10 +383,10 @@ \int_gset:Nn \g__tag_toc_level_int { \use:c{toclevel@#1} } \group_begin: \text_declare_expand_equivalent:Nn \numberline \use_none:n - \exp_args:Nx \tag_struct_begin:n{tag=TOCI,title={\text_purify:n {#2}}} - \prop_gput:Nxx \g__tag_struct_ref_by_dest_prop + \exp_args:Ne \tag_struct_begin:n{tag=TOCI,title={\text_purify:n {#2}}} + \prop_gput:Nee \g__tag_struct_ref_by_dest_prop { \tag_get:n {struct_num} }{#3} - \seq_gpush:Nx \g__tag_toc_stack_seq {{TOCI}\use:c{toclevel@#1}} + \seq_gpush:Ne \g__tag_toc_stack_seq {{TOCI}\use:c{toclevel@#1}} \group_end: } } @@ -438,7 +438,7 @@ \def\@dottedtocline@cfgpoint@leaders#1{% \tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:} -%% File: latex-lab-toc-hyperref-changes.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc-hyperref-changes.dtx (C) Copyright 2022-2024 LaTeX Project \def\ltlabtochyperdate{2023-07-20} \def\ltlabtochyperversion{0.85a} \def\hyper@nopatch@toc{} diff --git a/Master/texmf-dist/tex/latex/latex-lab/marginpar-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/marginpar-latex-lab-testphase.ltx new file mode 100644 index 00000000000..a74a5f65ef3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/latex-lab/marginpar-latex-lab-testphase.ltx @@ -0,0 +1,48 @@ +%% +%% This is file `marginpar-latex-lab-testphase.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-marginpar.dtx (with options: `latex-lab') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-marginpar.dtx +%% +\def\ltlabmarginpardate{2024-02-12} +\def\ltlabmarginparversion{0.85b} + +\ProvidesFile{marginpar-latex-lab-testphase.ltx} + [\ltlabmarginpardate\space v\ltlabmarginparversion\space + Changes related to the tagging of the margin notes] + +\RequirePackage{latex-lab-testphase-marginpar} + +\endinput +%% +%% End of file `marginpar-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/minipage-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/minipage-latex-lab-testphase.ltx index e309b479ed1..0cf1da13360 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/minipage-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/minipage-latex-lab-testphase.ltx @@ -32,7 +32,8 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-minipage.dtx (C) Copyright 2023 LaTeX Project +%% File: latex-lab-minipage.dtx +%% \def\ltlabminipagedate{2023-10-30} \def\ltlabminipageversion{0.81c} diff --git a/Master/texmf-dist/tex/latex/latex-lab/new-or-1-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/new-or-1-latex-lab-testphase.ltx index 015487e4396..915a065c5e5 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/new-or-1-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/new-or-1-latex-lab-testphase.ltx @@ -32,7 +32,7 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2023 Frank Mittelbach +%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2024 Frank Mittelbach \def\ltlabneworIdate{2023-07-20} \def\ltlabneworIversion{0.85a} \ProvidesFile{new-or-1-latex-lab-testphase.ltx} diff --git a/Master/texmf-dist/tex/latex/latex-lab/phase-I-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/phase-I-latex-lab-testphase.ltx index c2f68512e79..a672afc5968 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/phase-I-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/phase-I-latex-lab-testphase.ltx @@ -40,7 +40,7 @@ \RequirePackage{latex-lab-testphase-new-or-1} \RequirePackage{tagpdf} \AddToDocumentProperties [document]{testphase/tagpdf}{loaded} -\tagpdfsetup{activate,interwordspace} +\tagpdfsetup{activate,activate/spaces} \AddToDocumentProperties [document]{tagging}{active} \AddToDocumentProperties [document]{tagging/interwordspace}{active} \endinput diff --git a/Master/texmf-dist/tex/latex/latex-lab/phase-II-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/phase-II-latex-lab-testphase.ltx index ff7e6dd7452..0958d99b119 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/phase-II-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/phase-II-latex-lab-testphase.ltx @@ -41,7 +41,7 @@ \RequirePackage{latex-lab-testphase-new-or-2} \RequirePackage{tagpdf} \AddToDocumentProperties [document]{testphase/tagpdf}{loaded} -\tagpdfsetup{activate,paratagging,interwordspace} +\tagpdfsetup{activate,para/tagging,activate/spaces} \AddToDocumentProperties [document]{tagging/para}{active} \AddToDocumentProperties [document]{tagging}{active} \AddToDocumentProperties [document]{tagging/interwordspace}{active} diff --git a/Master/texmf-dist/tex/latex/latex-lab/phase-III-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/phase-III-latex-lab-testphase.ltx index 2f7a38ef142..c782abde3ad 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/phase-III-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/phase-III-latex-lab-testphase.ltx @@ -36,7 +36,7 @@ \ProvidesFile{phase-III-latex-lab-testphase.ltx} - [2023-07-20 v0.1b latex-lab wrapper phase-III] + [2024-02-12 v0.1c latex-lab wrapper phase-III] \input{phase-II-latex-lab-testphase.ltx} \IfFormatAtLeastTF{2023-06-01} { @@ -48,6 +48,7 @@ \RequirePackage{latex-lab-testphase-float} \RequirePackage{latex-lab-testphase-bib} \RequirePackage{latex-lab-testphase-text} + \RequirePackage{latex-lab-testphase-marginpar} } {\PackageWarning{latex-lab}{Testphase III needs newer format}{}} \endinput diff --git a/Master/texmf-dist/tex/latex/latex-lab/sec-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/sec-latex-lab-testphase.ltx index bf39e9949f7..5cd6edae269 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/sec-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/sec-latex-lab-testphase.ltx @@ -32,9 +32,9 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-sec.dtx (C) Copyright 2022-2023 LaTeX Project -\def\ltlabsecdate{2023-10-16} -\def\ltlabsecversion{0.84b} +%% File: latex-lab-sec.dtx (C) Copyright 2022-2024 LaTeX Project +\def\ltlabsecdate{2024-02-12} +\def\ltlabsecversion{0.84c} \ProvidesFile{sec-latex-lab-testphase.ltx} [\ltlabsecdate\space v\ltlabsecversion\space latex-lab wrapper sec] diff --git a/Master/texmf-dist/tex/latex/latex-lab/table-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/table-latex-lab-testphase.ltx index 850f3ffa110..b01da95717e 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/table-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/table-latex-lab-testphase.ltx @@ -32,12 +32,13 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-table.dtx (C) Copyright 2023 LaTeX Project -\def\ltlabtbldate{2023-10-30} -\def\ltlabtblversion{0.85d} +%% File: latex-lab-table.dtx (C) Copyright 2023-2024 LaTeX Project +\def\ltlabtbldate{2024-05-25} +\def\ltlabtblversion{0.85i} \ProvidesFile{table-latex-lab-testphase.ltx} [\ltlabtbldate\space v\ltlabtblversion\space latex-lab wrapper table] \RequirePackage{latex-lab-testphase-table} + \endinput %% %% End of file `table-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/tabular-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/tabular-latex-lab-testphase.ltx new file mode 100644 index 00000000000..67a80c992ab --- /dev/null +++ b/Master/texmf-dist/tex/latex/latex-lab/tabular-latex-lab-testphase.ltx @@ -0,0 +1,44 @@ +%% +%% This is file `tabular-latex-lab-testphase.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-table.dtx (with options: `latex-lab-alias') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-table.dtx (C) Copyright 2023-2024 LaTeX Project +\def\ltlabtbldate{2024-05-25} +\def\ltlabtblversion{0.85i} + +\ProvidesFile{tabular-latex-lab-testphase.ltx} + [\ltlabtbldate\space v\ltlabtblversion\space latex-lab wrapper tabular] +\RequirePackage{latex-lab-testphase-table} +\endinput +%% +%% End of file `tabular-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/tagpdf-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/tagpdf-latex-lab-testphase.ltx index 99866c0ee12..e7303e398e0 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/tagpdf-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/tagpdf-latex-lab-testphase.ltx @@ -41,7 +41,7 @@ \RequirePackage{latex-lab-testphase-new-or-2} \RequirePackage{tagpdf} \AddToDocumentProperties [document]{testphase/tagpdf}{loaded} -\tagpdfsetup{activate,paratagging,interwordspace} +\tagpdfsetup{activate,para/tagging,activate/spaces} \AddToDocumentProperties [document]{tagging/para}{active} \AddToDocumentProperties [document]{tagging}{active} \AddToDocumentProperties [document]{tagging/interwordspace}{active} diff --git a/Master/texmf-dist/tex/latex/latex-lab/tagpdf-ns-latex-lab.def b/Master/texmf-dist/tex/latex/latex-lab/tagpdf-ns-latex-lab.def index ac71752ca07..13054a4f295 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/tagpdf-ns-latex-lab.def +++ b/Master/texmf-dist/tex/latex/latex-lab/tagpdf-ns-latex-lab.def @@ -6,7 +6,8 @@ %% %% latex-lab-namespace.dtx (with options: `ns-latex-lab') %% -%% File: latex-lab-namespace.dtx (C) Copyright 2023 LaTeX Project +%% File: latex-lab-namespace.dtx +%% %% \ProvidesExplFile {tagpdf-ns-latex-lab.def} {2023-09-04} {0.8} %% {latex} {https://www.latex-project.org/ns/lab/2022}{} title, Title, pdf2, @@ -22,7 +23,7 @@ enumerate, L, pdf2, description, L, pdf2, quote, BlockQuote,pdf, quotation, BlockQuote,pdf, -verbatim, Div, pdf2, +verbatim, Div, pdf2, % overwritten by block item, LI, pdf2, itemlabel, Lbl, pdf2, itembody, LBody, pdf2, diff --git a/Master/texmf-dist/tex/latex/latex-lab/text-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/text-latex-lab-testphase.ltx index 59d30103ae9..2615850378c 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/text-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/text-latex-lab-testphase.ltx @@ -32,7 +32,7 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-text.dtx (C) Copyright 2023 LaTeX Project +%% File: latex-lab-text.dtx (C) Copyright 2023-2024 LaTeX Project \def\ltlabtextdate{2023-07-20} \def\ltlabtextversion{0.85a} diff --git a/Master/texmf-dist/tex/latex/latex-lab/title-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/title-latex-lab-testphase.ltx new file mode 100644 index 00000000000..17f603db23e --- /dev/null +++ b/Master/texmf-dist/tex/latex/latex-lab/title-latex-lab-testphase.ltx @@ -0,0 +1,49 @@ +%% +%% This is file `title-latex-lab-testphase.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% latex-lab-title.dtx (with options: `latex-lab') +%% +%% This is a generated file. +%% +%% Copyright 2021-2023 LaTeX Project +%% +%% This file was generated from file(s) of the `LaTeX-lab Bundle'. +%% ------------------------------------------------------------------------------------ +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `LaTeX-lab Bundle'. You may however distribute the `LaTeX-lab Bundle' +%% without such generated files. +%% +%% The newest sources can be found below +%% +%% https://github.com/latex3/latex2e/required/latex-lab +%% +%% where one can also log issues in case there are any. +%% +%% +%% File: latex-lab-title.dtx (C) Copyright 2023-2024 LaTeX Project +\def\ltlabtitledate{2024-02-09} +\def\ltlabtitleversion{0.85c} + + + +\ProvidesFile{title-latex-lab-testphase.ltx} + [\ltlabtitledate\space v\ltlabtitleversion\space + Changes related to the tagging of the title] + +\RequirePackage{latex-lab-testphase-title} + +\endinput +%% +%% End of file `title-latex-lab-testphase.ltx'. diff --git a/Master/texmf-dist/tex/latex/latex-lab/toc-latex-lab-testphase.ltx b/Master/texmf-dist/tex/latex/latex-lab/toc-latex-lab-testphase.ltx index 1d7e70c5d79..8b2c05d329c 100644 --- a/Master/texmf-dist/tex/latex/latex-lab/toc-latex-lab-testphase.ltx +++ b/Master/texmf-dist/tex/latex/latex-lab/toc-latex-lab-testphase.ltx @@ -32,7 +32,7 @@ %% where one can also log issues in case there are any. %% %% -%% File: latex-lab-toc.dtx (C) Copyright 2022-2023 LaTeX Project +%% File: latex-lab-toc.dtx (C) Copyright 2022-2024 LaTeX Project \def\ltlabtocdate{2023-10-16} \def\ltlabtocversion{0.85b} \ProvidesFile{toc-latex-lab-testphase.ltx} |