diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-block.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/latex-lab/latex-lab-testphase-block.sty | 103 |
1 files changed, 60 insertions, 43 deletions
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 } } |