diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt index effd0b35f..d784547e5 100644 --- a/required/latex-lab/changes.txt +++ b/required/latex-lab/changes.txt @@ -1,3 +1,17 @@ +2024-11-23 Frank Mittelbach + + * latex-lab-block.dtx (subsubsection{Implementation of block templates \ldots}): + Use private storage bin for parindent and not \listparindent to decouple block + and list templates (tagging/767) + + (subsubsection{Blockquote instances}): + Theorems use their own block-instance and not displayblock to allow for + customization (tagging/767) + + * latex-lab-firstaid.dtx (subsection{ams classes and amsthm}): + Move the theorem link target later to not have to force hmode with \leavevmode. + Otherwise theorems get always an indentation. + 2024-11-21 Ulrike Fischer * latex-lab-float.dtx: Correct socket declaration. @@ -6,7 +20,7 @@ 2024-10-25 Ulrike Fischer * latex-lab-math.dtx: reorganized luamml and mathml options - to support also structure elements and extended the documentation. Corrected + to support also structure elements and extended the documentation. Corrected handling of alt-texts. Added examples for the various options. 2024-10-16 Ulrike Fischer diff --git a/required/latex-lab/latex-lab-block.dtx b/required/latex-lab/latex-lab-block.dtx index 74d68c495..2399d1562 100644 --- a/required/latex-lab/latex-lab-block.dtx +++ b/required/latex-lab/latex-lab-block.dtx @@ -9,14 +9,17 @@ % % https://www.latex-project.org/lppl.txt % -\def\ltlabblockdate{2024-10-11} -\def\ltlabblockversion{0.8v} +\def\ltlabblockdate{2024-11-25} +\def\ltlabblockversion{0.8w} %<*driver> \documentclass[kernel]{l3doc} \usepackage{amstext} \EnableCrossrefs \CodelineIndex +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{4} + \usepackage{todonotes} \begin{document} @@ -61,8 +64,9 @@ % printtype=\textit{inst.}] {Instance}{instance} % % -% \newcommand\valuefrom[1]{\textrm{value from }\texttt{#1}} % \newcommand\key[1]{\texttt{#1}} +% \newcommand\keyvalue[1]{\texttt{#1}} +% \newcommand\valuefrom[1]{\textrm{value from }\key{#1}} % % % \NewDocumentCommand\fmi{sO{}m} @@ -98,7 +102,7 @@ % \def\TemplateKey##1##2##3##4{^^A % \item[\texttt{##1}~(\textit{\mdseries##2})]##3^^A % \ifx\TemplateKey##4\TemplateKey\else -% \hfill\penalty500\hbox{}\hfill Default:~\texttt{##4}^^A +% \hfill\penalty500\hbox{}\hfill Default:~\keyvalue{##4}^^A % \nobreak\hskip-\parfillskip\hskip0pt\relax % \fi % \par @@ -239,14 +243,14 @@ % {An explicit tag class attribute}{} % \TemplateKey{tagging-recipe}{tokenlist} % {Defines the way tagging is done. Currently the values -% \texttt{basic}, \texttt{standard}, and \texttt{list} +% \keyvalue{basic}, \keyvalue{standard}, and \keyvalue{list} % are supported}{standard} % \TemplateKey{level-increase}{boolean}{Does this \xt{blockenv} % increase the block level if it is nested in an outer block?}{true} % \TemplateKey{setup-code}{tokenlist} % {Initial setup code. This is -% executed after legacy defaults (from \cs{@listi}, -% \cs{@listii}, etc.) are used but before the block instance is called}{} +% executed after legacy defaults (from \tn{@listi}, +% \tn{@listii}, etc.) are used but before the block instance is called}{} % \TemplateKey{block-instance}{tokenlist}{Part of the name of the % \xt{block} instance that is called. The full name has % a \texttt{-}\meta{level} appended}{displayblock} @@ -263,22 +267,22 @@ % \TemplateKey{inner-instance}{tokenlist}{Name of the inner instance % (if any).}{} % \TemplateKey{para-flattened}{boolean}{\emph{describe}}{false} -% \TemplateKey{final-code}{tokenlist}{Final setup code}{\cs{ignorespaces}} +% \TemplateKey{final-code}{tokenlist}{Final setup code}{\tn{ignorespaces}} % % \TemplateSemantics % % This \xt{blockenv} template supports the legacy list setting that -% are found in many document classes in the macros \cs{@listi}, -% \cs{@listii}, up to \cs{@listvi}. It also uses the counter -% \cs{@listdepth} to track nesting of block, again mainly to +% are found in many document classes in the macros \tn{@listi}, +% \tn{@listii}, up to \tn{@listvi}. It also uses the counter +% \tn{@listdepth} to track nesting of block, again mainly to % support legacy setups (internally it gives it a more appropriate % name but it remains accessible through the \LaTeXe{} name). % % % It first checks that nothing is too deeply nested. % If the level should increase then the increments the -% \cs{@listdepth} counter and -% calls the corresponding \cs{@list...} macro to update the legacy +% \tn{@listdepth} counter and +% calls the corresponding \tn{@list...} macro to update the legacy % defaults. If \key{level-increase} is set to false this is bypassed. % % It then sets up the @@ -302,21 +306,21 @@ % called. % % Finally, the \key{final-code} is executed (by default -% \cs{ignorespaces}). +% \tn{ignorespaces}). % % % \end{TemplateDescription} % % The maximum number of \xt{blockenv}s that can be nested into each % other is restricted by the \LaTeX{} counter -% \texttt{maxblocklevels} with a default value of \texttt{6}. If this +% \texttt{maxblocklevels} with a default value of \keyvalue{6}. If this % value is increased then it is necessary to provide additional % instances, e.g., \texttt{displayblock-7}, etc. Decreasing is, of % course, always possible, then some of the instances defined are not % used and instead the user gets an error that there is too much % nesting going on. % -% If the key \key{level-increase} is set to \texttt{false} then such +% If the key \key{level-increase} is set to \keyvalue{false} then such % an environment doesn't alter the nesting level and therefore you can % nest those environments as often as you like (a typical example % would be \env{flushleft} anywhere in the nesting hierarchy, that @@ -326,18 +330,18 @@ % \begin{TemplateDescription}{block}{display} % % \TemplateKey{heading}{tokenlist}{\emph{not really used yet}}{} -% \TemplateKey{beginsep}{skip}{}{\cs{topsep}} -% \TemplateKey{begin-par-skip}{skip}{}{\cs{partopsep}} -% \TemplateKey{par-skip}{skip}{}{\cs{parsep}} +% \TemplateKey{beginsep}{skip}{}{\tn{topsep}} +% \TemplateKey{begin-par-skip}{skip}{}{\tn{partopsep}} +% \TemplateKey{par-skip}{skip}{}{\tn{parsep}} % \TemplateKey{end-skip}{skip}{}{\valuefrom{beginsep}} % \TemplateKey{end-par-skip}{skip}{}{\valuefrom{begin-par-skip}} % \TemplateKey{item-skip}{skip}{The space in front of an item if the -% block is a list; if not the setting has no effect}{\cs{itemsep}} -% \TemplateKey{beginpenalty}{integer}{}{\cs{@beginparpenalty}} -% \TemplateKey{endpenalty}{integer}{}{\cs{@endparpenalty}} -% \TemplateKey{leftmargin}{length}{}{\cs{leftmargin}} -% \TemplateKey{rightmargin}{length}{}{\cs{rightmargin}} -% \TemplateKey{parindent}{length}{}{\cs{listparindent}} +% block is a list; if not the setting has no effect}{\tn{itemsep}} +% \TemplateKey{beginpenalty}{integer}{}{\tn{@beginparpenalty}} +% \TemplateKey{endpenalty}{integer}{}{\tn{@endparpenalty}} +% \TemplateKey{leftmargin}{length}{}{\tn{leftmargin}} +% \TemplateKey{rightmargin}{length}{}{\tn{rightmargin}} +% \TemplateKey{parindent}{length}{}{0pt} % % \TemplateSemantics % @@ -358,14 +362,14 @@ % % \begin{TemplateDescription}{para}{std} % -% \TemplateKey{indent-width}{length}{}{\cs{parindent}} +% \TemplateKey{indent-width}{length}{}{\tn{parindent}} % \TemplateKey{start-skip}{skip}{}{0pt} % \TemplateKey{left-skip}{skip}{}{0pt} % \TemplateKey{right-skip}{skip}{}{0pt} -% \TemplateKey{end-skip}{skip}{}{\cs{@flushglue}} +% \TemplateKey{end-skip}{skip}{}{\tn{@flushglue}} % \TemplateKey{fixed-word-spaces}{boolean}{}{false} % \TemplateKey{final-hyphen-demerits}{integer}{}{5000} -% \TemplateKey{cr-cmd}{tokenlist}{}{\cs{@normalcr}} +% \TemplateKey{cr-cmd}{tokenlist}{}{\tn{@normalcr}} % \TemplateKey{para-class}{tokenlist}{}{justify} % % \TemplateSemantics @@ -396,13 +400,13 @@ % \TemplateKey{item-indent}{length}{Horizontal displacement of the item.}{0pt} % \TemplateKey{item-penalty}{integer} % {Penalty for breaking before an -% item (except the first)}{\cs{@itempenalty}} +% item (except the first)}{\tn{@itempenalty}} % \TemplateKey{label-width}{length} -% {Width reserved for the formatted item label}{\cs{labelwidth}} +% {Width reserved for the formatted item label}{\tn{labelwidth}} % \TemplateKey{label-sep}{length} -% {Horizontal separation between label and following text}{\cs{labelsep}} +% {Horizontal separation between label and following text}{\tn{labelsep}} % \TemplateKey{legacy-support}{boolean} -% {Is formatting the label via \cs{makelabel} supported?}{false} +% {Is formatting the label via \tn{makelabel} supported?}{false} % % \TemplateSemantics % @@ -412,16 +416,16 @@ % % \begin{TemplateDescription}{item}{std} % -% \TemplateKey{counter-label}{function{1}}{\emph{unused}}{\cs{arabic}\{\#1\}} +% \TemplateKey{counter-label}{function{1}}{\emph{unused}}{\tn{arabic}\{\#1\}} % \TemplateKey{counter-ref}{function{1}}{\emph{unused}}{\valuefrom{counter-label}} % \TemplateKey{label-ref}{function{1}}{\emph{unused}}{\#1} % \TemplateKey{label-autoref}{function{1}}{\emph{unused}}{item~\#1} % \TemplateKey{label-format}{function{1}} % {Formatting of the label, questionable the way it is used}{\#1} -% \TemplateKey{label-strut}{boolean}{Add a \cs{strut} to the label?}{false} +% \TemplateKey{label-strut}{boolean}{Add a \tn{strut} to the label?}{false} % \TemplateKey{label-align}{choice} -% {Supported values \texttt{left},\texttt{center}, -% \texttt{right}, and \texttt{parleft}. \emph{Only partly implemented}}{right} +% {Supported values \keyvalue{left},\keyvalue{center}, +% \keyvalue{right}, and \keyvalue{parleft}. \emph{Only partly implemented}}{right} % \TemplateKey{label-boxed}{boolean} % {Should the label be boxed?}{true} % \TemplateKey{next-line}{boolean}{}{false} @@ -551,7 +555,8 @@ % \key{tagging-recipe} of the \xt{blockenv} template. Currently the % following values are implemented: % \begin{description} -% \item[\texttt{standalone}] +% \raggedright +% \item[\keyvalue{standalone}] % This recipe does the following: % \begin{itemize} % \item @@ -562,7 +567,7 @@ % \item % Text inside the body of the environment start with % \struct{text-unit}\struct{text} unless the key -% \key{para-flattened} is set to \texttt{true} +% \key{para-flattened} is set to \keyvalue{true} % (which is most likely the wrong thing to do because we then get just % \struct{text} as the structure). % @@ -575,7 +580,7 @@ % \struct{text-unit} is started, if appropriate, e.g., if text is following. % \end{itemize} % -% \item[\texttt{basic}] +% \item[\keyvalue{basic}] % This recipe does the following: % \begin{itemize} % \item @@ -587,7 +592,7 @@ % % \item % Text inside the body of the environment start with -% \struct{text-unit}\struct{text} if \key{para-flattened} is set to \texttt{false}, +% \struct{text-unit}\struct{text} if \key{para-flattened} is set to \keyvalue{false}, % otherwise just with \struct{text}. % % \item @@ -596,14 +601,14 @@ % % \item % Then look if the environment is followed by an empty line -% (\cs{par}). If so, close the outer \struct{/text-unit} and start any +% (\tn{par}). If so, close the outer \struct{/text-unit} and start any % following text with \struct{text-unit}\struct{text}. Otherwise, % don't and following text restarts with a just a \struct{text} (and no % paragraph indentation) % \end{itemize} % -% \item[\texttt{standard}] -% This recipe is like the \texttt{basic} one as far as handling +% \item[\keyvalue{standard}] +% This recipe is like the \keyvalue{basic} one as far as handling % \struct{text-unit} and \struct{text} is concerned. In addition % \begin{itemize} % \item @@ -622,8 +627,8 @@ % % % -% \item[\texttt{list}] -% This recipe is like the \texttt{standard} one except that +% \item[\keyvalue{list}] +% This recipe is like the \keyvalue{standard} one except that % \begin{itemize} % \item % the inner structure is a list (\struct{L}). @@ -667,7 +672,7 @@ % \end{function} % % \begin{function}{\@setupverbinvisiblespace} -% A counterpart definition to the kernel command \cs{@setupverbinvisiblespace}, +% A counterpart definition to the kernel command \tn{@setupverbinvisiblespace}, % needed as we need to handle real space chars in verbatim. % \end{function} % @@ -680,7 +685,7 @@ % \end{function} % % \begin{function}{\item,\@itemlabel} -% The \cs{item} is redefined. +% The \tn{item} is redefined. % \end{function} % % \begin{function}{\c@maxblocklevels} @@ -689,7 +694,7 @@ % \end{function} % % \begin{function}{\begin} -% The \cs{begin} is slightly redefine to handle \cs{@doendpe} better. +% The \tn{begin} is slightly redefine to handle \tn{@doendpe} better. % TODO: move to kernel % \end{function} % @@ -732,22 +737,17 @@ \ExplSyntaxOn % \end{macrocode} % -% \ufi{this variable(s) must be declared:} -% \begin{macrocode} -\tl_new:N \l_@@_item_align_tl -\tl_new:N\l_@@_legacy_env_params_tl -% \end{macrocode} % -% \subsection{Handling \cs{par} after the end of the list} +% \subsection{Handling \tn{par} after the end of the list} % -% An empty line (or a \cs{par}) after a list has semantic meaning as +% An empty line (or a \tn{par}) after a list has semantic meaning as % it defines whether then following text is logically within the same % paragraph as the list (no empty line) or whether it starts a new % paragraph and the paragraph containing the list ends at the end of % the list (empty line after the list). % This is handled by \LaTeX{} using a legacy flag called % \texttt{@endpe} and set of commands inside the -% generic \cs{end} (calling \cs{@doendpe}) and as part of the list +% generic \tn{end} (calling \tn{@doendpe}) and as part of the list % environments identifying themselves as \enquote{paragraph ending % environments} (by setting this flag). % @@ -775,8 +775,8 @@ \__kernel_displayblock_doendpe: % \end{macrocode} % -% The standard \cs{par} command (\cs{par_end:}) acts on -% \texttt{@endpe} and attempts to close a still open \texttt{text-unit} +% The standard \tn{par} command (\cs{par_end:}) acts on +% \texttt{@endpe} and attempts to close a still open \struct{text-unit}s % and this would be wrong if it was already closed above. So we % have to reset the switch to false first. % \begin{macrocode} @@ -849,19 +849,20 @@ % \begin{macrocode} \DeclareTemplateInterface{block}{display}{1} { - heading : tokenlist = , %?? + heading : tokenlist = , % ?? beginsep : skip = \topsep , begin-par-skip : skip = \partopsep , par-skip : skip = \parsep , - end-skip : skip = \KeyValue{beginsep} , % conflict with name below + end-skip : skip = \KeyValue{beginsep} , % conflict with name below end-par-skip : skip = \KeyValue{begin-par-skip} , item-skip : skip = \itemsep , beginpenalty : integer = \UseName{@beginparpenalty} , endpenalty : integer = \UseName{@endparpenalty} , leftmargin : length = \leftmargin , rightmargin : length = \rightmargin , - parindent : length = \listparindent , -% font : tokenlist % maybe add? (or more general for fonts and color) + parindent : length = 0pt , +% maybe add? (or more general for fonts and color) +% font : tokenlist } % \end{macrocode} % \end{template} @@ -872,6 +873,7 @@ % \begin{macrocode} \DeclareTemplateInterface{para}{std}{1} { + para-class : tokenlist = justify , indent-width : length = \parindent , start-skip : skip = 0pt , left-skip : skip = 0pt , @@ -880,7 +882,6 @@ fixed-word-spaces : boolean = false , final-hyphen-demerits : integer = 5000 , cr-cmd : tokenlist = \@normalcr , - para-class : tokenlist = justify , } % \end{macrocode} % \end{template} @@ -1019,3102 +1020,3253 @@ % % % -% \subsection{Implementation of the document-level block environments} % -% Most such environments are pretty simple: they take an option -% argument and call a \texttt{blockenv} instance to do the work. At -% the end of environment we call \cs{endblockenv} to finish. % +% \subsection{Implementation of templates} % -% \subsubsection{Displayblock environments} % +% \subsubsection{Implementation of blockenv templates \ldots} % -% There are two basic block environment which are similar to -% \LaTeXe{}'s \env{trivlist} except that there aren't degenerated -% lists and thus have no hidden \cs{item} inside. % % -% \begin{environment}{displayblock} -% +% \begin{macro}{\g_block_nesting_depth_int} +% \LaTeXe{} already has a counter to record the nesting depth of +% blocks, but we want our own name because it isn't really tied to +% \enquote{lists} any more. However, \tn{@listdepth} is really part +% of the legacy interface (for example \env{minipage} alters it to +% point to a different counter) so that we are stuck with using at +% least indirectly for now and the following line makes this look +% like an L3 integer variable but internally expands to \tn{@listdepth}: % \begin{macrocode} -\NewDocumentEnvironment{displayblock}{ !O{} } - { \UseInstance{blockenv}{displayblock} {#1} } - { \endblockenv } +\cs_new:Npn \g_block_nesting_depth_int { \@listdepth } % a fake int + % for now % \end{macrocode} -% \end{environment} -% -% +% \end{macro} % % -% \begin{environment}{displayblockflattened} +% \begin{template}{blockenv display} % % \begin{macrocode} -\NewDocumentEnvironment{displayblockflattened}{ !O{} } - { \UseInstance{blockenv}{displayblockflattened} {#1} } - { \endblockenv } -% \end{macrocode} -% \end{environment} -% -% -% -% -% -% +\DeclareTemplateCode{blockenv}{display}{1} +{ + env-name = \l_@@_env_name_tl , + tag-name = \l_@@_tag_name_tl , + tag-class = \l_@@_tag_class_tl , + tagging-recipe = \l_@@_tagging_recipe_tl , + level-increase = \l_@@_level_incr_bool , + setup-code = \l_@@_setup_code_tl , + block-instance = \l_@@_block_instance_tl , + para-instance = \l_@@_para_instance_tl , + para-flattened = \l__tag_para_flattened_bool , + inner-level-counter = \l_@@_inner_level_counter_tl , + max-inner-levels = \l_@@_max_inner_levels_tl , + inner-instance-type = \l_@@_inner_instance_type_tl , + inner-instance = \l_@@_inner_instance_tl , + final-code = \l_@@_final_code_tl , +} +{ + \@@_debug_typeout:n{\l_@@_env_name_tl -env-start} +% + \tl_if_empty:nF {#1} { \SetTemplateKeys{blockenv}{display}{#1} } % +% \end{macrocode} +% We need to know later if we have nested blockenvs inside +% a flattened environment. Whenever we start a new blockenv we +% increment \cs{l__tag_block_flattened_level_int} if it is already +% different from zero. If it is zero we increment it if flattening +% is requested. +% Thus a value of \texttt{0} means no flattening requested so far +% and \texttt{1} means this is the first blockenv requesting +% flattening. In either case we have to make sure that the blockenv +% is surrounded by a \struct{text-unit} tag, while for any value above +% \texttt{1} we have to omit the \struct{text-unit}. + % \begin{macrocode} + \int_compare:nNnTF \l__tag_block_flattened_level_int > 0 + { + \int_incr:N \l__tag_block_flattened_level_int + } + { + \bool_if:NT \l__tag_para_flattened_bool + { + \int_incr:N \l__tag_block_flattened_level_int + } + } % -% \begin{environment}{center,flushleft,flushright} -% + \tl_if_empty:NF \l_@@_inner_level_counter_tl + { + \int_compare:nNnTF \l_@@_inner_level_counter_tl > + { \l_@@_max_inner_levels_tl - 1 } + { \@toodeep } + { \int_incr:N \l_@@_inner_level_counter_tl } % not clean "o"? + } +% \end{macrocode} +% Legacy defaults are only roped in if the list level changes. For +% display blocks that remain on the same level the current values +% are kept. % \begin{macrocode} -\AddToHook{begindocument/before}{ - \RenewDocumentEnvironment{center} { !O{} } - { \UseInstance{blockenv}{center}{#1} } - { \endblockenv } + \bool_if:NT \l_@@_level_incr_bool + { + \int_compare:nNnTF \g_block_nesting_depth_int > + { \c@maxblocklevels - 1 } + { \@toodeep } + { + \int_gincr:N \g_block_nesting_depth_int % \end{macrocode} -% +% If there are no legacy defaults for that level then the next line +% does nothing, i.e., the current values (from the last level +% become the defaults for the next. % \begin{macrocode} - \RenewDocumentEnvironment{flushright} { !O{} } - { \UseInstance{blockenv}{flushright}{#1} } - { \endblockenv } + \use:c { @list \int_to_roman:n + { \g_block_nesting_depth_int } } + } + } % \end{macrocode} -% +% If we are doing tagging we load one of the available recipes for +% tagging, which alters various kernel hooks to add appropriate +% tagging structures. % \begin{macrocode} - \RenewDocumentEnvironment{flushleft} { !O{} } - { \UseInstance{blockenv}{flushleft}{#1} } - { \endblockenv } -} + \tag_if_active:T + { \use:c { @@_recipe_ \l_@@_tagging_recipe_tl : } } % \end{macrocode} -% -% -% \end{environment} -% -% -% -% -% \subsubsection{Display quote environments} -% -% -% \begin{environment}{quote,quotation} -% +% The default for \env{list} environments is that they have an +% empty label and are not numbered (something that is then +% overwritting by the setup of a specific list). We ensure +% this here even for non-lists, because we need a defined state +% that then can be overwritting by the legacy setup code for +% the \env{list} environment in \cs{l_@@_setup_code_tl}. +% This is needed in case lists are nested as they otherwise would +% inherit outer values (and suddenly an \env{itemize} would start +% incrementing an outer \env{enumerate} counter, etc. +% \changes{v0.8v}{2024/10/11}{Set the defaults for \tn{@itemlabel}, +% \tn{@listctr} and \texttt{@nmbrlist} early in the block code +% before the setup code gets executed (tagging/730)} % \begin{macrocode} -\AddToHook{begindocument/before}{ - \RenewDocumentEnvironment{quote}{ !O{} } - { \UseInstance{blockenv}{quote} {#1} } - { \endblockenv } + \tl_clear:N \@itemlabel + \tl_clear:N \@listctr + \legacy_if_set_false:n { @nmbrlist } % \end{macrocode} -% +% Then run the setup code if any is given in the instance. % \begin{macrocode} - \RenewDocumentEnvironment{quotation}{ !O{} } - { \UseInstance{blockenv}{quotation} {#1} } - { \endblockenv } -} + \l_@@_setup_code_tl % \end{macrocode} -% \end{environment} -% -% -% -% -% -% -% \subsubsection{Verbatim environments} -% -% -% \begin{environment}{verbatim,verbatim*} -% +% Next call a block instance at the appropriate level passing it +% any key/value list provided in the optional argument (keys that +% are not recognized are ignored---currently with an +% error). % \begin{macrocode} -\AddToHook{begindocument/before}{ - \RenewDocumentEnvironment{verbatim}{ !O{} } - { \UseInstance{blockenv}{verbatim} {#1} + \@@_debug_typeout:n{use~ instance:~ + \l_@@_block_instance_tl - \int_use:N \g_block_nesting_depth_int } + \UseInstance{block} + { \l_@@_block_instance_tl - \int_use:N + \g_block_nesting_depth_int } + {#1} % \end{macrocode} -% This is the part of the code where \env{verbatim} -% and\env{verbatim*} differ. +% After the block instance call the para and then inner (list) +% instance if either or both are +% specified (which may not be the case). % \begin{macrocode} - \@setupverbinvisiblespace\frenchspacing\@vobeyspaces - \@xverbatim - } - { \endblockenv } + \tl_if_empty:NF \l_@@_para_instance_tl + { + \@@_debug_typeout:n{ use~ para~ instance:~ + \l_@@_para_instance_tl } % \end{macrocode} -% +% For now we don't offer to alter instance parameters here so we +% pass an empty argument. % \begin{macrocode} - \RenewDocumentEnvironment{verbatim*}{ !O{} } - { \UseInstance{blockenv}{verbatim} {#1} - \@setupverbvisiblespace\frenchspacing\@vobeyspaces - \@sxverbatim + \UseInstance{para}{ \l_@@_para_instance_tl } {} } - { \endblockenv } -} % \end{macrocode} -% \end{environment} -% -% -% -% \paragraph{Helper commands for verbatim} -% -% -% \begin{macro}{\legacyverbatimsetup} -% -% This code resembles the \LaTeXe{} verbatim implementation with a -% slight twist: in \LaTeXe{} each code line was a paragraph using -% \cs{leftskip}=\cs{@totalleftmargin}. This was possible because -% the whole environment was implemented as a trivlist. As this is -% no longer the case setting \cs{leftskip} would alter the layout -% of a surrounding list. So instead we need to make sure that the -% paragraph end is executed in a group so that any parshape setup -% is preserved. +% The inner instance may have its own levels or none depending +% on which the instance name differs. Again we pass it the optional +% key/value list. % \begin{macrocode} -%<@@=> -\def\legacyverbatimsetup{% - \language\l@nohyphenation - \@tempswafalse - \def\par{% - \if@tempswa - \leavevmode \null {\@@par}\penalty\interlinepenalty - \else - \@tempswatrue - \ifhmode{\@@par}\penalty\interlinepenalty\fi - \fi}% - \let\do\@makeother \dospecials - \obeylines \verbatim@font \@noligs - \everypar \expandafter{\the\everypar \unpenalty}% + \tl_if_empty:NF \l_@@_inner_instance_tl + { + \@@_debug_typeout:n{use~ instance:~ \l_@@_inner_instance_tl + \tl_if_empty:NF \l_@@_inner_level_counter_tl + { - \int_use:N \l_@@_inner_level_counter_tl }} + \UseInstance{ \l_@@_inner_instance_type_tl } + { \l_@@_inner_instance_tl + \tl_if_empty:NF \l_@@_inner_level_counter_tl + % not clean use "o"? + { - \int_use:N \l_@@_inner_level_counter_tl } + } + {#1} + } % \end{macrocode} -% +% We finish off with \cs{l_@@_final_code_tl} which defaults to +% \tn{ignorespaces} so that spaces between \verb=\begin{...}= and +% the start of the text are ignored. % \begin{macrocode} - \tl_set:Nn \l__tag_para_main_tag_tl {codeline} - \tagtool{paratag=Code}% oder faster: \tl_set:Nn\l__tag_para_tag_tl{Code} + \l_@@_final_code_tl } -%<@@=block> % \end{macrocode} -% \end{macro} +% \end{template} % % -% \begin{macro}{\@setupverbinvisiblespace} -% In the \pdfTeX{} engine we need to use \cs{pdffakespace} chars -% for the invisible spaces. +% \begin{macro}{\l__tag_block_flattened_level_int} +% Count the levels of nested blockenvs starting with the first that +% is \enquote{flattened}. The counter is defined in lttagging.dtx, +% but until the next release 11/24 we set it up here too % \begin{macrocode} -\newcommand\@setupverbinvisiblespace{} -\tag_if_active:T { - \bool_if:NF\g__tag_mode_lua_bool - { - \renewcommand\@setupverbinvisiblespace{\def\@xobeysp{\nobreakspace\pdffakespace}} - } -} +\int_if_exist:NF \l__tag_block_flattened_level_int + { + \int_new:N \l__tag_block_flattened_level_int + } % \end{macrocode} % \end{macro} % -% -% \subsubsection{Standard list environments} -% -% -% \begin{environment}{itemize,enumerate,description} -% -% For the standard lists everything is managed by the blockenv instance. +% \begin{macro}{\c@maxblocklevels} +% A counter to increase or decrease the number of supported +% level. If increased, one needs to supply additional level instances. % \begin{macrocode} -\AddToHook{begindocument/before}{ - \RenewDocumentEnvironment{itemize}{!O{}} - { \UseInstance{blockenv}{itemize} {#1} } - { \endblockenv } +\newcounter{maxblocklevels} +\setcounter{maxblocklevels}{6} % \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endblockenv} +% The code executed when a blockenv ends is 99\% the same for all +% blockenvs (at least up to now). Small differences exist, though. They +% are accounted for first in the conditionals. % +% We make this a public command so that new block environments can +% be set up without the need to resort to L3 layer +% programming.\fmi{name is bad} % \begin{macrocode} - \RenewDocumentEnvironment{enumerate}{!O{}} - { \UseInstance{blockenv}{enumerate} {#1} } - { \endblockenv } +\cs_new:Npn \endblockenv { + \@@_debug_typeout:n{blockenv~ common~ ending \on@line} % \end{macrocode} -% +% If this block was incrementing the level we have to decrement it +% now again: % \begin{macrocode} - \RenewDocumentEnvironment{description}{!O{}} - { \UseInstance{blockenv}{description} {#1} } - { \endblockenv } -} + \bool_if:NT \l_@@_level_incr_bool + { \int_gdecr:N \g_block_nesting_depth_int } % \end{macrocode} -% \end{environment} -% -% -% \subsubsection{verse environment} -% -% \begin{environment}{verse} -% The verse environment has not special tagging currently. It is -% defined as a simple standard list and takes the tagging from there. -% But it must be redefined so that \cs{itemindent} is correctly set. +% If this block was a list and there are still \tn{item} labels to +% be placed we move to horizontal mode to get them typeset. % \begin{macrocode} -\AddToHook{begindocument/before}{ - \RenewDocumentEnvironment{verse}{ !O{} } - { - \let\\\@centercr - \UseInstance{blockenv}{list} - { - item-indent=-1.5em, - parindent=-1.5em, - item-skip=0pt, - rightmargin=\leftmargin, - leftmargin=\leftmargin+1.5em, - #1 - } - \item\relax + \legacy_if:nT { @inlabel } + { + \mode_leave_vertical: + \legacy_if_gset_false:n { @inlabel } } - { \endblockenv } - } % \end{macrocode} -% \end{environment} -% -% -% \begin{environment}{list} -% -% The legacy 2e list environment is more complicated as we have to get the -% extra arguments accounted for. +% If we are ending a list environment and we have not seen any +% \tn{item}, i.e., \texttt{@newlist} is still true, we raise an +% error. In basic a ``displayblock'' scenario \texttt{@newlist} will +% always be false, but if such an environment appears inside an outer +% list then \tn{noitemerr} could still be triggered and that is undesirable +% (as the missing item will be detected at the wrong point and again later, +% during the outer list processing). We +% therefore run it only if the current environment is a list. +% \changes{v0.8q}{2024/09/03}{Raise a \tn{@noitemerr} if appropriate} % \begin{macrocode} -\AddToHook{begindocument/before}{ - \RenewDocumentEnvironment{list}{O{} m m } - { + \@@_if_list:T { \legacy_if:nT { @newlist } { \@noitemerr } } % \end{macrocode} -% We do this by storing them away and then call the list -% instance. Inside this instance the \texttt{setup-code} key -% contains \cs{legacylistsetupcode}, which makes use of the stored values. -% \changes{v0.8v}{2024/10/11}{Update \cs{@itemlabel} in -% \cs{l_@@_legacy_env_params_tl} and not at the start of the -% environment (tagging/730)} % \begin{macrocode} - \tl_set:Nn \l_@@_legacy_env_params_tl - { - \tl_set:Nn \@itemlabel {#2} - #3 - } + \mode_if_horizontal:TF + { \@@_skip_remove_last: \@@_skip_remove_last: \par } + { \@inmatherr{\end{\@currenvir}} } % \end{macrocode} -% +% Once we are back in vertical mode we can add the appropriate +% closing tagging structure(s), if we are doing tagging. % \begin{macrocode} - \UseInstance{blockenv}{list} {#1} - } - { \endblockenv } -} + \__kernel_displayblock_end: % \end{macrocode} -% -% \end{environment} -% -% -% -% -% \begin{macro}{\legacylistsetupcode} -% -% And here is the extra code for use in the list instance setup -% inside the key \texttt{setup-code}. +% Resetting the \texttt{@newlist} switch is also only done if the +% current enviornment is a list and not unconditionally. +% \changes{v0.8q}{2024/09/03}{Setting \texttt{@newlist} to false +% moved after tagging code if in a list} % \begin{macrocode} -\cs_new:Npn \legacylistsetupcode { + \@@_if_list:T { \legacy_if_gset_false:n { @newlist } } % \end{macrocode} -% Reset values to defaults: +% What to do in terms of vertical spacing in different situations +% is still somewhat open to debate, right now this is more or less +% implementing what \LaTeXe{} list environment have been +% doing.\fmi{some redesign/extensions here?} % \begin{macrocode} - \dim_zero:N \listparindent - \dim_zero:N \rightmargin - \dim_zero:N \itemindent +% \@@_debug_typeout:n{@noparlist = +% \legacy_if:nTF { @noparlist }{true}{false}} + \legacy_if:nF { @noparlist } + { + \@@_skip_set_to_last:N \l_tmpa_skip + \dim_compare:nNnT \l_tmpa_skip > \c_zero_dim + { + \skip_vertical:n { - \l_tmpa_skip } + \skip_vertical:n { \l_tmpa_skip + \parskip - \@outerparskip } + } + \addpenalty \@endparpenalty + \addvspace \l_@@_topsepadd_skip % \end{macrocode} -% -% By default a \env{list} environment is not numbered, but this -% happens already in the block template. -% \changes{v0.8v}{2024/10/11}{Set the defaults for \cs{@itemlabel}, -% \cs{@listctr} and \texttt{@nmbrlist} early in the block code -% before the setup code gets executed (tagging/730)} +% \LaTeXe{} triggered the paragraph handling after a list at this +% point here, i.e., only if the list didn't start a paragraph. One +% can make a case for that, but it can be somewhat surprising to +% the user and there is a good argument that even such a list could +% be followed explanatory text that is part of the same paragraph +% and doesn't start a new one.\fmi{decide which logic we want to +% use! If the old logic is used we need to close the text-unit +% ourselves in the true branch} % \begin{macrocode} -% \tl_set:Nn \@listctr {} -% \legacy_if_set_false:n { @nmbrlist } % needed if lists are nested +% \legacy_if_gset_true:n { @endpe } + } % \end{macrocode} -% By default there is a simple definition for \cs{makelabel}. It can be -% overwritten in the second mandatory argument to the list -% environment (stored in \cs{l_@@_legacy_env_params_tl}) and -% is used if the instance sets the compatibility key to true. +% So this is for now always done. Probably \cs{l_@@_topsepadd_skip} above +% should be added only if the paragraph ends here and not if it +% continues, so this need some further cleanup.\fmi{decide} +% +% Finally, we have a socket that handles the \tn{par} handling +% after the block. Normally, we use it with the \plug{on} plug (check for a +% following \tn{par}) but in the case of standalone environments we +% assign it the \plug{off} plug. % \begin{macrocode} - \let\makelabel\@mklab % TODO: customize + \socket_use:n {tagsupport/block-endpe} +} % \end{macrocode} -% Now we use the argument with parameter settings to update some or -% all of the above defaults: +% +% \end{macro} +% +% +% \begin{macro}{\@@_if_list:T} +% The following code may need some redesigning, as there is no good test for \enquote{is +% this environment a \enquote{list} that has \tn{item}s}. For now +% this here does the trick well enough.\fmi{revisit} +% \changes{v0.8q}{2024/09/03}{Provide a test for: Am I in a list?} % \begin{macrocode} - \l_@@_legacy_env_params_tl +\cs_new:Npn \@@_if_list:T + { \tl_if_eq:NnT \l_@@_block_instance_tl {list} } % \end{macrocode} -% As we don't know much about this list we can only make a guess about -% the nature of the list and the setting of the tag name (default -% \texttt{list} rolemapped to \texttt{L}) and any tag attributes -% may have to be overwritten in the optional key/value argument. But we do have some hints to play with. +% \end{macro} +% +% +% +% \begin{macro}{\__kernel_displayblock_end:} +% The kernel hook for tagging at the end of the block. % \begin{macrocode} - \legacy_if:nTF { @nmbrlist } - { \tl_set:Nn \l__tag_L_attr_class_tl {enumerate} } % numbered list - { \tl_if_empty:NTF \@itemlabel - { \tl_set:Nn \l__tag_L_attr_class_tl {list} } % no label - { \tl_set:Nn \l__tag_L_attr_class_tl {itemize} } % unnumbered, unordered - } +\cs_new:Npn \__kernel_displayblock_end: { + \@@_debug_typeout:n{\detokenize{__kernel_displayblock_end:}} } % \end{macrocode} % \end{macro} % % % +% \begin{socketdecl}{tagsupport/block-endpe} +% This socket is responsible for the end environment \tn{par} +% handling. We define two plugs for it (\plug{on} and \plug{off}). +% \begin{macrocode} +\socket_new:nn {tagsupport/block-endpe}{0} +% \end{macrocode} +% \end{socketdecl} % -% \begin{environment}{trivlist} -% +% \begin{plugdecl}{on,off} +% The plugs set the legacy \texttt{@endpe} switch. This must always +% happen because block environments with different settings can be nested +% and should not inherit the setting from the outer environment. % \begin{macrocode} -\AddToHook{begindocument/before}{ - \RenewDocumentEnvironment{trivlist}{ !O{} } - { \list[#1]{} - { - \dim_zero:N \leftmargin - \dim_zero:N \labelwidth - \cs_set_eq:NN \makelabel \use:n - } - } - { \endblockenv } -} +\socket_new_plug:nnn{tagsupport/block-endpe}{on} +% \end{macrocode} +% We can't use \cs{legacy_if_gset_true:n} because this is now doing +% more than setting the legacy switch +% \begin{macrocode} + { \@endpetrue } +\socket_new_plug:nnn{tagsupport/block-endpe}{off} + { \@endpefalse } % \end{macrocode} -% \end{environment} % +% \begin{macrocode} +\socket_assign_plug:nn{tagsupport/block-endpe}{on} +% \end{macrocode} +% \end{plugdecl} % -% \subsubsection{Theorem-like environments} % -% Theorem-like environments are defined in \LaTeX{} with the help of -% \cs{newtheorem} declarations. Internally they used a list with a -% single item. Using lists was convenient back then, but in a tagged -% document you end up with a strange structure. We therefore alter the -% mechanism. % % -% \begin{macro}{\newtheorem} -% This is a slightly streamlined version of \cs{newtheorem}, but it -% still uses a lot of the 2e code for now. Eventually this will change. +% +% \subsubsection{Implementation of para templates \ldots} +% +% \begin{template}{para std} +% % \begin{macrocode} -\RenewDocumentCommand \newtheorem { m O{#1} m o } +\DeclareTemplateCode{para}{std}{1} { - \expandafter\@ifdefinable\csname #1\endcsname - { - \str_if_eq:nnTF{#1}{#2} - { - \@definecounter {#2} - \IfNoValueTF {#4} - { % @ynthm - \tl_gset:ce { the #2 } - { - \@thmcounter{#2} - } - } - { % @xnthm - \@newctr{#1}[#4] - \tl_gset:ce { the #2 } - { - \expandafter\noexpand\csname the#4\endcsname - \@thmcountersep - \@thmcounter{#2} - } - } - } - { % @othm - \@ifundefined{c@#2} - { \@nocounterr{#2} } - { - \tl_gset:cn { the #1 } - { \UseName { the #2 } } - } - } - \global\@namedef{#1} { \@thm{#2}{#3} } - \global\@namedef{end#1}{ \@endtheorem } - } -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@thm} -% \cs{@thm} executes \cs{refstepcounter} too early for hyperref -% and structure destinations: the generated target is outside the structure -% and can be separated from the theorem by a page break. We therefore move -% the anchor setting into \cs{@begintheorem}. \cs{@begintheorem} doesn't -% currently get the name of the counter as argument, so we store it in variable -% for now, to be able to pass it along. -% \begin{macrocode} -\tl_new:N \l_@@_thm_current_counter_tl -\def\@thm#1#2{% - \@kernel@refstepcounter{#1} - \tl_set:Nn \l_@@_thm_current_counter_tl{#1} - \@ifnextchar[{\@ythm{#1}{#2}}{\@xthm{#1}{#2}}} -% \end{macrocode} -% To avoid that hyperref overwrites the definition again we must its patch: -% \begin{macrocode} -\def\hyper@nopatch@thm{} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@begintheorem,\@opargbegintheorem} -% -% The \cs{@thm} command expands to either \cs{@beginthorem} or -% \cs{@opargbegintheorem}. For the moment we stick with this as it -% will help with the transition. But instead of using a -% \env{trivlist} we use a blockenv and some tagging for the title -% (as a Caption). -% We do not want potential tagging from \cs{textbf} here, -% so we use \cs{bfseries} to set the font. The commands set also the link targets -% which should be inside the main structure. -% \begin{macrocode} -\def\@begintheorem#1#2{ - \UseInstance{blockenv}{theorem}{} - \tagpdfparaOff - \mode_leave_vertical: - \MakeLinkTarget{\l_@@_thm_current_counter_tl} - \tag_struct_begin:n{tag=Caption} - \group_begin: - \bfseries - \tag_mc_begin:n {} - #1\ - \tag_mc_end: - \tag_struct_begin:n{tag=Lbl} - \tag_mc_begin:n {} - #2 - \tag_mc_end: - \tag_struct_end: - \group_end: - \tag_struct_end: - \tagpdfparaOn -% \end{macrocode} -% -% \begin{macrocode} - \@@_start_para_structure_unconditionally:n { \PARALABEL } -% \end{macrocode} -% -% \begin{macrocode} - \itshape - \hskip\labelsep - \ignorespaces + indent-width = \parindent , + start-skip = \l__par_start_skip , % name?? + left-skip = \leftskip , + right-skip = \rightskip , + end-skip = \parfillskip , + fixed-word-spaces = \l__par_fixed_word_spaces_bool , % name?? + final-hyphen-demerits = \finalhyphendemerits , + cr-cmd = \\ , + para-class = \l__tag_para_attr_class_tl , } -\def\@opargbegintheorem#1#2#3{ - \UseInstance{blockenv}{theorem}{} - \tagpdfparaOff - \mode_leave_vertical: - \MakeLinkTarget{\l_@@_thm_current_counter_tl} - \tag_struct_begin:n{tag=Caption} - \group_begin: - \bfseries - \tag_mc_begin:n {} - #1\ - \tag_mc_end: - \tag_struct_begin:n{tag=Lbl} - \tag_mc_begin:n {} - #2 - \tag_mc_end: - \tag_struct_end: - \tag_mc_begin:n {} - \ (#3) - \tag_mc_end: - \group_end: - \tag_struct_end: - \tagpdfparaOn -% \end{macrocode} -% -% \begin{macrocode} - \@@_start_para_structure_unconditionally:n { \PARALABEL } -% \end{macrocode} -% -% \begin{macrocode} - \itshape - \hskip\labelsep - \ignorespaces +{ + \tl_if_empty:nF {#1} { \SetTemplateKeys{para}{std}{#1} } + \skip_set:Nn \@rightskip \rightskip } % \end{macrocode} -% -% \begin{macrocode} -\def\@endtheorem{\endblockenv} -% \end{macrocode} -% \end{macro} -% -% -% +% \end{template} % % % -% \subsection{Implementation of templates} % % -% \subsubsection{Implementation of blockenv templates \ldots} +% \subsubsection{Implementation of block templates \ldots} % % % -% \begin{macro}{\g_block_nesting_depth_int} -% \LaTeXe{} already has a counter to record the nesting depth of -% blocks, but we want our own name because it isn't really tied to -% \enquote{lists} any more. However, \cs{@listdepth} is really part -% of the legacy interface (for example \env{minipage} alters it to -% point to a different counter) so that we are stuck with using at -% least indirectly for now and the following line makes this look -% like an L3 integer variable but internally expands to \cs{@listdepth}: -% \begin{macrocode} -\cs_new:Npn \g_block_nesting_depth_int { \@listdepth } % a fake int - % for now -% \end{macrocode} -% \end{macro} % % -% \begin{template}{blockenv display} +% \begin{template}{block display} % +% In contrast to the \LaTeXe{} implementation we do not directly +% use \tn{listparindent} here but a private register of the +% template. The reason is that block template instances are also +% used outside of lists. +% \changes{v0.8s}{2024/10/03}{Offer item-skip key also on block templates} +% \changes{v0.8w}{2024/11/23}{Use private storage bin for parindent +% and not \tn{listparindent} to decouple block and list templates (tagging/767)} % \begin{macrocode} -\DeclareTemplateCode{blockenv}{display}{1} +\DeclareTemplateCode{block}{display}{1} { - env-name = \l_@@_env_name_tl , - tag-name = \l_@@_tag_name_tl , - tag-class = \l_@@_tag_class_tl , - tagging-recipe = \l_@@_tagging_recipe_tl , - level-increase = \l_@@_level_incr_bool , - setup-code = \l_@@_setup_code_tl , - block-instance = \l_@@_block_instance_tl , - para-instance = \l_@@_para_instance_tl , - inner-level-counter = \l_@@_inner_level_counter_tl , - max-inner-levels = \l_@@_max_inner_levels_tl , - inner-instance-type = \l_@@_inner_instance_type_tl , - inner-instance = \l_@@_inner_instance_tl , - para-flattened = \l__tag_para_flattened_bool , - final-code = \l_@@_final_code_tl , + heading = \l_@@_heading_tl , + beginsep = \topsep , + begin-par-skip = \partopsep , + par-skip = \parsep , + end-skip = \l_@@_botsep_skip , + end-par-skip = \l_@@_parbotsep_skip , + item-skip = \itemsep , + beginpenalty = \@beginparpenalty , + endpenalty = \@endparpenalty , + rightmargin = \rightmargin , + leftmargin = \leftmargin , + parindent = \l_@@_parindent_dim , } { - \@@_debug_typeout:n{\l_@@_env_name_tl -env-start} -% - \tl_if_empty:nF {#1} { \SetTemplateKeys{blockenv}{display}{#1} } -% + \tl_if_empty:nF {#1} { \SetTemplateKeys{block}{display}{#1} } % \end{macrocode} -% We need to know later if we have nested blockenvs inside -% a flattened environment. Whenever we start a new blockenv we -% increment \cs{l__tag_block_flattened_level_int} if it is already -% different from zero. If it is zero we increment it if flattening -% is requested. -% Thus a value of \texttt{0} means no flattening requested so far -% and \texttt{1} means this is the first blockenv requesting -% flattening. In either case we have to make sure that the blockenv -% is surrounded by a \texttt{text-unit} tag, while for any value above -% \texttt{1} we have to omit the \texttt{text-unit}. - % \begin{macrocode} - \int_compare:nNnTF \l__tag_block_flattened_level_int > 0 +% \fmi{generalize heading usage (or drop?)} +% \begin{macrocode} + \tl_if_blank:oF \l_@@_heading_tl + { \mode_leave_vertical: + \textbf{\l_@@_heading_tl} } % TODO customize +% \end{macrocode} +% The code largely follows the logic of \LaTeXe{}'s \env{trivlist} +% implementation as far as it applicable for the \enquote{display +% block} but coded using the L3 programming layer. However, we keep +% all the legacy variables (e.g., \texttt{@noskipsec}) if there is +% some chance that they are set in classes or packages. +% \begin{macrocode} + \legacy_if:nT { @noskipsec } { \mode_leave_vertical: } + \skip_set:Nn \l_@@_topsepadd_skip { \topsep } + \mode_if_vertical:TF { - \int_incr:N \l__tag_block_flattened_level_int + \skip_add:Nn \l_@@_topsepadd_skip { \partopsep } +% \end{macrocode} +% At this point it is safe to add tagging structure(s) so we have +% a kernel-owned hook here for tagging. This is used to possibly +% start a paragraph structure (to surround the block, for example, +% in case of lists) and possibly do some other preparation for +% tagging the block. +% \begin{macrocode} + \__kernel_displayblock_beginpar_vmode: } { - \bool_if:NT \l__tag_para_flattened_bool - { - \int_incr:N \l__tag_block_flattened_level_int - } - } -% - \tl_if_empty:NF \l_@@_inner_level_counter_tl - { - \int_compare:nNnTF \l_@@_inner_level_counter_tl > - { \l_@@_max_inner_levels_tl - 1 } - { \@toodeep } - { \int_incr:N \l_@@_inner_level_counter_tl } % not clean "o"? - } % \end{macrocode} -% Legacy defaults are only roped in if the list level changes. For -% display blocks that remain on the same level the current values -% are kept. +% If we are in horizontal mode then the displayblock has to return +% to vertical mode now (after removing any immediately preceding +% skip or kern. But before we actually issue the\tn{par} we execute +% a kernel hook in which we can add tagging code. This hook is +% \enquote{weird} because by default it does nothing, but if +% tagging is wanted it takes an argument and grabs the following +% \tn{par} in order to put tagging code before and after the \tn{par}. % \begin{macrocode} - \bool_if:NT \l_@@_level_incr_bool - { - \int_compare:nNnTF \g_block_nesting_depth_int > - { \c@maxblocklevels - 1 } - { \@toodeep } - { - \int_gincr:N \g_block_nesting_depth_int + \@@_skip_remove_last: \@@_skip_remove_last: + \__kernel_displayblock_beginpar_hmode:w \par + } % \end{macrocode} -% If there are no legacy defaults for that level then the next line -% does nothing, i.e., the current values (from the last level -% become the defaults for the next. +% Now we are back to legacy list implementation \ldots % \begin{macrocode} - \use:c { @list \int_to_roman:n { \g_block_nesting_depth_int } } - } - } + \legacy_if:nTF { @inlabel } + { + \legacy_if_set_true:n { @noparitem } + \legacy_if_set_true:n { @noparlist } + } + { + \legacy_if:nT { @newlist } { \@noitemerr } + \legacy_if_set_false:n { @noparlist } + \skip_set_eq:NN \l_@@_effective_top_skip \l_@@_topsepadd_skip + } + \skip_add:Nn \l_@@_effective_top_skip { \parskip } % \end{macrocode} -% If we are doing tagging we load one of the available recipes for -% tagging, which alters various kernel hooks to add appropriate -% tagging structures. +% Next lines set some paragraph defaults, any of them may get overwritten +% if there is a \key{para-instance} specified on the \xt{blockenv} +% instance. % \begin{macrocode} - \tag_if_active:T { \use:c { @@_recipe_ \l_@@_tagging_recipe_tl : } } + \skip_zero:N \leftskip + \skip_set_eq:NN \rightskip \@rightskip + \skip_set_eq:NN \parfillskip \@flushglue % \end{macrocode} -% The default for \env{list} environments is that they have an -% empty label and are not numbered (something that is then -% overwritting by the setup of a specific list). We ensure -% this here even for non-lists, because we need a defined state -% that then can be overwritting by the legacy setup code for -% the \env{list} environment in \cs{l_@@_setup_code_tl}. -% This is needed in case lists are nested as they otherwise would -% inherit outer values (and suddenly an \env{itemize} would start -% incrementing an outer \env{enumerate} counter, etc. -% \changes{v0.8v}{2024/10/11}{Set the defaults for \cs{@itemlabel}, -% \cs{@listctr} and \texttt{@nmbrlist} early in the block code -% before the setup code gets executed (tagging/730)} +% The next lines establish a parshape which is retained across +% paragraphs be executing \cs{para_end:} within a group and thus +% reestablishing the parshape for the next paragraph again. In case +% a list got started \tn{par} is ignored until we have seen an +% \tn{item} (or we have executed \tn{par} one thousand times. % \begin{macrocode} - \tl_clear:N \@itemlabel - \tl_clear:N \@listctr - \legacy_if_set_false:n { @nmbrlist } + \int_zero:N \par@deathcycles + \@setpar + { + \legacy_if:nTF { @newlist } + { + \int_incr:N \par@deathcycles + \int_compare:nNnTF \par@deathcycles > { 1000 } + { \@noitemerr + { \para_end: } + } + } + { + { \para_end: } + } + } + \skip_set_eq:NN \@outerparskip \parskip + \skip_set_eq:NN \parskip \parsep % \end{macrocode} -% Then run the setup code if any is given in the instance. +% \changes{v0.8w}{2024/11/23}{Use private storage bin for parindent +% and not \tn{listparindent} to decouple block and list templates (tagging/767)} % \begin{macrocode} - \l_@@_setup_code_tl + \dim_set_eq:NN \parindent \l_@@_parindent_dim + \dim_add:Nn \linewidth { - \rightmargin - \leftmargin } + \dim_add:Nn \@totalleftmargin { \leftmargin } + \tex_parshape:D 1 ~ \@totalleftmargin \linewidth % \end{macrocode} -% Next call a block instance at the appropriate level passing it -% any key/value list provided in the optional argument (keys that -% are not recognized are ignored---currently with an -% error). +% This is the point where we are ready to add the tagging structure +% for the block, e.g., an \verb==, a \verb=
= or some +% other structure. % \begin{macrocode} - \@@_debug_typeout:n{use~ instance:~ - \l_@@_block_instance_tl - \int_use:N \g_block_nesting_depth_int } - \UseInstance{block} - { \l_@@_block_instance_tl - \int_use:N - \g_block_nesting_depth_int } - {#1} + \__kernel_displayblock_begin: % \end{macrocode} -% After the block instance call the para and then inner (list) -% instance if either or both are -% specified (which may not be the case). +% Finally, we have to output the vertical separation and penalty at +% the start of the block and make corrections for a change in +% \tn{parskip} and some other housekeeping, unless this block is inside a list and the list +% \tn{item} has not yet placed. In that case the vertical +% space and penalty us suppressed. This +% is controlled through the legacy switches \texttt{@noparitem}, +% \texttt{minipage}, and \texttt{@nobreak}. % \begin{macrocode} - \tl_if_empty:NF \l_@@_para_instance_tl - { - \@@_debug_typeout:n{use~ para~ instance:~ \l_@@_para_instance_tl } + \legacy_if:nTF { @noparitem } + { + \legacy_if_set_false:n { @noparitem } + \hbox_gset:Nn \g_@@_labels_box + { + \skip_horizontal:n { - \leftmargin } + \hbox_unpack_drop:N \g_@@_labels_box + \skip_horizontal:n { \leftmargin } + } % \end{macrocode} -% For now we don't offer to alter instance parameters here so we -% pass an empty argument. +% \fmi{document 2e logic used here} % \begin{macrocode} - \UseInstance{para}{ \l_@@_para_instance_tl } {} - } + \legacy_if:nF { @minipage } % Why this chunk of code? + { + \@@_skip_set_to_last:N \l_@@_tmpa_skip + \skip_vertical:n { - \l_@@_tmpa_skip } + \skip_vertical:n { \l_@@_tmpa_skip + + \@outerparskip - \parskip } + } + } + { + \legacy_if:nTF { @nobreak } + { \addvspace{\skip_eval:n{\@outerparskip-\parskip}} } + { + \addpenalty \@beginparpenalty + \addvspace \l_@@_effective_top_skip + \addvspace{-\parskip} + } + } +} % \end{macrocode} -% The inner instance may have its own levels or none depending -% on which the instance name differs. Again we pass it the optional -% key/value list. +% +% +% Extra keys to support enumitem conventions: % \begin{macrocode} - \tl_if_empty:NF \l_@@_inner_instance_tl - { - \@@_debug_typeout:n{use~ instance:~ \l_@@_inner_instance_tl - \tl_if_empty:NF \l_@@_inner_level_counter_tl - { - \int_use:N \l_@@_inner_level_counter_tl }} - \UseInstance{ \l_@@_inner_instance_type_tl } - { \l_@@_inner_instance_tl - \tl_if_empty:NF \l_@@_inner_level_counter_tl - { - \int_use:N \l_@@_inner_level_counter_tl } % not clean - % use "o"? - } - {#1} - } +\keys_define:nn { template/block/display } +{ + ,topsep .skip_set:N = \topsep + ,partopsep .skip_set:N = \partopsep + ,listparindent .skip_set:N = \listparindent +} % \end{macrocode} -% We finish off with \cs{l_@@_final_code_tl} which defaults to -% \cs{ignorespaces} so that spaces between \verb=\begin{...}= and -% the start of the text are ignored. +% \end{template} +% +% +% \begin{macro}{\__kernel_displayblock_begin:, +% \__kernel_displayblock_beginpar_hmode:w, +% \__kernel_displayblock_beginpar_vmode:} +% The internal kernel hooks for tagging. % \begin{macrocode} - \l_@@_final_code_tl +\cs_new:Npn \__kernel_displayblock_begin: { + \@@_debug_typeout:n + {\detokenize{__kernel_displayblock_begin:}} } % \end{macrocode} -% \end{template} % +% \begin{macrocode} +\cs_new:Npn \__kernel_displayblock_beginpar_hmode:w { + \@@_debug_typeout:n + {\detokenize{__kernel_displayblock_beginpar_hmode:w}} +} +% \end{macrocode} % -% \begin{macro}{\l__tag_block_flattened_level_int} -% Count the levels of nested blockenvs starting with the first that -% is \enquote{flattened}. The counter is defined in lttagging.dtx, -% but until the next release 11/24 we set it up here too % \begin{macrocode} -\int_if_exist:NF \l__tag_block_flattened_level_int - { - \int_new:N \l__tag_block_flattened_level_int - } +\cs_new:Npn \__kernel_displayblock_beginpar_vmode: { + \@@_debug_typeout:n + {\detokenize{__kernel_displayblock_beginpar_vmode:}} +} % \end{macrocode} % \end{macro} % -% \begin{macro}{\c@maxblocklevels} -% A counter to increase or decrease the number of supported -% level. If increased, one needs to supply additional level instances. +% +% +% +% \subsubsection{Implementation of list templates \ldots} +% +% +% +% \begin{macro}{\@itemlabel,\@listctr} +% Both \tn{@itemlabel} and \tn{@listctr} from the \LaTeXe{} list +% implementation are used (or set) by various packages. We +% therefore use them too, so that these packages have a fighting +% chance to work with the new tagging-aware implementation for +% \env{list}. % \begin{macrocode} -\newcounter{maxblocklevels} -\setcounter{maxblocklevels}{6} +\tl_new:N \@itemlabel % should have a top-level definition +\tl_new:N \@listctr % should have a top-level definition % \end{macrocode} % \end{macro} % -% \begin{macro}{\endblockenv} -% The code executed when a blockenv ends is 99\% the same for all -% blockenvs (at least up to now). Small differences exist, though. They -% are accounted for first in the conditionals. % -% We make this a public command so that new block environments can -% be set up without the need to resort to L3 layer -% programming.\fmi{name is bad} +% +% \begin{macro}{\@@_evaluate_saved_user_keys:nn} +% Keys set on individual list environments may be intended to alter +% the behavior of the template instance that defines the \tn{item} +% command. If meant to alter only a single \tn{item} command one +% would specify them in the optional argument of the \tn{item}, but +% if they should alter all items the right place would be the list +% environment. For this reason we need to store the values and then +% set them inside the \tn{item} template code using +% \tn{SetTemplateKeys} in the appropriate context (template type +% and template name). This is done in +% \cs{@@_evaluate_saved_user_keys:nn}. The context is provided in +% the two arguments (because different list environments may use +% different \tn{item} instances based on different templates. By +% default the command does +% nothing because most environments do not have user key settings. +% \changes{v0.8s}{2024/10/03}{Pass user keys on list to \tn{item} for +% evaluation} % \begin{macrocode} -\cs_new:Npn \endblockenv { - \@@_debug_typeout:n{blockenv~ common~ ending \on@line} +\cs_new_eq:NN \@@_evaluate_saved_user_keys:nn \use_none:nn % \end{macrocode} -% If this block was incrementing the level we have to decrement it -% now again: +% Maybe something like this should become a public function, but +% for now this is a one-off for the \tn{item} command and therefore +% coded inline and internal to the block code. % \begin{macrocode} - \bool_if:NT \l_@@_level_incr_bool - { \int_gdecr:N \g_block_nesting_depth_int } +%\cs_new:Npn \@@_save_user_keys:n #1 { +% \tl_if_empty:nTF {#1} +% { \cs_set_eq:NN \@@_evaluate_saved_user_keys:nn \use_none:nn } +% { +% \cs_set:Npe \@@_evaluate_saved_user_keys:nn ##1##2 +% { \SetTemplateKeys{##1}{##2}{ \exp_not:n{#1} } } +% } +%} % \end{macrocode} -% If this block was a list and there are still \cs{item} labels to -% be placed we move to horizontal mode to get them typeset. +% \end{macro} +% +% +% \begin{template}{list std} +% +% This template implements numbered and unnumbered lists and can +% be combined with display blocks or with inline blocks. % \begin{macrocode} - \legacy_if:nT { @inlabel } - { - \mode_leave_vertical: - \legacy_if_gset_false:n { @inlabel } - } +\DeclareTemplateCode{list}{std}{1} +{ + counter = \l_@@_counter_tl, + item-label = \l_@@_item_label_tl, + start = \l_@@_counter_start_int , + resume = \l_@@_resume_bool , + item-instance = \@@_item_instance:n , + item-skip = \itemsep , +% item-par-skip = \parsep , + item-penalty = \@itempenalty , + item-indent = \itemindent , + label-width = \labelwidth , + label-sep = \labelsep , + legacy-support = \l_@@_legacy_support_bool , % FMi questionable +} +{ + \@@_debug_typeout:n{template:list:std} +% % \end{macrocode} -% If we are ending a list environment and we have not seen any -% \cs{item}, i.e., \texttt{@newlist} is still true, we raise an -% error. In basic a ``displayblock'' scenario \texttt{@newlist} will -% always be false, but if such an environment appears inside an outer -% list then \cs{noitemerr} could still be triggered and that is undesirable -% (as the missing item will be detected at the wrong point and again later, -% during the outer list processing). We -% therefore run it only if the current environment is a list. -% \changes{v0.8q}{2024/09/03}{Raise a \cs{@noitemerr} if appropriate} -% \begin{macrocode} - \@@_if_list:T { \legacy_if:nT { @newlist } { \@noitemerr } } +% We start by looking at the user supplied keys in \texttt{\#1}. If +% there aren't any we reset \cs{@@_evaluate_saved_user_keys:nn} to +% do nothing. Otherwise we evaluate and set the keys in the contect +% of the current list template. In addition we prepare +% \cs{@@_evaluate_saved_user_keys:nn} for execution in the +% template for \tn{item}. +% \changes{v0.8s}{2024/10/03}{Prepare \cs{@@_evaluate_saved_user_keys:nn} +% for use in \tn{item}} +% \begin{macrocode} + \tl_if_empty:nTF {#1} + { \cs_set_eq:NN \@@_evaluate_saved_user_keys:nn \use_none:nn } + { + \SetTemplateKeys{list}{std}{#1} + \cs_set:Npe \@@_evaluate_saved_user_keys:nn ##1##2 + { \SetTemplateKeys{##1}{##2}{ \exp_not:n{#1} } } + } % \end{macrocode} +% Has this list a counter name defined in the instance? % \begin{macrocode} - \mode_if_horizontal:TF - { \@@_skip_remove_last: \@@_skip_remove_last: \par } - { \@inmatherr{\end{\@currenvir}} } + \tl_if_empty:NTF \l_@@_counter_tl + { % \end{macrocode} -% Once we are back in vertical mode we can add the appropriate -% closing tagging structure(s), if we are doing tagging. +% If not we check if \tn{@nmbrlist} is true which may be the case +% in legacy environments that used \tn{usecounter} in the argument +% to the \env{list} environment. +% \changes{v0.8v}{2024/10/11}{Correct logic for setting up the list +% counter (tagging/730)} % \begin{macrocode} - \__kernel_displayblock_end: + \legacy_if:nT { @nmbrlist } + { % \end{macrocode} -% Resetting the \texttt{@newlist} switch is also only done if the -% current enviornment is a list and not unconditionally. -% \changes{v0.8q}{2024/09/03}{Setting \texttt{@newlist} to false -% moved after tagging code if in a list} +% In that case we only check if we should resume a previous list +% (\tn{@listctr} should be set in that case through the legacy +% method as well so we should be able to use it). % \begin{macrocode} - \@@_if_list:T { \legacy_if_gset_false:n { @newlist } } + \bool_if:NF \l_@@_resume_bool + { + \int_gset:cn{ c@ \@listctr } + { \l_@@_counter_start_int - 1 } + } + } + } % \end{macrocode} -% What to do in terms of vertical spacing in different situations -% is still somewhat open to debate, right now this is more or less -% implementing what \LaTeXe{} list environment have been -% doing.\fmi{some redesign/extensions here?} +% If a counter is set in the list instance we use that +% one. This should be the name of a \LaTeX{} counter that is +% already allocated externally---no runtime check is made for this: +% if it is not declared one will get \enquote{no such counter} +% error when the list is used. % \begin{macrocode} -% \@@_debug_typeout:n{@noparlist = -% \legacy_if:nTF { @noparlist }{true}{false}} - \legacy_if:nF { @noparlist } { - \@@_skip_set_to_last:N \l_tmpa_skip - \dim_compare:nNnT \l_tmpa_skip > \c_zero_dim - { - \skip_vertical:n { - \l_tmpa_skip } - \skip_vertical:n { \l_tmpa_skip + \parskip - \@outerparskip } - } - \addpenalty \@endparpenalty - \addvspace \l_@@_topsepadd_skip + \@nmbrlisttrue + \tl_set_eq:NN \@listctr \l_@@_counter_tl + \bool_if:NF \l_@@_resume_bool + { + \int_gset:cn{ c@ \@listctr } + { \l_@@_counter_start_int - 1 } + } + } % \end{macrocode} -% \LaTeXe{} triggered the paragraph handling after a list at this -% point here, i.e., only if the list didn't start a paragraph. One -% can make a case for that, but it can be somewhat surprising to -% the user and there is a good argument that even such a list could -% be followed explanatory text that is part of the same paragraph -% and doesn't start a new one.\fmi{decide which logic we want to -% use! If the old logic is used we need to close the text-unit -% ourselves in the true branch} +% Does the current instance has an item label representation? This +% would be possible whether or not we have a numbered list. If yes, +% then we use this for \tn{@itemlabel}, otherwise we expect that +% \tn{@itemlabel} is provided from the outside, e.g., as part of +% the \env{list} environment argument. % \begin{macrocode} -% \legacy_if_gset_true:n { @endpe } + \tl_if_empty:NF \l_@@_item_label_tl + { + \tl_set_eq:NN \@itemlabel \l_@@_item_label_tl } % \end{macrocode} -% So this is for now always done. Probably \cs{l_@@_topsepadd_skip} above -% should be added only if the paragraph ends here and not if it -% continues, so this need some further cleanup.\fmi{decide} +% Finally, we signal that we are at the start of a new list (which +% affects how the first \tn{item} is handled and how \tn{par} +% commands are interpreted. +% \begin{macrocode} + \legacy_if_gset_true:n { @newlist } +% \end{macrocode} +% If we encounter horizontal material before the first \tn{item} we +% do want a \tn{@noitemerr} straight away, because afterwards we +% end up with tagging structure faults whose cause is the +% missing \tn{item}. So we setup up \cs{@@_item_everypar:} to test +% for this; when the first \tn{item} is encountered this will get +% reset. This is only relevant for vertical lists, when dealing with +% inline lists one would need to test for something else to +% identify that there is horizontal material between the start of the list and +% the first \tn{item} (maybe some \tn{spacefactor} trick could be +% used then, or the material is boxed first and the width is +% inspected as suggested by Joseph).\fmi{Think about a better +% implementation at some point.} +% \changes{v0.8q}{2024/09/02}{} +% \begin{macrocode} + \cs_set_eq:NN \@@_item_everypar: \@@_item_everypar_first: +% \end{macrocode} % -% Finally, we have a socket that handles the \cs{par} handling -% after the block. Normally, we use it with the \plug{on} plug (check for a -% following \cs{par}) but in the case of standalone environments we -% assign it the \plug{off} plug. % \begin{macrocode} - \socket_use:n {tagsupport/block-endpe} + \@@_debug_typeout:n{template:list:std~end} } % \end{macrocode} +% % -% \end{macro} -% -% -% \begin{macro}{\@@_if_list:T} -% The following code may need some redesigning, as there is no good test for \enquote{is -% this environment a \enquote{list} that has \cs{item}s}. For now -% this here does the trick well enough.\fmi{revisit} -% \changes{v0.8q}{2024/09/03}{Provide a test for: Am I in a list?} +% Extra keys to support enumitem conventions: % \begin{macrocode} -\cs_new:Npn \@@_if_list:T - { \tl_if_eq:NnT \l_@@_block_instance_tl {list} } +\keys_define:nn { template/list/std } +{ + ,nosep .code:n = + \dim_zero:N \itemsep + \dim_zero:N \parsep + \dim_zero:N \topsep + \dim_zero:N \l_@@_botsep_skip + \dim_zero:N \l_@@_parbotsep_skip + ,midsep .skip_set:N = \topsep +} % \end{macrocode} -% \end{macro} % +% \end{template} % -% -% \begin{macro}{\__kernel_displayblock_end:} -% The kernel hook for tagging at the end of the block. -% \begin{macrocode} -\cs_new:Npn \__kernel_displayblock_end: { - \@@_debug_typeout:n{\detokenize{__kernel_displayblock_end:}} -} -% \end{macrocode} -% \end{macro} % +% \subsubsection{Implementation of \tn{item} template(s)} % % -% \begin{socketdecl}{tagsupport/block-endpe} -% This socket is responsible for the end environment \cs{par} -% handling. We define two plugs for it (\plug{on} and \plug{off}). +% +% \begin{template}{item std} +% The item template has one hidden key \key{label} which is not available on the +% template for setting because it is only used to receive any +% optional data passed to the \tn{item} command. We therefore +% declare it with \cs{keys_define:nn} and ensure that the optional +% argument data to \tn{item} (if it is not a key/value list +% already) is passed to this \key{label} key. % \begin{macrocode} -\socket_new:nn {tagsupport/block-endpe}{0} +\keys_define:nn { template/item/std } + { label .tl_set:N = \l_@@_label_given_tl } % \end{macrocode} -% \end{socketdecl} % -% \begin{plugdecl}{on,off} -% The plugs set the legacy \texttt{@endpe} switch. This must always -% happen because block environments with different settings can be nested -% and should not inherit the setting from the outer environment. +% \fmi{alignment is mostly wrong (test short medium and multiline +% labels)} % \begin{macrocode} -\socket_new_plug:nnn{tagsupport/block-endpe}{on} +\DeclareTemplateCode{item}{std}{1} + { + counter-label = \@@_counter_label:n , + counter-ref = \@@_counter_ref:n , % \end{macrocode} -% We can't use \cs{legacy_if_gset_true:n} because this is now doing -% more than setting the legacy switch +% \fmi{next set of key not yet used} % \begin{macrocode} - { \@endpetrue } -\socket_new_plug:nnn{tagsupport/block-endpe}{off} - { \@endpefalse } + label-ref = \@@_label_ref:n , + label-autoref = \@@_label_autoref:n , + label-format = \@@_label_format:n , + label-strut = \l_@@_label_strut_bool , + label-boxed = \l_@@_label_boxed_bool , + next-line = \l_@@_next_line_bool , + text-font = \l_@@_text_font_tl , + compatibility = \l_@@_item_compatibility_bool , % \end{macrocode} -% +% This probably needs a different implementation (and needs completing)\fmi{complete} % \begin{macrocode} -\socket_assign_plug:nn{tagsupport/block-endpe}{on} + label-align = { + left = \tl_set:Nn \l_@@_item_align_tl { \relax \hss } , + center = \tl_set:Nn \l_@@_item_align_tl { \hss \hss } , + right = \tl_set:Nn \l_@@_item_align_tl { \hss \relax } , + parleft = \NOT_IMPLEMENTED , + } , + } % \end{macrocode} -% \end{plugdecl} -% -% -% -% -% -% \subsubsection{Implementation of para templates \ldots} -% -% \begin{template}{para std} -% +% Then typeset the label at its natural width by applying +% \cs{@@_make_label_box:n} to the label given or to a label constructed +% from the counter. If it is boxed and reasonably short, add padding to +% make it at least of size \tn{labelwidth}, then add another layer of +% box. This way, when we unpack it in \cs{g_@@_labels_box} it correctly +% remains boxed in those cases. Afterwards, in the \keyvalue{nextline} +% case add \tn{newline} if the label did not fit in the allotted space. % \begin{macrocode} -\DeclareTemplateCode{para}{std}{1} -{ - indent-width = \parindent , - start-skip = \l__par_start_skip , % name?? - left-skip = \leftskip , - right-skip = \rightskip , - end-skip = \parfillskip , - fixed-word-spaces = \l__par_fixed_word_spaces_bool , % name?? - final-hyphen-demerits = \finalhyphendemerits , - cr-cmd = \\ , - para-class = \l__tag_para_attr_class_tl , -} -{ - \tl_if_empty:nF {#1} { \SetTemplateKeys{para}{std}{#1} } - \skip_set:Nn \@rightskip \rightskip -} + { + \@@_debug_typeout:n{template:item:std} % \end{macrocode} -% \end{template} -% -% -% -% -% -% \subsubsection{Implementation of block templates \ldots} -% -% -% -% -% -% \begin{template}{block display} % -% \changes{v0.8s}{2024/10/03}{Offer item-skip key also on block templates} +% First deal with the key--value input, which in particular may +% provide a value for the label (the usual optional argument of +% \tn{item}). For this we set \cs{l_@@_label_given_tl} to +% \cs{c_novalue_tl} so that we can identify if an optional argument +% was given. % \begin{macrocode} -\DeclareTemplateCode{block}{display}{1} -{ - heading = \l_@@_heading_tl , - beginsep = \topsep , - begin-par-skip = \partopsep , - par-skip = \parsep , - end-skip = \l_@@_botsep_skip , - end-par-skip = \l_@@_parbotsep_skip , - item-skip = \itemsep , - beginpenalty = \@beginparpenalty , - endpenalty = \@endparpenalty , - rightmargin = \rightmargin , - leftmargin = \leftmargin , - parindent = \listparindent , -} -{ - \tl_if_empty:nF {#1} { \SetTemplateKeys{block}{display}{#1} } + \tl_set_eq:NN \l_@@_label_given_tl \c_novalue_tl % \end{macrocode} -% \fmi{generalize heading usage (or drop?)} +% First we evaluate and set any keys specified on the list +% environment by calling +% \cs{@@_evaluate_saved_user_keys:nn}. Then we do the same +% with all keys specified on this \tn{item} command (which may +% overwrite one or the other setting just made). +% \changes{v0.8s}{2024/10/03}{Use \cs{@@_evaluate_saved_user_keys:nn} +% to make use of user keys on the list level} % \begin{macrocode} - \tl_if_blank:oF \l_@@_heading_tl - { \mode_leave_vertical: \textbf{\l_@@_heading_tl} } % TODO customize + \@@_evaluate_saved_user_keys:nn {item}{std} + \tl_if_empty:nF{#1}{ \SetTemplateKeys{item}{std}{#1} } % \end{macrocode} -% The code largely follows the logic of \LaTeXe{}'s \env{trivlist} -% implementation as far as it applicable for the \enquote{display -% block} but coded using the L3 programming layer. However, we keep -% all the legacy variables (e.g., \texttt{@noskipsec}) if there is -% some chance that they are set in classes or packages. +% +% If no optional argument was given then \cs{l_@@_label_given_tl} +% is still equal to \cs{c_novalue_tl} and so we can distinuish +% that from \verb=\item[]=. +% % \begin{macrocode} - \legacy_if:nT { @noskipsec } { \mode_leave_vertical: } - \skip_set:Nn \l_@@_topsepadd_skip { \topsep } - \mode_if_vertical:TF + \tl_if_novalue:oTF \l_@@_label_given_tl { - \skip_add:Nn \l_@@_topsepadd_skip { \partopsep } % \end{macrocode} -% At this point it is safe to add tagging structure(s) so we have -% a kernel-owned hook here for tagging. This is used to possibly -% start a paragraph structure (to surround the block, for example, -% in case of lists) and possibly do some other preparation for -% tagging the block. +% The rest of the code for this template needs work and is both +% incomplete and partly wrong.\fmi{fix} % \begin{macrocode} - \__kernel_displayblock_beginpar_vmode: + \tl_if_blank:oF \@listctr { \@kernel@refstepcounter \@listctr } + \bool_if:NTF \l_@@_item_compatibility_bool % not sure that + % conditional + % makes sense + { \@@_make_label_box:n { \MakeLinkTarget[\@listctr]{}% + \@itemlabel } } % TODO ? + { \@@_make_label_box:n { \MakeLinkTarget[\@listctr]{}% + \@@_counter_label:n { \@listctr } } } + } + { + \@@_debug_typeout:n{item~ with~ optional} + \@@_make_label_box:n { \l_@@_label_given_tl } } + \bool_if:nT + { + \l_@@_label_boxed_bool +% TODO: is \linewidth correct? + && \dim_compare_p:n + { \box_wd:N \l_@@_one_label_box <= \linewidth } } { + \dim_compare:nNnT + { \box_wd:N \l_@@_one_label_box } < \labelwidth + { + \hbox_set_to_wd:Nnn \l_@@_one_label_box { \labelwidth } + { + \exp_after:wN \use_i:nn \l_@@_item_align_tl % \end{macrocode} -% If we are in horizontal mode then the displayblock has to return -% to vertical mode now (after removing any immediately preceding -% skip or kern. But before we actually issue the\cs{par} we execute -% a kernel hook in which we can add tagging code. This hook is -% \enquote{weird} because by default it does nothing, but if -% tagging is wanted it takes an argument and grabs the following -% \cs{par} in order to put tagging code before and after the \cs{par}. +% FMi: \LaTeXe{} keeps the label boxed inside (not unboxed). This +% means that the content stays rigid and does not vary based on +% glue setting in the line with the label. +% There are cases where we do want the unboxed version (I think +% enumitem offers that in some cases too) but it should probably +% not the default. % \begin{macrocode} - \@@_skip_remove_last: \@@_skip_remove_last: - \__kernel_displayblock_beginpar_hmode:w \par - } +% TODO: customize? +% \hbox_unpack_drop:N \l_@@_one_label_box + \box_use_drop:N \l_@@_one_label_box % \end{macrocode} -% Now we are back to legacy list implementation \ldots +% % \begin{macrocode} - \legacy_if:nTF { @inlabel } - { - \legacy_if_set_true:n { @noparitem } - \legacy_if_set_true:n { @noparlist } + \exp_after:wN \use_ii:nn \l_@@_item_align_tl + } + } +% \end{macrocode} +% Add another box level to the label box: +% \begin{macrocode} + \hbox_set:Nn \l_@@_one_label_box + { \box_use_drop:N \l_@@_one_label_box } } + \dim_compare:nNnTF { \box_wd:N \l_@@_one_label_box } > \labelwidth + { \bool_set_true:N \l_@@_long_label_bool } + { \bool_set_false:N \l_@@_long_label_bool } + \hbox_gset:Nn \g_@@_labels_box { - \legacy_if:nT { @newlist } { \@noitemerr } - \legacy_if_set_false:n { @noparlist } - \skip_set_eq:NN \l_@@_effective_top_skip \l_@@_topsepadd_skip + \hbox_unpack_drop:N \g_@@_labels_box + \skip_horizontal:n { \itemindent - \labelsep - \labelwidth } + \hbox_unpack_drop:N \l_@@_one_label_box + \skip_horizontal:n { \labelsep } + \bool_if:NT \l_@@_next_line_bool + { \bool_if:NT \l_@@_long_label_bool { \nobreak \hfil \break } } + % version of \newline inside an hbox that will be unpacked } - \skip_add:Nn \l_@@_effective_top_skip { \parskip } + % TODO??? FMi what's that? + % \skip_set_eq:NN \parsep \l_@@_item_parsep_skip +% \end{macrocode} +% The next setting is for compatibility: The list template sets +% \tn{listparindent} to zero and otherwise doesn't use it any +% more. However, in the second argument of a legacy \env{list} +% envrironment the user may have set it explicitly to some other +% value and whatever value it had was then used for \tn{parindent} +% within the list. Now we use its value only if it differs from +% zero but otherwise use whatever the template instances +% specify. This gives 99.9\% compatibility for legacy +% documents. 100\% for definitions using the \env{list} environment +% and a setting inside, but if the user used \tn{listparindent} +% within the document, e.g., inside a \env{verse} environment there +% there is one case in which the setting is ignored, i.e., when it +% was set back to zero. That's a rather unlikely scenario, but it +% is not impossible. However, I couldn't think of an approach that +% circumvents such boundary cases. +% +% \changes{v0.8w}{2024/11/24}{Only use \tn{listparindent} if it was changed +% from its default (tagging/767)} +% \begin{macrocode} + \dim_compare:nNnF \listparindent = {0pt} + { \dim_set_eq:NN \parindent \listparindent } % \end{macrocode} -% Next lines set some paragraph defaults, this may get overwritten -% if there is a \key{para-instance} specified on the \xt{blockenv}. +% Placing the list label(s) is done when the paragraph for the +% \tn{item} is started, which executes \cs{@@_item_everypar:} +% inside \hook{para/begin}. By default this command does nothing, now we +% change it to attach the pending label or labels. % \begin{macrocode} - \skip_zero:N \leftskip - \skip_set_eq:NN \rightskip \@rightskip - \skip_set_eq:NN \parfillskip \@flushglue + \cs_set_eq:NN \@@_item_everypar: \@@_item_everypar_std: + } % \end{macrocode} -% The next lines establish a parshape which is retained across -% paragraphs be executing \cs{para_end:} within a group and thus -% reestablishing the parshape for the next paragraph again. In case -% a list got started \cs{par} is ignored until we have seen an -% \cs{item} (or we have executed \cs{par} one thousand times. +% \end{template} +% +% +% +% \begin{macro}{\l_@@_item_align_tl} +% % \begin{macrocode} - \int_zero:N \par@deathcycles - \@setpar +\tl_new:N \l_@@_item_align_tl +% \end{macrocode} +% \end{macro} +% +% \begin{variable}{\l_@@_one_label_box, \g_@@_labels_box} +% Each label is typeset in \cs{l_@@_one_label_box} to be measured. +% Once this is ready, it is put (boxed or unboxed) in +% \cs{g_@@_labels_box}, together with any pending labels (for the case +% where a list begins just after \tn{item}). This is an analogue of +% \LaTeXe{}'s \tn{@labels}, but it is always unboxed before use, to +% support both boxed and unboxed labels. +% \begin{macrocode} +\box_new:N \l_@@_one_label_box +\box_new:N \g_@@_labels_box +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\l_@@_long_label_bool} +% Track whether the \cs{l_@@_one_label_box} is larger than +% \tn{labelwidth}. +% \begin{macrocode} +\bool_new:N \l_@@_long_label_bool +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\@@_make_label_box:n, \@@_label_format:e} +% Make one label, wrapped in \cs{@@_label_format:n}, with an +% appropriate \tn{strut} and possibly \tn{makelabel} in compatibility +% mode (used for the \env{list} environment). +% \begin{macrocode} +\cs_new_protected:Npn \@@_make_label_box:n #1 + { + \hbox_set:Nn \l_@@_one_label_box { - \legacy_if:nTF { @newlist } - { - \int_incr:N \par@deathcycles - \int_compare:nNnTF \par@deathcycles > { 1000 } - { \@noitemerr - { \para_end: } - } - } +% \end{macrocode} +% If we do tagging then the contents of this box may need to be +% wrapped into a structure, e.g., \verb==. +% \begin{macrocode} + \__kernel_list_label_begin: +% \end{macrocode} +% +% \begin{macrocode} + \@@_label_format:n { - { \para_end: } + \bool_if:NT \l_@@_label_strut_bool { \strut } + \bool_if:NTF \l_@@_legacy_support_bool + \makelabel + \use:n + {#1} } +% \end{macrocode} +% And what gets opened also needs closing: +% \begin{macrocode} + \__kernel_list_label_end: } - \skip_set_eq:NN \@outerparskip \parskip - \skip_set_eq:NN \parskip \parsep - \dim_set_eq:NN \parindent \listparindent - \dim_add:Nn \linewidth { - \rightmargin - \leftmargin } - \dim_add:Nn \@totalleftmargin { \leftmargin } - \tex_parshape:D 1 ~ \@totalleftmargin \linewidth + } % \end{macrocode} -% This is the point where we are ready to add the tagging structure -% for the block, e.g., an \verb==, a \verb=
= or some -% other structure. +% \end{macro} +% +% +% \begin{macro}{\__kernel_list_label_begin:, +% \__kernel_list_label_end:} +% If we aren't doing tagging the kernel hooks do nothing. % \begin{macrocode} - \__kernel_displayblock_begin: +\cs_new_eq:NN \__kernel_list_label_begin: \prg_do_nothing: +\cs_new_eq:NN \__kernel_list_label_end: \prg_do_nothing: % \end{macrocode} -% Finally, we have to output the vertical separation and penalty at -% the start of the block and make corrections for a change in -% \cs{parskip} and some other housekeeping, unless this block is inside a list and the list -% \cs{item} has not yet placed. In that case the vertical -% space and penalty us suppressed. This -% is controlled through the legacy switches \texttt{@noparitem}, -% \texttt{minipage}, and \texttt{@nobreak}. +% \end{macro} +% +% +% +% \begin{macro}{\@@_item_everypar:, \@@_item_everypar_std:, \@@_item_everypar_first:} +% The \cs{@@_item_everypar:} command is executed as part of \hook{para/begin} +% but most of the time does nothing, i.e., it has the following +% default definition outside of lists (and most of the time within lists). % \begin{macrocode} - \legacy_if:nTF { @noparitem } - { - \legacy_if_set_false:n { @noparitem } - \hbox_gset:Nn \g_@@_labels_box - { - \skip_horizontal:n { - \leftmargin } - \hbox_unpack_drop:N \g_@@_labels_box - \skip_horizontal:n { \leftmargin } - } +\cs_new_eq:NN \@@_item_everypar: \prg_do_nothing: +% \end{macrocode} +% +% \begin{macrocode} +\AddToHook{para/begin}[items]{\@@_item_everypar:} +% \end{macrocode} +% +% Note that we have to make sure that the above code is executed +% after the hook chunk from \pkg{tagpdf} because the latter uses +% \texttt{@inlabel} to make a decision. +% +% By the end of the day both should probably move into the kernel +% hook instead or, better, into sockets. +% \begin{macrocode} +\DeclareHookRule{para/begin}{items}{after}{tagpdf} +% \end{macrocode} +% +% +% What follows is the version that resets various legacy booleans and puts +% the label box in the right place and finally resets itself to do +% nothing next time. \cs{@@_item_everypar:} is set to this by the +% item template so that the next paragraph start runs the code below. +% \begin{macrocode} +\cs_new_protected:Npn \@@_item_everypar_std: { + \@@_debug_typeout:n{item~ everypar \on@line } + \legacy_if_set_false:n { @minipage } + \legacy_if_gset_false:n { @newlist } + \legacy_if:nT { @inlabel } + { + \legacy_if_gset_false:n { @inlabel } +% \end{macrocode} +% +% \begin{macrocode} + \box_if_empty:NT \g_para_indent_box { \kern - \itemindent } + \para_omit_indent: +% \end{macrocode} +% +% \begin{macrocode} + \box_use_drop:N \g_@@_labels_box +% \end{macrocode} +% After the labels are placed we start a paragraph structure (if +% appropriate). This is handled in the following kernel hook: +% \begin{macrocode} + \__kernel_list_label_after: +% \end{macrocode} +% +% \begin{macrocode} + \penalty \c_zero_int + } + \legacy_if:nTF { @nobreak } + { + \legacy_if_gset_false:n { @nobreak } + \int_set:Nn \clubpenalty { 10000 } + } + { + \int_set_eq:NN \clubpenalty \@clubpenalty +% \end{macrocode} +% Once the label(s) are typeset and we are past any special +% \texttt{@nobreak} handling we reset \cs{@@_item_everypar:} to do +% nothing. +% \begin{macrocode} + \cs_set_eq:NN \@@_item_everypar: \prg_do_nothing: + } +} +% \end{macrocode} +% +% This is the definition of \cs{@@_item_everypar:} before the first +% \tn{item} is encountered. +% \changes{v0.8q}{2024/09/02}{Call \tn{@noitemerr} if hmode is +% started before the first item} +% \begin{macrocode} +\cs_new:Npn \@@_item_everypar_first: { + \legacy_if:nT { @newlist } { \@noitemerr } +} +% \end{macrocode} +% +% \end{macro} +% +% +% \begin{macro}{\__kernel_list_label_after:} +% +% \begin{macrocode} +\cs_new_eq:NN \__kernel_list_label_after: \prg_do_nothing: +% \end{macrocode} +% \end{macro} +% +% \begin{variable}{\l_@@_tmpa_skip} +% \begin{macrocode} +\skip_new:N \l_@@_tmpa_skip +% \end{macrocode} +% \end{variable} +% +% +% +% +% +% +% +% \begin{variable}{\l_@@_topsepadd_skip, \l_@@_effective_top_skip} +% Variables equivalent to \LaTeXe{}'s \tn{@topsepadd} and \tn{@topsep}. +% Roughly equal to a mixture of \texttt{topsep}, \texttt{partopsep}, +% and various \texttt{parskip} at different nesting levels in lists. +% The code is really elaborate when \texttt{@inlabel} is true. +% \begin{macrocode} +\skip_new:N \l_@@_topsepadd_skip +\skip_new:N \l_@@_effective_top_skip +% \end{macrocode} +% \end{variable} +% +% +% +% +% +% +% +% +% +% +% +% \begin{macro}{\item} +% Here we already have all the building blocks. Complain in math +% mode. Distinguish between first item (do necessary tagging) and +% later items \cs{@@_inter_item:} to +% cleanly close what's before, then call \cs{@@_item_instance:n} (which +% calls \tn{UseInstance}\{item\}\marg{instance}) to prepare the +% upcoming item: it will be actually inserted only once some later +% material triggers \tn{everypar}. +% \begin{macrocode} +\AddToHook{begindocument/before}{ + \RenewDocumentCommand{\item}{ ={label}o } + { + \@inmatherr \item +% \end{macrocode} +% TODO: Check if test for being outside of a list is sensible +% \begin{macrocode} + \cs_if_free:NTF \@@_item_instance:n + { + \@latex@error{Lonely~\string\item--perhaps~a~missing~ + list~environment}\@ehc + } + { + \legacy_if:nTF { @newlist } + { + \__kernel_list_item_begin: +% \end{macrocode} +% The first item of a list also has to change the \texttt{@newlist} switch. +% \changes{v0.8q}{2024/09/02}{Set \texttt{@newlist} to false after +% the first \tn{item}} +% \begin{macrocode} + \legacy_if_gset_false:n { @newlist } + } + { \@@_inter_item: } +% \end{macrocode} +% To avoid unnecessary key/val processing we make a quick check if +% there was an optional argument. +% \begin{macrocode} + \tl_if_novalue:nTF {#1} % avoids reparsing label={} + { \@@_item_instance:n { } } + { \@@_item_instance:n {#1} } +% \end{macrocode} +% Set the legacy switch that signals that we have a pending item label: +% \begin{macrocode} + \legacy_if_gset_true:n { @inlabel } + \ignorespaces + } + } +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_inter_item:} +% Between items. If the previous item had no content then we need to +% trigger \tn{everypar}. Otherwise we simply close the previous item +% with \tn{par} after removing some horizontal space. Between items, +% there is a penalty and some space. +% \begin{macrocode} +\cs_new_protected:Npn \@@_inter_item: { + \legacy_if:nT { @inlabel } + { \indent \par } % case of \item\item +% \end{macrocode} +% \tn{par} may have a strange definition and may not get us back to +% vertical mode in one go, so we better do not treat the next line +% as an else case to the above conditional (for now). +% \begin{macrocode} + \mode_if_horizontal:T { \@@_skip_remove_last: + \@@_skip_remove_last: \par } +% \end{macrocode} +% End any LI-tag, then start the next LI-tag (if doing tagging): +% \begin{macrocode} + \__kernel_list_item_end: + \__kernel_list_item_begin: +% \end{macrocode} +% +% \begin{macrocode} + \addpenalty \@itempenalty + \addvspace \itemsep +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\__kernel_list_item_begin:, +% \__kernel_list_item_end:} +% +% \begin{macrocode} +\cs_new_eq:NN \__kernel_list_item_begin: \prg_do_nothing: +\cs_new_eq:NN \__kernel_list_item_end: \prg_do_nothing: +% \end{macrocode} +% \end{macro} +% +% +% +% +% +% +% \subsection{Tagging support commands} +% +% In this section we provide code to the various kernel hooks to support +% the tagging of different displayblock environments. +% +% All of the following definitions should only be made if tagging +% is active! +% \begin{macrocode} +\tag_if_active:TF { +% \end{macrocode} +% +% \begin{macro}{\@@_beginpar_vmode:} +% When a block starts out in vertical mode, i.e., is not yet part of +% a paragraph, we have to start a paragraph +% structure. However, this is not the case if we are already +% flattening paragraphs, thus in this case we do nothing. +% We also do nothing if \texttt{@endpe} is currently true, because +% that means we are right now just after the end of a +% \texttt{blockenv} and in the process of looking if we have to end +% the current \struct{text-unit}, i.e., it is already open. +% \begin{macrocode} + \cs_set:Npn \@@_beginpar_vmode: { + \@@_debug_typeout:n + { @endpe = \legacy_if:nTF { @endpe }{true}{false} + \on@line } + \legacy_if:nTF { @endpe } + { + \legacy_if_gset_false:n { @endpe } + } +% \end{macrocode} +% We test for \texttt{<2} because the first flattened environment +% has to surround itself with a \struct{text-unit}. Only any inner ones +% then have to avoid adding another \struct{text-unit}. +% \begin{macrocode} + { + \int_compare:nNnT \l__tag_block_flattened_level_int < 2 + { + \__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: + } + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_beginpar_hmode:N} +% If the block is already part of a part of a paragraph, i.e., when it has +% some text directly in front, then the first thing to +% do is to return to vertical mode. However, that should be done +% without inserting a paragraph end tag, so before calling \tn{par} +% to do its normal work, we disable paragraph tagging and +% restarting afterwards again. The argument to this config point +% simply gobbles the \tn{par} following it in the code above (which +% is used when there is no tagging going on. +% \begin{macrocode} + \cs_set:Npn \@@_beginpar_hmode:N #1 + { + \tag_mc_end: + \__tag_gincr_para_end_int: + \@@_debug_typeout:n{increment~ /P \on@line } + \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: + \tagpdfparaOff \par \tagpdfparaOn + } +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\__kernel_displayblock_doendpe:} +% If a display block ends and is followed by a blank line we have to end the +% enclosing paragraph tagging structure. +% \begin{macrocode} +\cs_set:Npn \__kernel_displayblock_doendpe: { + \bool_if:NT \l__tag_para_bool + { +% \end{macrocode} +% Given that restoring \tn{par} through the legacy \LaTeXe{} method +% can take a few iterations (for example, in case of nested lists, +% e.g., \verb=...\end{itemize} \item ...\par= it can happen that +% \cs{__kernel_displayblock_doendpe:} is called while +% \texttt{@endpe} is already handled and then we should not attempt +% to close a \struct{text-unit} structure). So we need to check for this. +% \begin{macrocode} + \legacy_if:nT { @endpe } + { +% \end{macrocode} +% If the display block currently ending was \enquote{flattened} +% (i.e., uses simplified paragraphs that are not tagged by a +% combination of \struct{text-unit} followed by \struct{text}, but simply +% with a \struct{text}), +% then we don't have to do anything, because the \struct{text} is already closed. +% \begin{macrocode} + \@@_debug_typeout:n + { flattened= \bool_if:NTF + \l__tag_para_flattened_bool + {true}{false} + \on@line } + \bool_if:NF \l__tag_para_flattened_bool + { + \@@_debug_typeout:n{Structure-end~ + \l__tag_para_main_tag_tl\space + after~ displayblock \on@line } + \__tag_gincr_para_main_end_int: + \tag_struct_end: %text-unit + } + } + } +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{para/begin} +% +% Paragraph tagging is mainly done using the paragraph hooks (will +% get moved eventually). The default hook setting is not good +% enough when lists get supported: we need to delay starting the +% paragraph tagging if we still have to place the list label. +% We therefore remove the existing hook data and replace it with an +% augmented version (this will get combined eventually). +% \begin{macrocode} +\RemoveFromHook{para/begin}[tagpdf] +% \end{macrocode} +% +% \begin{macrocode} +\AddToHook{para/begin}[tagpdf]{ + \bool_if:NT \l__tag_para_bool { +% \end{macrocode} +% if we are still waiting to typeset the list label we do nothing +% (the paragraph tagging then happens when the list is finally +% typeset). +% \begin{macrocode} + \legacy_if:nF { @inlabel } + { +% \end{macrocode} +% Otherwise, we start a \struct{text} tag structure but only if we are not +% starting a paragraph immediately \emph{after} a list, in which +% case we only start a new MC (because the \struct{text} tag is still open from +% before the list --- one of the reasons why lists are always put +% \enquote{inside} paragraphs. +% +% We do this in a separate command, because it is needed elsewhere too. +% \begin{macrocode} + \@@_start_para_structure:n { \PARALABEL } + } + } +} +% \end{macrocode} +% +% +% \begin{macro}{\@@_start_para_structure:n} +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_start_para_structure:n #1 { + \@@_debug_typeout:n + { @endpe = \legacy_if:nTF { @endpe }{true}{false} + \on@line } + \legacy_if:nF { @endpe } + { + \bool_if:NF \l__tag_para_flattened_bool + { + \__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: + } + } + \__tag_gincr_para_begin_int: + \@@_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 + } + \__tag_check_para_begin_show:nn {green}{#1} + \tag_mc_begin:n {} +} +% \end{macrocode} +% The same code, but without testing \texttt{@endpe}. This is not +% needed in the standalone case and wrong inside lists. +% \begin{macrocode} +\cs_new_protected:Npn \@@_start_para_structure_unconditionally:n #1 { + \bool_if:NF \l__tag_para_flattened_bool + { + \__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: + } + \__tag_gincr_para_begin_int: + \@@_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 + } + \__tag_check_para_begin_show:nn {green}{#1} + \tag_mc_begin:n {} +} % \end{macrocode} -% \fmi{document 2e logic used here} +% \end{macro} +% % \begin{macrocode} - \legacy_if:nF { @minipage } % Why this chunk of code? - { - \@@_skip_set_to_last:N \l_@@_tmpa_skip - \skip_vertical:n { - \l_@@_tmpa_skip } - \skip_vertical:n { \l_@@_tmpa_skip + \@outerparskip - \parskip } - } - } +\RemoveFromHook{para/end}[tagpdf] +\AddToHook{para/end} + { + \bool_if:NT \l__tag_para_bool { - \legacy_if:nTF { @nobreak } - { \addvspace{\skip_eval:n{\@outerparskip-\parskip}} } - { - \addpenalty \@beginparpenalty - \addvspace \l_@@_effective_top_skip - \addvspace{-\parskip} - } + \__tag_gincr_para_end_int: + \@@_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 + { + \__tag_gincr_para_main_end_int: + \tag_struct_end: + } } -} + } % \end{macrocode} % -% -% Extra keys to support enumitem conventions: % \begin{macrocode} -\keys_define:nn { template/block/display } -{ - ,topsep .skip_set:N = \topsep - ,partopsep .skip_set:N = \partopsep - ,listparindent .skip_set:N = \listparindent -} +\def\PARALABEL{NP-} % \end{macrocode} -% \end{template} -% +% \end{macro} % -% \begin{macro}{\__kernel_displayblock_begin:, -% \__kernel_displayblock_beginpar_hmode:w, -% \__kernel_displayblock_beginpar_vmode:} -% The internal kernel hooks for tagging. -% \begin{macrocode} -\cs_new:Npn \__kernel_displayblock_begin: { - \@@_debug_typeout:n{\detokenize{__kernel_displayblock_begin:}} -} -% \end{macrocode} % +% \begin{macro}{\para_end:} +% If we see a \tn{par} in vmode and a \struct{text-unit} is still open +% we need to close that. For this we check if a request for +% \text{@endpe} was made (but the \tn{par} redefinition got lost +% due to (bad?) coding). % \begin{macrocode} -\cs_new:Npn \__kernel_displayblock_beginpar_hmode:w { - \@@_debug_typeout:n{\detokenize{__kernel_displayblock_beginpar_hmode:w}} +\cs_set_protected:Npn \para_end: { + \scan_stop: + \mode_if_horizontal:TF { + \mode_if_inner:F { + \tex_unskip:D + \hook_use:n{para/end} + \@kernel@after@para@end + \mode_if_horizontal:TF { + \if_int_compare:w 11 = \tex_lastnodetype:D + \tex_hskip:D \c_zero_dim + \fi: + \tex_par:D + \hook_use:n{para/after} + \@kernel@after@para@after + } + { \msg_error:nnnn { hooks }{ para-mode }{end}{horizontal} } + } + } + { + \__kernel_endpe_vmode: % should do nothing if no tagging + \tex_par:D + } } +\cs_set_eq:NN \par \para_end: +\cs_set_eq:NN \@@par \para_end: +\cs_set_eq:NN \endgraf \para_end: % \end{macrocode} % -% \begin{macrocode} -\cs_new:Npn \__kernel_displayblock_beginpar_vmode: { - \@@_debug_typeout:n{\detokenize{__kernel_displayblock_beginpar_vmode:}} -} -% \end{macrocode} % \end{macro} % % -% -% -% \subsubsection{Implementation of list templates \ldots} -% -% -% -% \begin{macro}{\@itemlabel,\@listctr} -% Both \cs{@itemlabel} and \cs{@listctr} from the \LaTeXe{} list -% implementation are used (or set) by various packages. We -% therefore use them too, so that these packages have a fighting -% chance to work with the new tagging-aware implementation for -% \env{list}. +% \begin{macro}{\begin} +% We need to do a little more than canceling \texttt{@endpe} now. % \begin{macrocode} -\tl_new:N \@itemlabel % should have a top-level definition -\tl_new:N \@listctr % should have a top-level definition +\DeclareRobustCommand*\begin[1]{% + \UseHook{env/#1/before}% + \@ifundefined{#1}% + {\def\reserved@a{\@latex@error{Environment~#1~undefined}\@eha}}% + {\def\reserved@a{\def\@currenvir{#1}% + \edef\@currenvline{\on@line}% + \@execute@begin@hook{#1}% + \csname #1\endcsname}}% + \@ignorefalse + \begingroup + \__kernel_endpe_vmode: + \reserved@a} % \end{macrocode} % \end{macro} % % -% -% \begin{macro}{\@@_evaluate_saved_user_keys:nn} -% Keys set on individual list environments may be intended to alter -% the behavior of the template instance that defines the \cs{item} -% command. If meant to alter only a single \cs{item} command one -% would specify them in the optional argument of the \cs{item}, but -% if they should alter all items the right place would be the list -% environment. For this reason we need to store the values and then -% set them inside the \cs{item} template code using -% \cs{SetTemplateKeys} in the appropriate context (template type -% and template name). This is done in -% \cs{@@_evaluate_saved_user_keys:nn}. The context is provided in -% the two arguments (because different list environments may use -% different \cs{item} instances based on different templates. By -% default the command does -% nothing because most environments do not have user key settings. -% \changes{v0.8s}{2024/10/03}{Pass user keys on list to \cs{item} for -% evaluation} -% \begin{macrocode} -\cs_new_eq:NN \@@_evaluate_saved_user_keys:nn \use_none:nn -% \end{macrocode} -% Maybe something like this should become a public function, but -% for now this is a one-off for the \cs{item} command and therefore -% coded inline and internal to the block code. +% \begin{macro}{\__kernel_endpe_vmode:} +% Close an open \struct{text-unit} if \texttt{@endpe} is true and we +% are in vmode. Used in \cs{para_end:} and \tn{begin}. % \begin{macrocode} -%\cs_new:Npn \@@_save_user_keys:n #1 { -% \tl_if_empty:nTF {#1} -% { \cs_set_eq:NN \@@_evaluate_saved_user_keys:nn \use_none:nn } -% { -% \cs_set:Npe \@@_evaluate_saved_user_keys:nn ##1##2 -% { \SetTemplateKeys{##1}{##2}{ \exp_not:n{#1} } } -% } -%} +\cs_new:Npn \__kernel_endpe_vmode: { + \if@endpe \ifvmode + \bool_if:NT \l__tag_para_bool + { + \bool_if:NF \l__tag_para_flattened_bool + { + \__tag_gincr_para_main_end_int: + \tag_struct_end: + } + \@endpefalse + } + \fi \fi +} % \end{macrocode} % \end{macro} % % -% \begin{template}{list std} -% -% This template implements numbered and unnumbered lists and can -% be combined with display blocks or with inline blocks. -% \begin{macrocode} -\DeclareTemplateCode{list}{std}{1} -{ - counter = \l_@@_counter_tl, - item-label = \l_@@_item_label_tl, - start = \l_@@_counter_start_int , - resume = \l_@@_resume_bool , - item-instance = \@@_item_instance:n , - item-skip = \itemsep , -% item-par-skip = \parsep , - item-penalty = \@itempenalty , - item-indent = \itemindent , - label-width = \labelwidth , - label-sep = \labelsep , - legacy-support = \l_@@_legacy_support_bool , % FMi questionable -} -{ - \@@_debug_typeout:n{template:list:std} -% -% \end{macrocode} -% We start by looking at the user supplied keys in \texttt{\#1}. If -% there aren't any we reset \cs{@@_evaluate_saved_user_keys:nn} to -% do nothing. Otherwise we evaluate and set the keys in the contect -% of the current list template. In addition we prepare -% \cs{@@_evaluate_saved_user_keys:nn} for execution in the -% template for \cs{item}. -% \changes{v0.8s}{2024/10/03}{Prepare \cs{@@_evaluate_saved_user_keys:nn} -% for use in \cs{item}} +% \begin{macro}{\__kernel_list_label_after:} +% If starting the text-unit/text tags got delayed because of a pending label we +% have to do it after the label got typeset % \begin{macrocode} - \tl_if_empty:nTF {#1} - { \cs_set_eq:NN \@@_evaluate_saved_user_keys:nn \use_none:nn } +\cs_set:Npn \__kernel_list_label_after: { + \bool_if:NT \l__tag_para_bool { - \SetTemplateKeys{list}{std}{#1} - \cs_set:Npe \@@_evaluate_saved_user_keys:nn ##1##2 - { \SetTemplateKeys{##1}{##2}{ \exp_not:n{#1} } } - } -% \end{macrocode} -% Has this list a counter name defined in the instance? -% \begin{macrocode} - \tl_if_empty:NTF \l_@@_counter_tl - { -% \end{macrocode} -% If not we check if \cs{@nmbrlist} is true which may be the case -% in legacy environments that used \cs{usecounter} in the argument -% to the \env{list} environment. -% \changes{v0.8v}{2024/10/11}{Correct logic for setting up the list -% counter (tagging/730)} -% \begin{macrocode} - \legacy_if:nT { @nmbrlist } - { -% \end{macrocode} -% In that case we only check if we should resume a previous list -% (\cs{@listctr} should be set in that case through the legacy -% method as well so we should be able to use it). -% \begin{macrocode} - \bool_if:NF \l_@@_resume_bool - { - \int_gset:cn{ c@ \@listctr } - { \l_@@_counter_start_int - 1 } - } - } - } -% \end{macrocode} -% If a counter is set in the list instance we use that -% one. This should be the name of a \LaTeX{} counter that is -% already allocated externally---no runtime check is made for this: -% if it is not declared one will get \enquote{no such counter} -% error when the list is used. -% \begin{macrocode} - { - \@nmbrlisttrue - \tl_set_eq:NN \@listctr \l_@@_counter_tl - \bool_if:NF \l_@@_resume_bool - { - \int_gset:cn{ c@ \@listctr } - { \l_@@_counter_start_int - 1 } - } - } -% \end{macrocode} -% Does the current instance has an item label representation? This -% would be possible whether or not we have a numbered list. If yes, -% then we use this for \cs{@itemlabel}, otherwise we expect that -% \cs{@itemlabel} is provided from the outside, e.g., as part of -% the \env{list} environment argument. -% \begin{macrocode} - \tl_if_empty:NF \l_@@_item_label_tl - { - \tl_set_eq:NN \@itemlabel \l_@@_item_label_tl - } -% \end{macrocode} -% Finally, we signal that we are at the start of a new list (which -% affects how the first \cs{item} is handled and how \cs{par} -% commands are interpreted. -% \begin{macrocode} - \legacy_if_gset_true:n { @newlist } -% \end{macrocode} -% If we encounter horizontal material before the first \cs{item} we -% do want a \cs{@noitemerr} straight away, because afterwards we -% end up with tagging structure faults whose cause is the -% missing \cs{item}. So we setup up \cs{@@_item_everypar:} to test -% for this; when the first \cs{item} is encountered this will get -% reset. This is only relevant for vertical lists, when dealing with -% inline lists one would need to test for something else to -% identify that there is horizontal material between the start of the list and -% the first \cs{item} (maybe some \cs{spacefactor} trick could be -% used then, or the material is boxed first and the width is -% inspected as suggested by Joseph).\fmi{Think about a better -% implementation at some point.} -% \changes{v0.8q}{2024/09/02}{} -% \begin{macrocode} - \cs_set_eq:NN \@@_item_everypar: \@@_item_everypar_first: + \@@_start_para_structure_unconditionally:n { LI- } + } +} % \end{macrocode} -% +% \end{macro} +% +% +% \begin{macro}{\@@_inner_begin:} +% Start a block that has an inner structure if it isn't also a list. % \begin{macrocode} - \@@_debug_typeout:n{template:list:std~end} +\cs_new:Npn \@@_inner_begin: { + \tagstructbegin{tag=\l_@@_tag_inner_tag_tl} } % \end{macrocode} -% +% \end{macro} % -% Extra keys to support enumitem conventions: +% +% \begin{macro}{\@@_inner_end:} +% End a block (which isn't also a list). % \begin{macrocode} -\keys_define:nn { template/list/std } -{ - ,nosep .code:n = - \dim_zero:N \itemsep - \dim_zero:N \parsep - \dim_zero:N \topsep - \dim_zero:N \l_@@_botsep_skip - \dim_zero:N \l_@@_parbotsep_skip - ,midsep .skip_set:N = \topsep +\cs_new:Npn \@@_inner_end: { + \@@_debug_typeout:n{block-end \on@line} + \legacy_if:nT { @endpe } + { + \__tag_gincr_para_main_end_int: + \@@_debug_typeout:n{close~ /text-unit \on@line} + \tagstructend + } + \tagstructend % end inner structure } % \end{macrocode} +% \end{macro} % -% \end{template} % % -% \subsubsection{Implementation of \cs{item} template(s)} % % % -% \begin{template}{item std} -% The item template has one hidden key \texttt{label} which is not available on the -% template for setting because it is only used to receive any -% optional data passed to the \cs{item} command. We therefore -% declare it with \cs{keys_define:nn} and ensure that the optional -% argument data to \cs{item} (if it is not a key/value list -% already) is passed to this \texttt{label} key. -% \begin{macrocode} -\keys_define:nn { template/item/std } - { label .tl_set:N = \l_@@_label_given_tl } -% \end{macrocode} +% \subsubsection{List tags} +% % -% \fmi{alignment is mostly wrong (test short medium and multiline -% labels)} % \begin{macrocode} -\DeclareTemplateCode{item}{std}{1} - { - counter-label = \@@_counter_label:n , - counter-ref = \@@_counter_ref:n , +\tl_new:N \l__tag_L_tag_tl +\tl_set:Nn \l__tag_L_tag_tl {L} + +\tl_new:N\l__tag_L_attr_class_tl +\tl_set:Nn \l__tag_L_attr_class_tl {list} % \end{macrocode} -% \fmi{next set of key not yet used} +% % \begin{macrocode} - label-ref = \@@_label_ref:n , - label-autoref = \@@_label_autoref:n , - label-format = \@@_label_format:n , - label-strut = \l_@@_label_strut_bool , - label-boxed = \l_@@_label_boxed_bool , - next-line = \l_@@_next_line_bool , - text-font = \l_@@_text_font_tl , - compatibility = \l_@@_item_compatibility_bool , +\tag_if_active:T +{ + \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}, % \end{macrocode} -% This probably needs a different implementation (and needs completing)\fmi{complete} +% Initially, we had \texttt{/None} for the basic \env{list} +% environment, but that is not allowed in PDF/UA-2 if the list +% contains any Lbl tags. So now we default to +% \texttt{Unordered}. % \begin{macrocode} - label-align = { - left = \tl_set:Nn \l_@@_item_align_tl { \relax \hss } , - center = \tl_set:Nn \l_@@_item_align_tl { \hss \hss } , - right = \tl_set:Nn \l_@@_item_align_tl { \hss \relax } , - parleft = \NOT_IMPLEMENTED , - } , - } + % default if unknown + role/new-attribute = {list}{/O /List /ListNumbering/Unordered}, + } +} % \end{macrocode} -% Then typeset the label at its natural width by applying -% \cs{@@_make_label_box:n} to the label given or to a label constructed -% from the counter. If it is boxed and reasonably short, add padding to -% make it at least of size \tn{labelwidth}, then add another layer of -% box. This way, when we unpack it in \cs{g_@@_labels_box} it correctly -% remains boxed in those cases. Afterwards, in the \texttt{nextline} -% case add \tn{newline} if the label did not fit in the allotted space. +% % \begin{macrocode} - { - \@@_debug_typeout:n{template:item:std} +\def\LItag{LI} % \end{macrocode} -% -% First deal with the key--value input, which in particular may -% provide a value for the label (the usual optional argument of -% \cs{item}). For this we set \cs{l_@@_label_given_tl} to -% \cs{c_novalue_tl} so that we can identify if an optional argument -% was given. +% +% \begin{macro}{\@@_list_begin:} +% Start a list \ldots % \begin{macrocode} - \tl_set_eq:NN \l_@@_label_given_tl \c_novalue_tl +\cs_set:Npn \@@_list_begin: { + \tagstructbegin + { + tag=\l__tag_L_tag_tl + ,attribute-class=\l__tag_L_attr_class_tl + } +} % \end{macrocode} -% First we evaluate and set any keys specified on the list -% environment by calling -% \cs{@@_evaluate_saved_user_keys:nn}. Then we do the same -% with all keys specified on this \cs{item} command (which may -% overwrite one or the other setting just made). -% \changes{v0.8s}{2024/10/03}{Use \cs{@@_evaluate_saved_user_keys:nn} -% to make use of user keys on the list level} +% \end{macro} +% +% \begin{macro}{\@@_list_item_begin:} +% Start tagging a list item. % \begin{macrocode} - \@@_evaluate_saved_user_keys:nn {item}{std} - \tl_if_empty:nF{#1}{ \SetTemplateKeys{item}{std}{#1} } +\cs_set:Npn \@@_list_item_begin: { \tagstructbegin{tag=\LItag} } % \end{macrocode} -% -% If no optional argument was given then \cs{l_@@_label_given_tl} -% is still equal to \cs{c_novalue_tl} and so we can distinuish -% that from \verb=\item[]=. +% \end{macro} +% % +% \begin{macro}{\__kernel_list_label_begin:} +% A list label needs a \struct{Lbl} structure tag and an MC. % \begin{macrocode} - \tl_if_novalue:oTF \l_@@_label_given_tl - { +\cs_set:Npn \__kernel_list_label_begin: { +% +% FMi: this needs a different logic to decide when to make the label +% an artifact (after cleaning up the \item code ), therefore +% disabled for now +% \tl_if_empty:oTF \@itemlabel +% { +% \tag_mc_begin:n {artifact} +% } +% { + \tagstructbegin{tag=Lbl} + \tagmcbegin{tag=Lbl} +% } +} % \end{macrocode} -% The rest of the code for this template needs work and is both -% incomplete and partly wrong.\fmi{fix} +% \end{macro} +% +% +% +% \begin{macro}{\__kernel_list_label_end:} +% And when we are done with the label we have to close the MC and +% the \struct{Lbl} structure. We then start the \struct{LBody}. The +% material inside will be \enquote{paragraph} text and the tagging +% for that is handled by the normal para tagging. % \begin{macrocode} - \tl_if_blank:oF \@listctr { \@kernel@refstepcounter \@listctr } - \bool_if:NTF \l_@@_item_compatibility_bool % not sure that conditional - % makes sense - { \@@_make_label_box:n { \MakeLinkTarget[\@listctr]{}\@itemlabel } } % TODO ? - { \@@_make_label_box:n { \MakeLinkTarget[\@listctr]{}\@@_counter_label:n { \@listctr } } } - } - { - \@@_debug_typeout:n{item~ with~ optional} - \@@_make_label_box:n { \l_@@_label_given_tl } } - \bool_if:nT - { - \l_@@_label_boxed_bool - && \dim_compare_p:n { \box_wd:N \l_@@_one_label_box <= \linewidth } % TODO: is \linewidth correct? - } - { - \dim_compare:nNnT - { \box_wd:N \l_@@_one_label_box } < \labelwidth - { - \hbox_set_to_wd:Nnn \l_@@_one_label_box { \labelwidth } - { - \exp_after:wN \use_i:nn \l_@@_item_align_tl +\cs_set:Npn \__kernel_list_label_end: { + \tagmcend % end mc-Lbl or artifact +% FMi: unconditionally for now +% \tl_if_empty:oF \@itemlabel + \tagstructend % end Lbl + \tagstructbegin{tag=\LBody} +} +\def\LBody{LBody} % \end{macrocode} -% FMi: \LaTeXe{} keeps the label boxed inside (not unboxed). This -% means that the content stays rigid and does not vary based on -% glue setting in the line with the label. -% There are cases where we do want the unboxed version (I think -% enumitem offers that in some cases too) but it should probably -% not the default. +% \end{macro} +% +% +% +% \begin{macro}{\@@_list_item_end:} +% When a list item ends we have to close \struct{LBody} and +% \struct{LI} but also a \struct{text} in the special case that the +% item material ends in a list (identifiable via \texttt{@endpe}). % \begin{macrocode} -% \hbox_unpack_drop:N \l_@@_one_label_box %TODO: customize? - \box_use_drop:N \l_@@_one_label_box +\cs_set:Npn \@@_list_item_end: { + \legacy_if:nT { @endpe } + { + \__tag_gincr_para_main_end_int: + \tagstructend % text-unit +% \@@_debug_typeout:n{Structure-end~ P~ at~ item-end \on@line } + } + \tagstructend \tagstructend % end LBody, LI +} % \end{macrocode} +% \end{macro} +% +% % +% \begin{macro}{\@@_list_end:} +% Finally, at the list end we have to close the open +% \struct{LBody}, \struct{LI}, \struct{L}, and possibly a +% \struct{text} if the last item ends with a list. +% However, if the user forgot to add an \tn{item} then there will be no +% \struct{LI} and \struct{LBody} open, so we check for the status +% of \texttt{@newlist}. The corresponding no-item error was +% generated earlier outside the tagging code. +% +% One could argue that it doesn't matter if the tagging is wrong +% after a \tn{@noitemerr} was issued. However, there is one case +% where it isn't an error: In the \env{thebibliography} +% environment (which is internally a list) it is often the case +% that documents start out with an empty environment, not +% containing any \tn{bibitem}s. For that reason \tn{@noitemerr} is +% redefined inside that environment to only produce a warning; +% hence we have to produce correct tag structures in that case. +% \changes{v0.8q}{2024/09/02}{Do not close LI and LBody if they +% never were opened.} % \begin{macrocode} - \exp_after:wN \use_ii:nn \l_@@_item_align_tl - } - } +\cs_set:Npn \@@_list_end: { % \end{macrocode} -% Add another box level to the label box: +% If \texttt{@newlist} is true (i.e., when we have an error or warning +% situation) there is not much to close. % \begin{macrocode} - \hbox_set:Nn \l_@@_one_label_box - { \box_use_drop:N \l_@@_one_label_box } - } - \dim_compare:nNnTF { \box_wd:N \l_@@_one_label_box } > \labelwidth - { \bool_set_true:N \l_@@_long_label_bool } - { \bool_set_false:N \l_@@_long_label_bool } - \hbox_gset:Nn \g_@@_labels_box - { - \hbox_unpack_drop:N \g_@@_labels_box - \skip_horizontal:n { \itemindent - \labelsep - \labelwidth } - \hbox_unpack_drop:N \l_@@_one_label_box - \skip_horizontal:n { \labelsep } - \bool_if:NT \l_@@_next_line_bool - { \bool_if:NT \l_@@_long_label_bool { \nobreak \hfil \break } } - % version of \newline inside an hbox that will be unpacked - } - % \skip_set_eq:NN \parsep \l_@@_item_parsep_skip TODO??? FMi - % what's that? - \dim_set_eq:NN \parindent \listparindent + \legacy_if:nF { @newlist } + { + \legacy_if:nT { @endpe } + { + \__tag_gincr_para_main_end_int: + \tagstructend % text-unit + \@@_debug_typeout:n{Structure-end~ P~ at~ list-end \on@line } + } + \tagstructend\tagstructend % end LBody, LI + } + \tagstructend % end L +} % \end{macrocode} -% Placing the list label(s) is done when the paragraph for the -% \cs{item} is started, which executes \cs{@@_item_everypar:} -% inside \hook{para/begin}. By default this command does nothing, now we -% change it to attach the pending label or labels. +% \end{macro} +% End of tagging related declarations. % \begin{macrocode} - \cs_set_eq:NN \@@_item_everypar: \@@_item_everypar_std: - } +} +% \end{macrocode} +% These command should have a dummy declaration if tagging is not active +% \begin{macrocode} +{ + \cs_new:Npn \@@_start_para_structure_unconditionally:n #1 {} +} % \end{macrocode} -% \end{template} % % % +% % -% \begin{variable}{\l_@@_one_label_box, \g_@@_labels_box} -% Each label is typeset in \cs{l_@@_one_label_box} to be measured. -% Once this is ready, it is put (boxed or unboxed) in -% \cs{g_@@_labels_box}, together with any pending labels (for the case -% where a list begins just after \tn{item}). This is an analogue of -% \LaTeXe{}'s \tn{@labels}, but it is always unboxed before use, to -% support both boxed and unboxed labels. -% \begin{macrocode} -\box_new:N \l_@@_one_label_box -\box_new:N \g_@@_labels_box -% \end{macrocode} -% \end{variable} +% % -% \begin{variable}{\l_@@_long_label_bool} -% Track whether the \cs{l_@@_one_label_box} is larger than -% \tn{labelwidth}. -% \begin{macrocode} -\bool_new:N \l_@@_long_label_bool -% \end{macrocode} -% \end{variable} % -% \begin{macro}{\@@_make_label_box:n, \@@_label_format:e} -% Make one label, wrapped in \cs{@@_label_format:n}, with an -% appropriate \tn{strut} and possibly \tn{makelabel} in compatibility -% mode (used for the \env{list} environment). +% +% +% +% \subsection{Tagging recipes} +% +% \begin{macro}{\@@_recipe_basic:} +% The \keyvalue{basic} recipe simply ensures that the block is inside +% a \struct{text-unit} structure and if necessary starts one. When the +% block ends and is followed by a blank line the \struct{text-unit} +% structure is closed too, otherwise it remains open and further +% text starts with just a \struct{text} structure. +% +% There is otherwise no inner structure so +% \cs{__kernel_displayblock_begin:} and +% \cs{__kernel_displayblock_end:} do nothing---blockenvs with inner +% structure use the \keyvalue{standard} or \keyvalue{list} recipe instead. % \begin{macrocode} -\cs_new_protected:Npn \@@_make_label_box:n #1 - { - \hbox_set:Nn \l_@@_one_label_box - { +\cs_new:Npn \@@_recipe_basic: { + \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w + \@@_beginpar_hmode:N + \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: + \@@_beginpar_vmode: + \let \__kernel_displayblock_begin: \prg_do_nothing: + \let \__kernel_displayblock_end: \prg_do_nothing: % \end{macrocode} -% If we do tagging then the contents of this box may need to be -% wrapped into a structure, e.g., \verb==. +% End environment \tn{par} handling: % \begin{macrocode} - \__kernel_list_label_begin: + \socket_assign_plug:nn{tagsupport/block-endpe}{on} +} % \end{macrocode} +% \end{macro} % +% \begin{macro}{\@@_recipe_standalone:} +% +% The \keyvalue{standalone} recipe produces a block that ensures that +% a previous \struct{text-unit} ends and that after the block a new +% \struct{text-unit} starts. % \begin{macrocode} - \@@_label_format:n - { - \bool_if:NT \l_@@_label_strut_bool { \strut } - \bool_if:NTF \l_@@_legacy_support_bool - \makelabel - \use:n - {#1} - } +\cs_new:Npn \@@_recipe_standalone: { + \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w + \prg_do_nothing: + \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: + \prg_do_nothing: + \cs_set_eq:NN \__kernel_displayblock_begin: \@@_inner_begin: + \cs_set_eq:NN \__kernel_displayblock_end: \@@_inner_end: % \end{macrocode} -% And what gets opened also needs closing: +% End environment \tn{par} handling: % \begin{macrocode} - \__kernel_list_label_end: - } - } + \socket_assign_plug:nn{tagsupport/block-endpe}{off} % \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\__kernel_list_label_begin:, -% \__kernel_list_label_end:} -% If we aren't doing tagging the kernel hooks do nothing. +% % \begin{macrocode} -\cs_new_eq:NN \__kernel_list_label_begin: \prg_do_nothing: -\cs_new_eq:NN \__kernel_list_label_end: \prg_do_nothing: + \tl_if_empty:NTF \l_@@_tag_name_tl + { \tl_set:Nn \l_@@_tag_inner_tag_tl {Sect} } + { \tl_set_eq:NN \l_@@_tag_inner_tag_tl \l_@@_tag_name_tl } +} % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_recipe_standard:} +% The \keyvalue{standard} recipe does the following: +% \begin{itemize} +% \item surround the block with a \struct{text-unit} structure if not already in a +% a \struct{text-unit}. In the latter case end the +% MC and the \struct{text} but leave the \struct{text-unit} open. % +% If we are producing flattened paragraphs, just close any +% \struct{text} but do not open a \struct{text-unit}. % -% \begin{macro}{\@@_item_everypar:, \@@_item_everypar_std:, \@@_item_everypar_first:} -% The \cs{@@_item_everypar:} command is executed as part of \hook{para/begin} -% but most of the time does nothing, i.e., it has the following -% default definition outside of lists (and most of the time within lists). +% \item Then open an new (inner) structure (by default +% \struct{Figure} but typically the one specified on the instance). +% \item At the end of the block close the inner structure +% (\struct{Figure} or explicit one) +% but leave the \struct{text-unit} open to be either continued or closed due to a +% following \tn{par}. +% \end{itemize} % \begin{macrocode} -\cs_new_eq:NN \@@_item_everypar: \prg_do_nothing: +\cs_new:Npn \@@_recipe_standard: +{ + \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w + \@@_beginpar_hmode:N + \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: + \@@_beginpar_vmode: + \cs_set_eq:NN \__kernel_displayblock_begin: \@@_inner_begin: + \cs_set_eq:NN \__kernel_displayblock_end: \@@_inner_end: % \end{macrocode} -% +% End environment \tn{par} handling: % \begin{macrocode} -\AddToHook{para/begin}[items]{\@@_item_everypar:} + \socket_assign_plug:nn{tagsupport/block-endpe}{on} % \end{macrocode} -% -% Note that we have to make sure that the above code is executed -% after the hook chunk from \texttt{tagpdf} because the latter uses -% \texttt{@inlabel} to make a decision. -% -% By the end of the day both should probably move into the kernel -% hook instead or, better, into sockets. +% % \begin{macrocode} -\DeclareHookRule{para/begin}{items}{after}{tagpdf} + \tl_if_empty:NTF \l_@@_tag_name_tl + { \tl_set:Nn \l_@@_tag_inner_tag_tl {Figure} } + { \tl_set_eq:NN \l_@@_tag_inner_tag_tl \l_@@_tag_name_tl } +} % \end{macrocode} +% \end{macro} % % -% What follows is the version that resets various legacy booleans and puts -% the label box in the right place and finally resets itself to do -% nothing next time. \cs{@@_item_everypar:} is set to this by the -% item template so that the next paragraph start runs the code below. -% \begin{macrocode} -\cs_new_protected:Npn \@@_item_everypar_std: { - \@@_debug_typeout:n{item~ everypar \on@line } - \legacy_if_set_false:n { @minipage } - \legacy_if_gset_false:n { @newlist } - \legacy_if:nT { @inlabel } - { - \legacy_if_gset_false:n { @inlabel } -% \end{macrocode} % +% \begin{macro}{\l_@@_tag_inner_tag_tl} % \begin{macrocode} - \box_if_empty:NT \g_para_indent_box { \kern - \itemindent } - \para_omit_indent: +\tl_new:N \l_@@_tag_inner_tag_tl % \end{macrocode} +% \end{macro} % +% +% +% \begin{macro}{\@@_recipe_list:} +% The \keyvalue{list} recipe does the following. +% \begin{itemize} +% \item It opens a \struct{text-unit}-structure or keeps the current one open (only +% closing the MC). +% \item It then starts a new structure rolemapped to L-structure +% and arranges for handling list items, e.g., Li, Lbl and LBody +% structures. +% \item At the end it closes open list structures as needed but +% keeps the \struct{text-unit}-structure open to continue the paragraph after the +% list, if necessary. +% \end{itemize} % \begin{macrocode} - \box_use_drop:N \g_@@_labels_box -% \end{macrocode} -% After the labels are placed we start a paragraph structure (if -% appropriate). This is handled in the following kernel hook: -% \begin{macrocode} - \__kernel_list_label_after: +\cs_new:Npn \@@_recipe_list: +{ + \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w + \@@_beginpar_hmode:N + \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: + \@@_beginpar_vmode: + \cs_set_eq:NN \__kernel_displayblock_begin: \@@_list_begin: + \cs_set_eq:NN \__kernel_displayblock_end: \@@_list_end: % \end{macrocode} -% +% The next two lines could be done globally, because they are only +% called if we do have \tn{item}s, i.e., if we are in a list. It is +% therefore also not necessary to reset them in other recipes +% (right now---this may change if we get more templates (like +% inline lists)). % \begin{macrocode} - \penalty \c_zero_int - } - \legacy_if:nTF { @nobreak } - { - \legacy_if_gset_false:n { @nobreak } - \int_set:Nn \clubpenalty { 10000 } - } - { - \int_set_eq:NN \clubpenalty \@clubpenalty + \cs_set_eq:NN \__kernel_list_item_begin: \@@_list_item_begin: + \cs_set_eq:NN \__kernel_list_item_end: \@@_list_item_end: % \end{macrocode} -% Once the label(s) are typeset and we are past any special -% \texttt{@nobreak} handling we reset \cs{@@_item_everypar:} to do -% nothing. +% End environment \tn{par} handling: % \begin{macrocode} - \cs_set_eq:NN \@@_item_everypar: \prg_do_nothing: - } -} + \socket_assign_plug:nn{tagsupport/block-endpe}{on} % \end{macrocode} % -% This is the definition of \cs{@@_item_everypar:} before the first -% \cs{item} is encountered. -% \changes{v0.8q}{2024/09/02}{Call \cs{@noitemerr} if hmode is -% started before the first item} +% Handle the tag name and attribute classes using the key values +% from the current list instance. % \begin{macrocode} -\cs_new:Npn \@@_item_everypar_first: { - \legacy_if:nT { @newlist } { \@noitemerr } + \tl_if_empty:NTF \l_@@_tag_name_tl + { \tl_set:Nn \l__tag_L_tag_tl {L} } + { \tl_set_eq:NN \l__tag_L_tag_tl \l_@@_tag_name_tl } + \tl_if_empty:NTF \l_@@_tag_class_tl + { \tl_set:Nn \l__tag_L_attr_class_tl {} } + { \tl_set_eq:NN \l__tag_L_attr_class_tl \l_@@_tag_class_tl } } % \end{macrocode} +% \end{macro} % -% \end{macro} % % -% \begin{macro}{\__kernel_list_label_after:} -% -% \begin{macrocode} -\cs_new_eq:NN \__kernel_list_label_after: \prg_do_nothing: -% \end{macrocode} -% \end{macro} % -% \begin{variable}{\l_@@_tmpa_skip} -% \begin{macrocode} -\skip_new:N \l_@@_tmpa_skip -% \end{macrocode} -% \end{variable} +% \section[Implementation of document-level block environments] +% {Implementation of document-level block\\ environments} % +% Most such environments are pretty simple: they take an optional +% argument and call a \texttt{blockenv} instance to do the work. At +% the end of environment we call \tn{endblockenv} to finish. % % +% \subsection{Displayblock environments} % % +% There are two basic block environment which are similar to +% \LaTeXe{}'s \env{trivlist} except that there aren't degenerated +% lists and thus have no hidden \tn{item} inside. % % -% \begin{variable}{\l_@@_topsepadd_skip, \l_@@_effective_top_skip} -% Variables equivalent to \LaTeXe{}'s \tn{@topsepadd} and \tn{@topsep}. -% Roughly equal to a mixture of \texttt{topsep}, \texttt{partopsep}, -% and various \texttt{parskip} at different nesting levels in lists. -% The code is really elaborate when \texttt{@inlabel} is true. +% \begin{environment}{displayblock} +% % \begin{macrocode} -\skip_new:N \l_@@_topsepadd_skip -\skip_new:N \l_@@_effective_top_skip +\NewDocumentEnvironment{displayblock}{ !O{} } + { \UseInstance{blockenv}{displayblock} {#1} } + { \endblockenv } % \end{macrocode} -% \end{variable} -% -% +% \end{environment} % % +% \begin{environment}{displayblockflattened} +% +% \begin{macrocode} +\NewDocumentEnvironment{displayblockflattened}{ !O{} } + { \UseInstance{blockenv}{displayblockflattened} {#1} } + { \endblockenv } +% \end{macrocode} +% \end{environment} % % % % +% \subsection{The \env{center}, \env{flushleft}, and \env{flushright} environments} % % % -% \begin{macro}{\item} -% Here we already have all the building blocks. Complain in math -% mode. Distinguish between first item (do necessary tagging) and -% later items \cs{@@_inter_item:} to -% cleanly close what's before, then call \cs{@@_item_instance:n} (which -% calls \cs{UseInstance}\{item\}\marg{instance}) to prepare the -% upcoming item: it will be actually inserted only once some later -% material triggers \tn{everypar}. +% \begin{environment}{center,flushleft,flushright} +% % \begin{macrocode} \AddToHook{begindocument/before}{ - \RenewDocumentCommand{\item}{ ={label}o } - { - \@inmatherr \item -% \end{macrocode} -% TODO: Check if test for being outside of a list is sensible -% \begin{macrocode} - \cs_if_free:NTF \@@_item_instance:n - { - \@latex@error{Lonely~\string\item--perhaps~a~missing~ - list~environment}\@ehc - } - { - \legacy_if:nTF { @newlist } - { - \__kernel_list_item_begin: -% \end{macrocode} -% The first item of a list also has to change the \texttt{@newlist} switch. -% \changes{v0.8q}{2024/09/02}{Set \texttt{@newlist} to false after -% the first \cs{item}} -% \begin{macrocode} - \legacy_if_gset_false:n { @newlist } - } - { \@@_inter_item: } + \RenewDocumentEnvironment{center} { !O{} } + { \UseInstance{blockenv}{center}{#1} } + { \endblockenv } % \end{macrocode} -% To avoid unnecessary key/val processing we make a quick check if -% there was an optional argument. +% % \begin{macrocode} - \tl_if_novalue:nTF {#1} % avoids reparsing label={} - { \@@_item_instance:n { } } - { \@@_item_instance:n {#1} } + \RenewDocumentEnvironment{flushright} { !O{} } + { \UseInstance{blockenv}{flushright}{#1} } + { \endblockenv } % \end{macrocode} -% Set the legacy switch that signals that we have a pending item label: +% % \begin{macrocode} - \legacy_if_gset_true:n { @inlabel } - \ignorespaces - } - } + \RenewDocumentEnvironment{flushleft} { !O{} } + { \UseInstance{blockenv}{flushleft}{#1} } + { \endblockenv } } % \end{macrocode} -% \end{macro} +% \end{environment} % % -% \begin{macro}{\@@_inter_item:} -% Between items. If the previous item had no content then we need to -% trigger \tn{everypar}. Otherwise we simply close the previous item -% with \tn{par} after removing some horizontal space. Between items, -% there is a penalty and some space. -% \begin{macrocode} -\cs_new_protected:Npn \@@_inter_item: { - \legacy_if:nT { @inlabel } - { \indent \par } % case of \item\item -% \end{macrocode} -% \cs{par} may have a strange definition and may not get us back to -% vertical mode in one go, so we better do not treat the next line -% as an else case to the above conditional (for now). -% \begin{macrocode} - \mode_if_horizontal:T { \@@_skip_remove_last: - \@@_skip_remove_last: \par } -% \end{macrocode} -% End any LI-tag, then start the next LI-tag (if doing tagging): -% \begin{macrocode} - \__kernel_list_item_end: - \__kernel_list_item_begin: -% \end{macrocode} % -% \begin{macrocode} - \addpenalty \@itempenalty - \addvspace \itemsep -} -% \end{macrocode} -% \end{macro} +% \subsection{Display quote environments} % % -% \begin{macro}{\__kernel_list_item_begin:, -% \__kernel_list_item_end:} +% \begin{environment}{quote,quotation} % % \begin{macrocode} -\cs_new_eq:NN \__kernel_list_item_begin: \prg_do_nothing: -\cs_new_eq:NN \__kernel_list_item_end: \prg_do_nothing: +\AddToHook{begindocument/before}{ + \RenewDocumentEnvironment{quote}{ !O{} } + { \UseInstance{blockenv}{quote} {#1} } + { \endblockenv } % \end{macrocode} -% \end{macro} -% -% +% +% \begin{macrocode} + \RenewDocumentEnvironment{quotation}{ !O{} } + { \UseInstance{blockenv}{quotation} {#1} } + { \endblockenv } +} +% \end{macrocode} +% \end{environment} % % % % % % -% \subsection{Tagging recipes} +% \subsection{Verbatim environments} % -% \begin{macro}{\@@_recipe_basic:} -% The \texttt{basic} recipe simply ensures that the block is inside -% a \texttt{text-unit} structure and if necessary starts one. When the -% block ends and is followed by a blank line the \texttt{text-unit} -% structure is closed too, otherwise it remains open and further -% text starts with just a \struct{text} structure. % -% There is otherwise no inner structure so -% \cs{__kernel_displayblock_begin:} and -% \cs{__kernel_displayblock_end:} do nothing---blockenvs with inner -% structure use the \texttt{standard} or \texttt{list} recipe instead. +% \begin{environment}{verbatim,verbatim*} +% % \begin{macrocode} -\cs_new:Npn \@@_recipe_basic: { - \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w - \@@_beginpar_hmode:N - \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: - \@@_beginpar_vmode: - \let \__kernel_displayblock_begin: \prg_do_nothing: - \let \__kernel_displayblock_end: \prg_do_nothing: +\AddToHook{begindocument/before}{ + \RenewDocumentEnvironment{verbatim}{ !O{} } + { \UseInstance{blockenv}{verbatim} {#1} % \end{macrocode} -% End environment \cs{par} handling: +% This is the part of the code where \env{verbatim} +% and\env{verbatim*} differ. % \begin{macrocode} - \socket_assign_plug:nn{tagsupport/block-endpe}{on} -} + \@setupverbinvisiblespace\frenchspacing\@vobeyspaces + \@xverbatim + } + { \endblockenv } % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_recipe_standalone:} % -% The \texttt{standalone} recipe produces a block that ensures that -% a previous \texttt{text-unit} ends and that after the block a new -% \texttt{text-unit} starts. % \begin{macrocode} -\cs_new:Npn \@@_recipe_standalone: { - \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w - \prg_do_nothing: - \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: - \prg_do_nothing: - \cs_set_eq:NN \__kernel_displayblock_begin: \@@_inner_begin: - \cs_set_eq:NN \__kernel_displayblock_end: \@@_inner_end: + \RenewDocumentEnvironment{verbatim*}{ !O{} } + { \UseInstance{blockenv}{verbatim} {#1} + \@setupverbvisiblespace\frenchspacing\@vobeyspaces + \@sxverbatim + } + { \endblockenv } +} % \end{macrocode} -% End environment \cs{par} handling: +% \end{environment} +% +% +% +% \subsubsection{Helper commands for verbatim} +% +% +% \begin{macro}{\legacyverbatimsetup} +% +% This code resembles the \LaTeXe{} verbatim implementation with a +% slight twist: in \LaTeXe{} each code line was a paragraph using +% \tn{leftskip}=\tn{@totalleftmargin}. This was possible because +% the whole environment was implemented as a trivlist. As this is +% no longer the case setting \tn{leftskip} would alter the layout +% of a surrounding list. So instead we need to make sure that the +% paragraph end is executed in a group so that any parshape setup +% is preserved. % \begin{macrocode} - \socket_assign_plug:nn{tagsupport/block-endpe}{off} +%<@@=> +\def\legacyverbatimsetup{% + \language\l@nohyphenation + \@tempswafalse + \def\par{% + \if@tempswa + \leavevmode \null {\@@par}\penalty\interlinepenalty + \else + \@tempswatrue + \ifhmode{\@@par}\penalty\interlinepenalty\fi + \fi}% + \let\do\@makeother \dospecials + \obeylines \verbatim@font \@noligs + \everypar \expandafter{\the\everypar \unpenalty}% % \end{macrocode} % % \begin{macrocode} - \tl_if_empty:NTF \l_@@_tag_name_tl - { \tl_set:Nn \l_@@_tag_inner_tag_tl {Sect} } - { \tl_set_eq:NN \l_@@_tag_inner_tag_tl \l_@@_tag_name_tl } + \tl_set:Nn \l__tag_para_main_tag_tl {codeline} + \tagtool{paratag=Code}% oder faster: \tl_set:Nn\l__tag_para_tag_tl{Code} } +%<@@=block> % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_recipe_standard:} -% The \texttt{standard} recipe does the following: -% \begin{itemize} -% \item surround the block with a \texttt{text-unit}-structure if not already in a -% a \texttt{text-unit}. In the latter case end the -% MC and the \struct{text} but leave the \texttt{text-unit} open. % -% If we are producing flattened paragraphs, just close any -% \struct{text} but do not open a \texttt{text-unit}. +% \begin{macro}{\@setupverbinvisiblespace} +% In the \pdfTeX{} engine we need to use \tn{pdffakespace} chars +% for the invisible spaces. +% \begin{macrocode} +\newcommand\@setupverbinvisiblespace{} +\tag_if_active:T { + \bool_if:NF\g__tag_mode_lua_bool + { + \renewcommand\@setupverbinvisiblespace + {\def\@xobeysp{\nobreakspace\pdffakespace}} + } +} +% \end{macrocode} +% \end{macro} % -% \item Then open an new (inner) structure (by default -% \texttt{Figure} but typically the one specified on the instance). -% \item At the end of the block close the inner structure -% (\texttt{Figure} or explicit one) -% but leave the \texttt{text-unit} open to be either continued or closed due to a -% following \cs{par}. -% \end{itemize} +% +% \subsection{Standard list environments} +% +% +% \begin{environment}{itemize,enumerate,description} +% +% For the standard lists everything is managed by the blockenv instance. % \begin{macrocode} -\cs_new:Npn \@@_recipe_standard: -{ - \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w - \@@_beginpar_hmode:N - \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: - \@@_beginpar_vmode: - \cs_set_eq:NN \__kernel_displayblock_begin: \@@_inner_begin: - \cs_set_eq:NN \__kernel_displayblock_end: \@@_inner_end: +\AddToHook{begindocument/before}{ + \RenewDocumentEnvironment{itemize}{!O{}} + { \UseInstance{blockenv}{itemize} {#1} } + { \endblockenv } % \end{macrocode} -% End environment \cs{par} handling: +% % \begin{macrocode} - \socket_assign_plug:nn{tagsupport/block-endpe}{on} + \RenewDocumentEnvironment{enumerate}{!O{}} + { \UseInstance{blockenv}{enumerate} {#1} } + { \endblockenv } % \end{macrocode} -% +% % \begin{macrocode} - \tl_if_empty:NTF \l_@@_tag_name_tl - { \tl_set:Nn \l_@@_tag_inner_tag_tl {Figure} } - { \tl_set_eq:NN \l_@@_tag_inner_tag_tl \l_@@_tag_name_tl } -} + \RenewDocumentEnvironment{description}{!O{}} + { \UseInstance{blockenv}{description} {#1} } + { \endblockenv } +} % \end{macrocode} -% \end{macro} +% \end{environment} % % +% \subsection{verse environment} % -% \begin{macro}{\l_@@_tag_inner_tag_tl} +% \begin{environment}{verse} +% The verse environment has not special tagging currently. It is +% defined as a simple standard list and takes the tagging from there. +% But it must be redefined so that \tn{itemindent} is correctly set. % \begin{macrocode} -\tl_new:N \l_@@_tag_inner_tag_tl +\AddToHook{begindocument/before}{ + \RenewDocumentEnvironment{verse}{ !O{} } + { + \let\\\@centercr + \UseInstance{blockenv}{list} + { + item-indent=-1.5em, + parindent=-1.5em, + item-skip=0pt, + rightmargin=\leftmargin, + leftmargin=\leftmargin+1.5em, + #1 + } + \item\relax + } + { \endblockenv } + } % \end{macrocode} -% \end{macro} +% \end{environment} % % +% \begin{environment}{list} % -% \begin{macro}{\@@_recipe_list:} -% The \texttt{list} recipe does the following. -% \begin{itemize} -% \item It opens a \struct{text-unit}-structure or keeps the current one open (only -% closing the MC). -% \item It then starts a new structure rolemapped to L-structure -% and arranges for handling list items, e.g., Li, Lbl and LBody -% structures. -% \item At the end it closes open list structures as needed but -% keeps the \struct{text-unit}-structure open to continue the paragraph after the -% list, if necessary. -% \end{itemize} -% \begin{macrocode} -\cs_new:Npn \@@_recipe_list: -{ - \cs_set_eq:NN \__kernel_displayblock_beginpar_hmode:w - \@@_beginpar_hmode:N - \cs_set_eq:NN \__kernel_displayblock_beginpar_vmode: - \@@_beginpar_vmode: - \cs_set_eq:NN \__kernel_displayblock_begin: \@@_list_begin: - \cs_set_eq:NN \__kernel_displayblock_end: \@@_list_end: -% \end{macrocode} -% The next two lines could be done globally, because they are only -% called if we do have \cs{item}s, i.e., if we are in a list. It is -% therefore also not necessary to reset them in other recipes -% (right now---this may change if we get more templates (like -% inline lists)). +% The legacy 2e list environment is more complicated as we have to get the +% extra arguments accounted for. % \begin{macrocode} - \cs_set_eq:NN \__kernel_list_item_begin: \@@_list_item_begin: - \cs_set_eq:NN \__kernel_list_item_end: \@@_list_item_end: +\AddToHook{begindocument/before}{ + \RenewDocumentEnvironment{list}{O{} m m } + { % \end{macrocode} -% End environment \cs{par} handling: +% We do this by storing them away and then call the list +% instance. Inside this instance the \key{setup-code} key +% contains \tn{legacylistsetupcode}, which makes use of the stored values. +% \changes{v0.8v}{2024/10/11}{Update \tn{@itemlabel} in +% \cs{l_@@_legacy_env_params_tl} and not at the start of the +% environment (tagging/730)} % \begin{macrocode} - \socket_assign_plug:nn{tagsupport/block-endpe}{on} + \tl_set:Nn \l_@@_legacy_env_params_tl + { + \tl_set:Nn \@itemlabel {#2} + #3 + } % \end{macrocode} % -% Handle the tag name and attribute classes using the key values -% from the current list instance. % \begin{macrocode} - \tl_if_empty:NTF \l_@@_tag_name_tl - { \tl_set:Nn \l__tag_L_tag_tl {L} } - { \tl_set_eq:NN \l__tag_L_tag_tl \l_@@_tag_name_tl } - \tl_if_empty:NTF \l_@@_tag_class_tl - { \tl_set:Nn \l__tag_L_attr_class_tl {} } - { \tl_set_eq:NN \l__tag_L_attr_class_tl \l_@@_tag_class_tl } + \UseInstance{blockenv}{list} {#1} + } + { \endblockenv } } % \end{macrocode} -% \end{macro} - - - -% \subsection{Blockenv instances} % +% \end{environment} % -% \subsubsection{Basic instances} % -% \begin{instance}{blockenv displayblock} +% +% \begin{macro}{\legacylistsetupcode} % +% And here is the extra code for use in the list instance setup +% inside the key \key{setup-code}. % \begin{macrocode} -\DeclareInstance{blockenv}{displayblock}{display} -{ - env-name = displayblock, - tag-name = , - tag-class = , - tagging-recipe = standard, - inner-level-counter = , - level-increase = false, - setup-code = , - block-instance = displayblock , - inner-instance = , -} +\cs_new:Npn \legacylistsetupcode { % \end{macrocode} -% \end{instance} -% -% -% -% \begin{instance}{blockenv displayblockflattened} -% +% Reset values to defaults: % \begin{macrocode} -\DeclareInstance{blockenv}{displayblockflattened}{display} -{ - env-name = displayblockflattened, - tag-name = , - tag-class = , - tagging-recipe = basic, - inner-level-counter = , - level-increase = false, - setup-code = , - block-instance = displayblock , - para-flattened = true , - inner-instance = , -} + \dim_zero:N \listparindent + \dim_zero:N \rightmargin + \dim_zero:N \itemindent % \end{macrocode} -% \end{instance} -% -% -% -% \begin{instance}{blockenv center} % +% By default a \env{list} environment is not numbered, but this +% happens already in the block template. +% \changes{v0.8v}{2024/10/11}{Set the defaults for \tn{@itemlabel}, +% \tn{@listctr} and \texttt{@nmbrlist} early in the block code +% before the setup code gets executed (tagging/730)} % \begin{macrocode} -\DeclareInstance{blockenv}{center}{display} -{ - env-name = center, - tag-name = , - tag-class = , - tagging-recipe = basic, - inner-level-counter = , - level-increase = false, - setup-code = , - block-instance = displayblock , - para-flattened = true , - para-instance = center , - inner-instance = , +% \tl_set:Nn \@listctr {} +% \legacy_if_set_false:n { @nmbrlist } % needed if lists are nested +% \end{macrocode} +% By default there is a simple definition for \tn{makelabel}. It can be +% overwritten in the second mandatory argument to the list +% environment (stored in \cs{l_@@_legacy_env_params_tl}) and +% is used if the instance sets the compatibility key to true. +% \begin{macrocode} + \let\makelabel\@mklab % TODO: customize +% \end{macrocode} +% Now we use the argument with parameter settings to update some or +% all of the above defaults: +% \begin{macrocode} + \l_@@_legacy_env_params_tl +% \end{macrocode} +% As we don't know much about this list we can only make a guess about +% the nature of the list and the setting of the tag name (default +% \keyvalue{list} rolemapped to \struct{L}) and any tag attributes +% may have to be overwritten in the optional key/value argument. +% But we do have some hints to play with. +% \begin{macrocode} + \legacy_if:nTF { @nmbrlist } + { \tl_set:Nn \l__tag_L_attr_class_tl {enumerate} } % numbered list + { \tl_if_empty:NTF \@itemlabel + { \tl_set:Nn \l__tag_L_attr_class_tl {list} } % no label + { \tl_set:Nn \l__tag_L_attr_class_tl {itemize} } % unnumbered, + % unordered + } } % \end{macrocode} -% \end{instance} +% \end{macro} % % -% \begin{instance}{blockenv flushleft} +% \begin{macro}{\l_@@_legacy_env_params_tl} % % \begin{macrocode} -\DeclareInstance{blockenv}{flushleft}{display} -{ - env-name = flushleft, - tag-name = , - tag-class = , - tagging-recipe = basic, - inner-level-counter = , - level-increase = false, - setup-code = , - block-instance = displayblock , - para-flattened = true , - para-instance = raggedright , - inner-instance = , -} +\tl_new:N\l_@@_legacy_env_params_tl % \end{macrocode} -% \end{instance} +% \end{macro} % % % -% \begin{instance}{blockenv flushright} -% +% \begin{environment}{trivlist} +% \fmi{Replace with code not using \tn{list}} % \begin{macrocode} -\DeclareInstance{blockenv}{flushright}{display} -{ - env-name = flushleft, - tag-name = , - tag-class = , - tagging-recipe = basic, - inner-level-counter = , - level-increase = false, - setup-code = , - block-instance = displayblock , - para-flattened = true , - para-instance = raggedleft , - inner-instance = , +\AddToHook{begindocument/before}{ + \RenewDocumentEnvironment{trivlist}{ !O{} } + { \list[#1]{} + { + \dim_zero:N \leftmargin + \dim_zero:N \labelwidth + \cs_set_eq:NN \makelabel \use:n + } + } + { \endblockenv } } % \end{macrocode} -% \end{instance} +% \end{environment} % % +% \subsection{Theorem-like environments} % -% \subsubsection{Blockquote instances} +% Theorem-like environments are defined in \LaTeX{} with the help of +% \tn{newtheorem} declarations. Internally they used a list with a +% single item. Using lists was convenient back then, but in a tagged +% document you end up with a strange structure. We therefore alter the +% mechanism. % -% \begin{instance}{blockenv quotation} - % +% +% \begin{macro}{\newtheorem} +% This is a slightly streamlined version of \tn{newtheorem}, but it +% still uses a lot of the 2e code for now. Eventually this will change. % \begin{macrocode} -\DeclareInstance{blockenv}{quotation}{display} +\RenewDocumentCommand \newtheorem { m O{#1} m o } { - env-name = quotation, - tag-name = quotation, - tag-class = , - tagging-recipe = standard, - inner-level-counter = , - level-increase = true, - setup-code = , - block-instance = quotationblock , - inner-instance = , + \expandafter\@ifdefinable\csname #1\endcsname + { + \str_if_eq:nnTF{#1}{#2} + { + \@definecounter {#2} + \IfNoValueTF {#4} + { % @ynthm + \tl_gset:ce { the #2 } + { + \@thmcounter{#2} + } + } + { % @xnthm + \@newctr{#1}[#4] + \tl_gset:ce { the #2 } + { + \expandafter\noexpand\csname the#4\endcsname + \@thmcountersep + \@thmcounter{#2} + } + } + } + { % @othm + \@ifundefined{c@#2} + { \@nocounterr{#2} } + { + \tl_gset:cn { the #1 } + { \UseName { the #2 } } + } + } + \global\@namedef{#1} { \@thm{#2}{#3} } + \global\@namedef{end#1}{ \@endtheorem } + } } % \end{macrocode} -% \end{instance} -% -% -% -% \begin{instance}{blockenv quote} -% +% \end{macro} +% +% \begin{macro}{\@thm} +% \tn{@thm} executes \tn{refstepcounter} too early for hyperref +% and structure destinations: the generated target is outside the structure +% and can be separated from the theorem by a page break. We therefore move +% the anchor setting into \tn{@begintheorem}. \tn{@begintheorem} doesn't +% currently get the name of the counter as argument, so we store it in variable +% for now, to be able to pass it along. +% \begin{macrocode} +\tl_new:N \l_@@_thm_current_counter_tl +\def\@thm#1#2{% + \@kernel@refstepcounter{#1} + \tl_set:Nn \l_@@_thm_current_counter_tl{#1} + \@ifnextchar[{\@ythm{#1}{#2}}{\@xthm{#1}{#2}}} +% \end{macrocode} +% To avoid that hyperref overwrites the definition again we must its patch: % \begin{macrocode} -\DeclareInstance{blockenv}{quote}{display} -{ - env-name = quote, - tag-name = quote, - tag-class = , - tagging-recipe = standard, - inner-level-counter = , - level-increase = true, - setup-code = , - block-instance = quoteblock , - inner-instance = , -} +\def\hyper@nopatch@thm{} % \end{macrocode} -% \end{instance} +% \end{macro} +% +% \begin{macro}{\@begintheorem,\@opargbegintheorem} % -% An alternative setup for quotations, using the displayblock instance and -% just overwrite a bit in the setup code.\fmi{I guess the setup -% code is still executed too early, have to check.} -% This would be less flexible but would ensure visual consistency, -% because the displayblock settings are used throughout. -% \begin{macrocode} -% \DeclareInstance{blockenv}{quotation}{display} -% { -% env-name = quotation, -% tag-name = , -% tag-class = , -% tagging-recipe = blockquote, -% inner-level-counter = , -% level-increase = true, -% setup-code = \setlength\rightmargin{\leftmargin} -% \setlength\parsep{1.5em} , -% block-instance = displayblock , -% inner-instance = , -% } +% The \tn{@thm} command expands to either \tn{@beginthorem} or +% \tn{@opargbegintheorem}. For the moment we stick with this as it +% will help with the transition. But instead of using a +% \env{trivlist} we use a blockenv and some tagging for the title +% (as a Caption). +% We do not want potential tagging from \tn{textbf} here, +% so we use \tn{bfseries} to set the font. The commands set also the link targets +% which should be inside the main structure. +% \begin{macrocode} +\def\@begintheorem#1#2{ + \UseInstance{blockenv}{theorem}{} + \tagpdfparaOff % \end{macrocode} % +% \changes{v0.8w}{2024/11/23}{\LaTeXe{} theorems always start out +% without indentation (tagging/767)} % \begin{macrocode} -% \DeclareInstance{blockenv}{quote}{display} -% { -% env-name = quote, -% tag-name = , -% tag-class = , -% tagging-recipe = blockquote, -% inner-level-counter = , -% level-increase = true, -% setup-code = \setlength\rightmargin{\leftmargin} , -% block-instance = displayblock , -% inner-instance = , -% } + \noindent + \MakeLinkTarget{\l_@@_thm_current_counter_tl} + \tag_struct_begin:n{tag=Caption} + \group_begin: + \bfseries + \tag_mc_begin:n {} + #1\ + \tag_mc_end: + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n {} + #2 + \tag_mc_end: + \tag_struct_end: + \group_end: + \tag_struct_end: + \tagpdfparaOn % \end{macrocode} -% - % % \begin{macrocode} -\DeclareInstance{blockenv}{theorem}{display} -{ - env-name = theorem-like, - tag-name = theorem-like, - tag-class = , - tagging-recipe = standalone, - inner-level-counter = , - level-increase = false, - setup-code = , - block-instance = displayblock , -% inner-instance-type = innerblock , -% inner-instance = theorem, -} + \@@_start_para_structure_unconditionally:n { \PARALABEL } % \end{macrocode} -% -% We use \struct{theorem-like} as the structure name and rolemap it -% to a \struct{Sect} because that can hold a \struct{Caption}. -% -% \subsubsection{Verbatim instances} -% -% \begin{instance}{blockenv verbatim} % -% The rolemapping is current verbatim to P and codeline to Sub (which is role mapped -% to Span in pdf 1.7. Alternatives for PDF 1.7: Div and P. -% % \begin{macrocode} -\DeclareInstance{blockenv}{verbatim}{display} -{ - env-name = verbatim, - tag-name = verbatim, - tag-class = , - tagging-recipe = standard, - inner-level-counter = , - level-increase = false, - setup-code = , - block-instance = verbatimblock , - inner-instance = , - final-code = \legacyverbatimsetup , - para-instance = justify + \itshape + \hskip\labelsep + \ignorespaces } +\def\@opargbegintheorem#1#2#3{ + \UseInstance{blockenv}{theorem}{} + \tagpdfparaOff % \end{macrocode} -% \end{instance} -% -% -% \subsubsection{Standard list instances} -% -% \begin{instance}{blockenv itemize} % +% \changes{v0.8w}{2024/11/23}{\LaTeXe{} theorems always start out +% without indentation (tagging/767)} % \begin{macrocode} -\DeclareInstance{blockenv}{itemize}{display} -{ - env-name = itemize, - tag-name = itemize, - tag-class = itemize, - tagging-recipe = list, - inner-level-counter = \@itemdepth, - level-increase = true, - max-inner-levels = 4, - setup-code = , - block-instance = list , - inner-instance = itemize , -} + \noindent + \MakeLinkTarget{\l_@@_thm_current_counter_tl} + \tag_struct_begin:n{tag=Caption} + \group_begin: + \bfseries + \tag_mc_begin:n {} + #1\ + \tag_mc_end: + \tag_struct_begin:n{tag=Lbl} + \tag_mc_begin:n {} + #2 + \tag_mc_end: + \tag_struct_end: + \tag_mc_begin:n {} + \ (#3) + \tag_mc_end: + \group_end: + \tag_struct_end: + \tagpdfparaOn % \end{macrocode} -% \end{instance} -% -% -% \begin{instance}{blockenv enumerate} % % \begin{macrocode} -\DeclareInstance{blockenv}{enumerate}{display} -{ - env-name = enumerate, - tag-name = enumerate, - tag-class = enumerate, - tagging-recipe = list, - level-increase = true, - setup-code = , - block-instance = list , - inner-level-counter = \@enumdepth, - max-inner-levels = 4, - inner-instance = enum , -} + \@@_start_para_structure_unconditionally:n { \PARALABEL } % \end{macrocode} -% \end{instance} -% -% -% \begin{instance}{blockenv description} % % \begin{macrocode} - -\DeclareInstance{blockenv}{description}{display} -{ - env-name = description, - tag-name = description, - tag-class = description, - tagging-recipe = list, - inner-level-counter = , - level-increase = true, - setup-code = , - block-instance = list , - inner-instance = description , + \itshape + \hskip\labelsep + \ignorespaces } % \end{macrocode} -% \end{instance} -% -% -% \begin{instance}{blockenv list} -% The general (legacy) \env{list} environment does some of its -% setup in the \texttt{setup-code} key. +% % \begin{macrocode} -\DeclareInstance{blockenv}{list}{display} -{ - env-name = list, - tag-name = list, - tag-class = , - tagging-recipe = list, - level-increase = true, - setup-code = \legacylistsetupcode , - block-instance = list , - inner-level-counter = , - inner-instance = legacy , -} +\def\@endtheorem{\endblockenv} % \end{macrocode} -% \end{instance} +% \end{macro} % % % +% \section{Instance declarations for environments} % -% \subsection{Block instances} +% \subsection{Blockenv instances} % -% \subsubsection{Displayblock instances} -% -% We provide 6 nesting levels (as in \LaTeXe{}). If you want to -% provide more you need to change the \texttt{maxblocklevels} -% counter, offer further \texttt{displayblock-xx} instances but -% also define further (legacy) \cs{list\meta{romannumeral}} commands -% for the defaults. If not, then the settings from the previous -% level are reused automatically---which may or may not be good enough). -% \begin{macrocode} -\setcounter{maxblocklevels}{6} -% \end{macrocode} +% The blockenv instances handle overall setup for the document-level +% environments, i.e., +% \begin{itemize} +% \raggedright +% \item name of the environment for debugging purposes (\key{env-name}) +% \item how tagging should be performed (\key{tagging-recipe}, +% \key{tag-name}, \key{tag-class}) +% \item does this environment changes the block level if nested +% (\key{level-increase}) +% \item any special setup code; normally not used (\key{setup-code}) +% \item what kind of block instance should be used (\key{block-instance}) +% \item what kind of para instance should be used; empty means +% inherit from the outside (\key{para-instance}) +% \item are inner paragraphs real paragraphs (default) or are they +% just \struct{text} structures and part of an outer +% paragraph (\key{para-flattened}) +% \item what kind of inner instance should be used, if any +% (\key{inner-instance}, \key{inner-instance-type}) +% \item the counter name of the inner level, if any (\key{inner-level-counter}) +% \item supported nesting depth of the inner level, if relevant +% (\key{max-inner-levels}) +% \item extra code executed at the end, by default \tn{ignorespaces} +% (\key{final-code}) +% \end{itemize} +% The blockenv displayblock instance below shows the full set with +% those using default values being commented out. % -% \begin{instance}{block displayblock-0, -% block displayblock-1, -% block displayblock-2, -% block displayblock-3, -% block displayblock-4, -% block displayblock-5, -% block displayblock-6 } +% \subsubsection{Basic instances} % -% Here we need level zero as well in case a flattened displayblock -% (like the center env) it is used on top-level. -% \begin{macrocode} -\DeclareInstance{block}{displayblock-0}{display} - { - leftmargin = 0pt , - parindent = 0pt , - } -% \end{macrocode} % +% \begin{instance}{blockenv displayblock} +% This is like \LaTeXe{}'s \env{trivlist}, i.e., it produces a +% vertical block with default setting, but doesn't put a list +% inside but uses a \struct{Figure} structure. +% \fmi{should this really generate a /Figure structure?} % \begin{macrocode} -\DeclareInstanceCopy{block}{displayblock-1}{displayblock-0} -\DeclareInstanceCopy{block}{displayblock-2}{displayblock-0} -\DeclareInstanceCopy{block}{displayblock-3}{displayblock-0} -\DeclareInstanceCopy{block}{displayblock-4}{displayblock-0} -\DeclareInstanceCopy{block}{displayblock-5}{displayblock-0} -\DeclareInstanceCopy{block}{displayblock-6}{displayblock-0} +\DeclareInstance{blockenv}{displayblock}{display} +{ + env-name = displayblock, +% tagging-recipe = standard, +% tag-name = , +% tag-class = , + level-increase = false, +% setup-code = , +% block-instance = displayblock , +% para-instance = , +% para-flattened = false , +% inner-instance = , +% inner-instance-type = list , % not relevant as there is no inner instance +% inner-level-counter = , % not relevant as there is no inner instance +% max-inner-levels = 4, % not relevant as there is no inner instance +% final-code = \ignorespaces , +} % \end{macrocode} % \end{instance} % % % -% \subsubsection{Verbatim instances} -% -% Verbatim instances have there own levels so that one can specify -% specific indentations or vertical separations between line. -% -% \begin{instance}{block verbatimblock-0, -% block verbatimblock-1, -% block verbatimblock-2, -% block verbatimblock-3, -% block verbatimblock-4, -% block verbatimblock-5, -% block verbatimblock-6 } -% -% \begin{macrocode} -\DeclareInstance{block}{verbatimblock-0}{display} - { - leftmargin = 0pt , - parindent = 0pt , - par-skip = 0pt , - } -% \end{macrocode} -% -% \begin{macrocode} -\DeclareInstanceCopy{block}{verbatimblock-1}{verbatimblock-0} -\DeclareInstanceCopy{block}{verbatimblock-2}{verbatimblock-0} -\DeclareInstanceCopy{block}{verbatimblock-3}{verbatimblock-0} -\DeclareInstanceCopy{block}{verbatimblock-4}{verbatimblock-0} -\DeclareInstanceCopy{block}{verbatimblock-5}{verbatimblock-0} -\DeclareInstanceCopy{block}{verbatimblock-6}{verbatimblock-0} +% +% \begin{instance}{blockenv displayblockflattened} +% This flattens inner paragraphs without any surrounding tag +% structure by using the \keyvalue{basic} tagging recipe. +% \begin{macrocode} +\DeclareInstance{blockenv}{displayblockflattened}{display} +{ + env-name = displayblockflattened, + tag-name = , + tag-class = , + tagging-recipe = basic, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = displayblock , + para-flattened = true , + inner-instance = , +} % \end{macrocode} % \end{instance} % % % % -% \subsubsection{Quote/quotationblock instances} % -% Quote and quotation are not flattened, i.e., they change levels, -% thus they start with level 1 not 0. -% -% \begin{instance}{block quoteblock-1, -% block quoteblock-2, -% block quoteblock-3, -% block quoteblock-4, -% block quoteblock-5, -% block quoteblock-6 } -% Default layout is to indent equally from both sides. -% \begin{macrocode} -\DeclareInstance{block}{quoteblock-1}{display} - { rightmargin = \KeyValue{leftmargin} } -% \end{macrocode} +% \subsubsection{Center, flushleft, and flushright instances} +% +% All three environments use the \texttt{displayblock} instance as +% block instance. They only differ in the choice of para instance. % +% \begin{instance}{blockenv center} +% The \env{center} environment without using a list internally. % \begin{macrocode} -\DeclareInstanceCopy{block}{quoteblock-2}{quoteblock-1} -\DeclareInstanceCopy{block}{quoteblock-3}{quoteblock-1} -\DeclareInstanceCopy{block}{quoteblock-4}{quoteblock-1} -\DeclareInstanceCopy{block}{quoteblock-5}{quoteblock-1} -\DeclareInstanceCopy{block}{quoteblock-6}{quoteblock-1} +\DeclareInstance{blockenv}{center}{display} +{ + env-name = center, + tag-name = , + tag-class = , + tagging-recipe = basic, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = displayblock , + para-flattened = true , + para-instance = center , + inner-instance = , +} % \end{macrocode} % \end{instance} -% % -% -% \begin{instance}{block quotationblock-1, -% block quotationblock-2, -% block quotationblock-3, -% block quotationblock-4, -% block quotationblock-5, -% block quotationblock-6 } -% Quotation additionally changes the parindent. -% \begin{macrocode} -\DeclareInstance{block}{quotationblock-1}{display} - { parindent = 1.5em , rightmargin = \KeyValue{leftmargin} } -% \end{macrocode} % +% \begin{instance}{blockenv flushleft} +% The \env{flushleft} environment without using a list internally. % \begin{macrocode} -\DeclareInstanceCopy{block}{quotationblock-2}{quotationblock-1} -\DeclareInstanceCopy{block}{quotationblock-3}{quotationblock-1} -\DeclareInstanceCopy{block}{quotationblock-4}{quotationblock-1} -\DeclareInstanceCopy{block}{quotationblock-5}{quotationblock-1} -\DeclareInstanceCopy{block}{quotationblock-6}{quotationblock-1} +\DeclareInstance{blockenv}{flushleft}{display} +{ + env-name = flushleft, + tag-name = , + tag-class = , + tagging-recipe = basic, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = displayblock , + para-flattened = true , + para-instance = raggedright , + inner-instance = , +} % \end{macrocode} % \end{instance} -% % -% \subsubsection{Block instances for the standard lists} % -% \begin{instance}{block list-1, -% block list-2, -% block list-3, -% block list-4, -% block list-5, -% block list-6 } -% The block instances for the various list environments use the -% same underlying instance (well by default) and nothing -% needs to be set up specifically (because that is already done in -% the legacy \cs{list\meta{romannumeral}} unless a -% different layout is wanted. +% +% \begin{instance}{blockenv flushright} +% +% The \env{flushright} environment without using a list internally. % \begin{macrocode} -\DeclareInstance{block}{list-1}{display}{ -% heading = , -% beginsep = \topsep , -% begin-par-skip = \partopsep , -% par-skip = \parsep , -% end-skip = \KeyValue{beginsep} , -% end-par-skip = \KeyValue{begin-par-skip} , -% beginpenalty = \UseName{@beginparpenalty} , -% endpenalty = \UseName{@endparpenalty} , -% leftmargin = \leftmargin , -% rightmargin = \rightmargin , -% parindent = \listparindent , +\DeclareInstance{blockenv}{flushright}{display} +{ + env-name = flushleft, + tag-name = , + tag-class = , + tagging-recipe = basic, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = displayblock , + para-flattened = true , + para-instance = raggedleft , + inner-instance = , } -\DeclareInstance{block}{list-2}{display}{} -\DeclareInstance{block}{list-3}{display}{} -\DeclareInstance{block}{list-4}{display}{} -\DeclareInstance{block}{list-5}{display}{} -\DeclareInstance{block}{list-6}{display}{} % \end{macrocode} % \end{instance} -% % -% -% \subsection{List instances for the standard lists} % -% For all list instances we have to say what kind of label we want -% (\texttt{label-instance}) and how it should be formatted. % -% \begin{instance}{list itemize-1, -% list itemize-2, -% list itemize-3, -% list itemize-4} -% For \env{itemize} environments this is all we need to do and we -% refer back to the external definitions rather than defining the -% \texttt{item-label} code in the instance to ensure that old -% documents still work. % +% \subsubsection{Blockquote instances} +% + +% \LaTeXe{} has two environments for quoting: \env{quote} and +% \env{quoation}. By default they differ only in indentation of inner +% paragraphs. This is handled by using separate block instances. +% +% The tag names are both roll-mapped to \struct{BlockQuote}. +% +% \begin{instance}{blockenv quotation} +% For the \env{quotation} environment: % \begin{macrocode} -\DeclareInstance{list}{itemize-1}{std}{ item-label = \labelitemi } -\DeclareInstance{list}{itemize-2}{std}{ item-label = \labelitemii } -\DeclareInstance{list}{itemize-3}{std}{ item-label = \labelitemiii } -\DeclareInstance{list}{itemize-4}{std}{ item-label = \labelitemiv } -% \end{macrocode} -% \end{instance} -% -% -% -% \begin{instance}{list enumerate-1, -% list enumerate-2, -% list enumerate-3, -% list enumerate-4} -% \env{enumerate} environments are similar, except that we also -% have to say which counter to use on every level. -% \begin{macrocode} -\DeclareInstance{list}{enum-1}{std} - { item-label = \labelenumi , counter = enumi } -\DeclareInstance{list}{enum-2}{std} - { item-label = \labelenumii , counter = enumii } -\DeclareInstance{list}{enum-3}{std} - { item-label = \labelenumiii , counter = enumiii } -\DeclareInstance{list}{enum-4}{std} - { item-label = \labelenumiv , counter = enumiv } +\DeclareInstance{blockenv}{quotation}{display} +{ + env-name = quotation, + tag-name = quotation, + tag-class = , + tagging-recipe = standard, + inner-level-counter = , + level-increase = true, + setup-code = , + block-instance = quotationblock , + inner-instance = , +} % \end{macrocode} % \end{instance} -% -% % -% \begin{instance}{list legacy} -% For the legacy \env{list} environment there is only one instance -% which is reused on all levels. This is done this way one because -% the legacy \env{list} environment sets all its -% parameters through its arguments. So this instances shouldn't -% really be touched. It sets the \texttt{legacy-support} key to -% true, which means that the list code uses \cs{makelabel} for -% formatting the label +% +% +% \begin{instance}{blockenv quote} +% For the \env{quote} environment: % \begin{macrocode} -\DeclareInstance{list}{legacy}{std} { - item-instance = basic , - legacy-support = true , +\DeclareInstance{blockenv}{quote}{display} +{ + env-name = quote, + tag-name = quote, + tag-class = , + tagging-recipe = standard, + inner-level-counter = , + level-increase = true, + setup-code = , + block-instance = quoteblock , + inner-instance = , } % \end{macrocode} % \end{instance} -% % -% \begin{instance}{list description} -% The \env{description} lists also use only a single list instance -% with only one key not using the default: +% +% +% \subsubsection{The theorem instance} +% +% \begin{instance}{blockenv theorem} +% +% We use \struct{theorem-like} as the structure name and rolemap it +% to a \struct{Sect} because that can hold a \struct{Caption}. +% +% +% \changes{v0.8w}{2024/11/23}{Theorems use their own block-instance +% and not displayblock to allow for customization (tagging/767)} % \begin{macrocode} -\DeclareInstance{list}{description}{std} { item-instance = description } +\DeclareInstance{blockenv}{theorem}{display} +{ + env-name = theorem-like, + tag-name = theorem-like, + tag-class = , + tagging-recipe = standalone, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = theoremblock , +} % \end{macrocode} % \end{instance} % -% -% \subsection{Item instances} % % -% \begin{instance}{item basic, item description} -% There two item instances set up: \texttt{description} for use -% with the \env{description} environment and \texttt{basic} for use -% with all other lists (up to now). -% \begin{macrocode} -\DeclareInstance{item}{basic}{std} - { - label-align = right , - } -% \end{macrocode} +% \subsubsection{The verbatim instance} +% +% \begin{instance}{blockenv verbatim} +% +% The rolemapping is currently \struct{verbatim} to \struct{P} and +% \struct{codeline} to \struct{Sub} (which is role mapped +% to \struct{Span} in pdf 1.7. Alternatives for PDF 1.7: \struct{Div} and \struct{P}. % % \begin{macrocode} -\DeclareInstance{item}{description}{std} - { - label-format = \normalfont\bfseries #1 , - label-align = left - } +\DeclareInstance{blockenv}{verbatim}{display} +{ + env-name = verbatim, + tag-name = verbatim, + tag-class = , + tagging-recipe = standard, + inner-level-counter = , + level-increase = false, + setup-code = , + block-instance = verbatimblock , + inner-instance = , + final-code = \legacyverbatimsetup , + para-instance = justify +} % \end{macrocode} % \end{instance} % % +% \subsubsection{Standard list instances} % -% \subsection{Para instances} -% +% \begin{instance}{blockenv itemize} +% For the \env{itemize} environment: % \begin{macrocode} -\tag_if_active:T +\DeclareInstance{blockenv}{itemize}{display} { - \tagpdfsetup - { - 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}, - } + env-name = itemize, + tag-name = itemize, + tag-class = itemize, + tagging-recipe = list, + inner-level-counter = \@itemdepth, + level-increase = true, + max-inner-levels = 4, + setup-code = , + block-instance = list , + inner-instance = itemize , } % \end{macrocode} +% \end{instance} % -% \begin{instance}{para center} -% \begin{macrocode} -\DeclareInstance{para}{center}{std} -{ - indent-width = 0pt , - start-skip = 0pt , - left-skip = \@flushglue , - right-skip = \@flushglue , - end-skip = \z@skip , - final-hyphen-demerits = 0 , - cr-cmd = \@centercr , - para-class = center , -} -% \end{macrocode} % +% \begin{instance}{blockenv enumerate} +% +% For the \env{enumerate} environment: % \begin{macrocode} -\DeclareInstance{para}{raggedright}{std} +\DeclareInstance{blockenv}{enumerate}{display} { - indent-width = 0pt , - start-skip = 0pt , - left-skip = \z@skip , - right-skip = \@flushglue , - end-skip = \z@skip , - final-hyphen-demerits = 0 , - cr-cmd = \@centercr , - para-class = raggedright , + env-name = enumerate, + tag-name = enumerate, + tag-class = enumerate, + tagging-recipe = list, + level-increase = true, + setup-code = , + block-instance = list , + inner-level-counter = \@enumdepth, + max-inner-levels = 4, + inner-instance = enum , } % \end{macrocode} +% \end{instance} % -% \begin{macrocode} -\DeclareInstance{para}{raggedleft}{std} -{ - indent-width = 0pt , - start-skip = 0pt , - left-skip = \@flushglue , - right-skip = \z@skip , - end-skip = \z@skip , - final-hyphen-demerits = 0 , - cr-cmd = \@centercr , - para-class = raggedleft , -} -% \end{macrocode} % +% \begin{instance}{blockenv description} +% +% For the \env{description} environment: % \begin{macrocode} -\DeclareInstance{para}{justify}{std} + +\DeclareInstance{blockenv}{description}{display} { -% indent-width = 0pt , - start-skip = 0pt , - left-skip = \z@skip , - right-skip = \z@skip , - end-skip = \@flushglue , - final-hyphen-demerits = 5000 , - cr-cmd = \@normalcr , - para-class = justify , + env-name = description, + tag-name = description, + tag-class = description, + tagging-recipe = list, + inner-level-counter = , + level-increase = true, + setup-code = , + block-instance = list , + inner-instance = description , } % \end{macrocode} % \end{instance} % % -% -% +% \begin{instance}{blockenv list} +% The general (legacy) \env{list} environment does some of its +% setup in the \key{setup-code} key. % \begin{macrocode} -\DeclareRobustCommand\centering {\UseInstance{para}{center}{}} -\DeclareRobustCommand\raggedleft {\UseInstance{para}{raggedleft}{}} -\DeclareRobustCommand\raggedright{\UseInstance{para}{raggedright}{}} -\DeclareRobustCommand\justifying {\UseInstance{para}{justify}{}} - -\justifying +\DeclareInstance{blockenv}{list}{display} +{ + env-name = list, + tag-name = list, + tag-class = , + tagging-recipe = list, + level-increase = true, + setup-code = \legacylistsetupcode , + block-instance = list , + inner-level-counter = , + inner-instance = legacy , +} % \end{macrocode} +% \end{instance} % % % % +% \subsection{Block instances} % -% \subsection{Tagging support} -% -% In this section we provide code to the various kernel hooks to support -% the tagging of the different displayblock environments. -% -% All of the following definitions should only be made if tagging -% is active! -% \begin{macrocode} -\tag_if_active:TF { -% \end{macrocode} -% -% \begin{macro}{\@@_beginpar_vmode:} -% When a block starts out in vertical mode, i.e., is not yet part of -% a paragraph, we have to start a paragraph -% structure. However, this is not the case if we are already -% flattening paragraphs, thus in this case we do nothing. -% We also do nothing if \texttt{@endpe} is currently true, because -% that means we are right now just after the end of a -% \texttt{blockenv} and in the process of looking if we have to end -% the current \texttt{text-unit}, i.e., it is already open. -% \begin{macrocode} - \cs_set:Npn \@@_beginpar_vmode: { - \@@_debug_typeout:n - { @endpe = \legacy_if:nTF { @endpe }{true}{false} - \on@line } - \legacy_if:nTF { @endpe } - { - \legacy_if_gset_false:n { @endpe } - } -% \end{macrocode} -% We test for \texttt{<2} because the first flattened environment -% has to surround itself with a \texttt{text-unit}. Only any inner ones -% then have to avoid adding another \texttt{text-unit}. -% \begin{macrocode} - { - \int_compare:nNnT \l__tag_block_flattened_level_int < 2 - { - \__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: - } - } - } -% \end{macrocode} -% \end{macro} +% Below, we declare the different block instances for the +% document-level environments. Some, such as the displayblock ones +% are shared between different environments (as long as one doesn't +% need to adjust individual values), other environments have their +% own instances (for precisely that reason). % -% \begin{macro}{\@@_beginpar_hmode:N} -% If the block is already part of a part of a paragraph, i.e., when it has -% some text directly in front, then the first thing to -% do is to return to vertical mode. However, that should be done -% without inserting a paragraph end tag, so before calling \cs{par} -% to do its normal work, we disable paragraph tagging and -% restarting afterwards again. The argument to this config point -% simply gobbles the \cs{par} following it in the code above (which -% is used when there is no tagging going on. +% \subsubsection{Displayblock instances} +% +% We provide 6 nesting levels (as in \LaTeXe{}). If you want to +% provide more you need to change the \texttt{maxblocklevels} +% counter, offer further \texttt{displayblock-xx} instances but +% also define further (legacy) \tn{list\meta{romannumeral}} commands +% for the defaults. If not, then the settings from the previous +% level are reused automatically---which may or may not be good enough). % \begin{macrocode} - \cs_set:Npn \@@_beginpar_hmode:N #1 - { - \tag_mc_end: - \__tag_gincr_para_end_int: - \@@_debug_typeout:n{increment~ /P \on@line } - \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: - \tagpdfparaOff \par \tagpdfparaOn - } +\setcounter{maxblocklevels}{6} % \end{macrocode} -% \end{macro} % +% \begin{instance}{block displayblock-0, +% block displayblock-1, +% block displayblock-2, +% block displayblock-3, +% block displayblock-4, +% block displayblock-5, +% block displayblock-6 } % +% Here we need level zero as well in case a flattened displayblock +% (like the center env) it is used on top-level. % -% \begin{macro}{\__kernel_displayblock_doendpe:} -% If a display block ends and is followed by a blank line we have to end the -% enclosing paragraph tagging structure. -% \begin{macrocode} -\cs_set:Npn \__kernel_displayblock_doendpe: { - \bool_if:NT \l__tag_para_bool - { -% \end{macrocode} -% Given that restoring \cs{par} through the legacy \LaTeXe{} method -% can take a few iterations (for example, in case of nested lists, -% e.g., \verb=...\end{itemize} \item ...\par= it can happen that -% \cs{__kernel_displayblock_doendpe:} is called while -% \texttt{@endpe} is already handled and then we should not attempt -% to close a \texttt{text-unit} structure). So we need to check for this. +% We show all keys here for reference, with those using their +% default values commented out: % \begin{macrocode} - \legacy_if:nT { @endpe } - { +\DeclareInstance{block}{displayblock-0}{display} + { +% heading = , %?? +% beginsep = \topsep , +% begin-par-skip = \partopsep , +% par-skip = \parsep , +% end-skip = \KeyValue{beginsep} , +% end-par-skip = \KeyValue{begin-par-skip} , +% item-skip = \itemsep , +% beginpenalty = \UseName{@beginparpenalty} , +% endpenalty = \UseName{@endparpenalty} , + leftmargin = 0pt , +% rightmargin = \rightmargin , +% parindent = 0pt , + } % \end{macrocode} -% If the display block currently ending was \enquote{flattened} -% (i.e., uses simplified paragraphs that are not tagged by a -% combination of \texttt{text-unit} followed by \struct{text}, but simply -% with a \struct{text}), -% then we don't have to do anything, because the \struct{text} is already closed. +% % \begin{macrocode} - \@@_debug_typeout:n - { flattened= \bool_if:NTF - \l__tag_para_flattened_bool {true}{false} - \on@line } - \bool_if:NF \l__tag_para_flattened_bool - { - \@@_debug_typeout:n{Structure-end~ - \l__tag_para_main_tag_tl\space after~ displayblock \on@line } - \__tag_gincr_para_main_end_int: - \tag_struct_end: %text-unit - } - } - } -} +\DeclareInstanceCopy{block}{displayblock-1}{displayblock-0} +\DeclareInstanceCopy{block}{displayblock-2}{displayblock-0} +\DeclareInstanceCopy{block}{displayblock-3}{displayblock-0} +\DeclareInstanceCopy{block}{displayblock-4}{displayblock-0} +\DeclareInstanceCopy{block}{displayblock-5}{displayblock-0} +\DeclareInstanceCopy{block}{displayblock-6}{displayblock-0} % \end{macrocode} -% \end{macro} +% \end{instance} % % -% \begin{macro}{para/begin} % -% Paragraph tagging is mainly done using the paragraph hooks (will -% get moved eventually). The default hook setting is not good -% enough when lists get supported: we need to delay starting the -% paragraph tagging if we still have to place the list label. -% We therefore remove the existing hook data and replace it with an -% augmented version (this will get combined eventually). -% \begin{macrocode} -\RemoveFromHook{para/begin}[tagpdf] -% \end{macrocode} +% \subsubsection{Verbatim instances} +% +% Verbatim instances have there own levels so that one can specify +% specific indentations or vertical separations between line. +% +% \begin{instance}{block verbatimblock-0, +% block verbatimblock-1, +% block verbatimblock-2, +% block verbatimblock-3, +% block verbatimblock-4, +% block verbatimblock-5, +% block verbatimblock-6 } % % \begin{macrocode} -\AddToHook{para/begin}[tagpdf]{ - \bool_if:NT \l__tag_para_bool { +\DeclareInstance{block}{verbatimblock-0}{display} + { + leftmargin = 0pt , + par-skip = 0pt , + } % \end{macrocode} -% if we are still waiting to typeset the list label we do nothing -% (the paragraph tagging then happens when the list is finally -% typeset). +% % \begin{macrocode} - \legacy_if:nF { @inlabel } - { +\DeclareInstanceCopy{block}{verbatimblock-1}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-2}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-3}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-4}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-5}{verbatimblock-0} +\DeclareInstanceCopy{block}{verbatimblock-6}{verbatimblock-0} % \end{macrocode} -% Otherwise, we start a \struct{text} tag structure but only if we are not -% starting a paragraph immediately \emph{after} a list, in which -% case we only start a new MC (because the \struct{text} tag is still open from -% before the list --- one of the reasons why lists are always put -% \enquote{inside} paragraphs. +% \end{instance} % -% We do this in a separate command, because it is needed elsewhere too. +% +% +% +% \subsubsection{Quote/quotationblock instances} +% +% Quote and quotation are not flattened, i.e., they change levels, +% thus they start with level 1 not 0. +% +% \begin{instance}{block quoteblock-1, +% block quoteblock-2, +% block quoteblock-3, +% block quoteblock-4, +% block quoteblock-5, +% block quoteblock-6 } +% Default layout is to indent equally from both sides. % \begin{macrocode} - \@@_start_para_structure:n { \PARALABEL } - } - } -} +\DeclareInstance{block}{quoteblock-1}{display} + { rightmargin = \KeyValue{leftmargin} } % \end{macrocode} -% -% -% \begin{macro}{\@@_start_para_structure:n} -% +% % \begin{macrocode} -\cs_new_protected:Npn \@@_start_para_structure:n #1 { - \@@_debug_typeout:n - { @endpe = \legacy_if:nTF { @endpe }{true}{false} - \on@line } - \legacy_if:nF { @endpe } - { - \bool_if:NF \l__tag_para_flattened_bool - { - \__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: - } - } - \__tag_gincr_para_begin_int: - \@@_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 - } - \__tag_check_para_begin_show:nn {green}{#1} - \tag_mc_begin:n {} -} +\DeclareInstanceCopy{block}{quoteblock-2}{quoteblock-1} +\DeclareInstanceCopy{block}{quoteblock-3}{quoteblock-1} +\DeclareInstanceCopy{block}{quoteblock-4}{quoteblock-1} +\DeclareInstanceCopy{block}{quoteblock-5}{quoteblock-1} +\DeclareInstanceCopy{block}{quoteblock-6}{quoteblock-1} % \end{macrocode} -% The same code, but without testing \texttt{@endpe}. This is not -% needed in the standalone case and wrong inside lists. +% \end{instance} +% +% +% +% \begin{instance}{block quotationblock-1, +% block quotationblock-2, +% block quotationblock-3, +% block quotationblock-4, +% block quotationblock-5, +% block quotationblock-6 } +% Quotation additionally changes the parindent. % \begin{macrocode} -\cs_new_protected:Npn \@@_start_para_structure_unconditionally:n #1 { - \bool_if:NF \l__tag_para_flattened_bool - { - \__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: - } - \__tag_gincr_para_begin_int: - \@@_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 - } - \__tag_check_para_begin_show:nn {green}{#1} - \tag_mc_begin:n {} -} +\DeclareInstance{block}{quotationblock-1}{display} + { parindent = 1.5em , rightmargin = \KeyValue{leftmargin} } % \end{macrocode} -% \end{macro} -% +% % \begin{macrocode} -\RemoveFromHook{para/end}[tagpdf] -\AddToHook{para/end} - { - \bool_if:NT \l__tag_para_bool - { - \__tag_gincr_para_end_int: - \@@_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 - { - \__tag_gincr_para_main_end_int: - \tag_struct_end: - } - } - } +\DeclareInstanceCopy{block}{quotationblock-2}{quotationblock-1} +\DeclareInstanceCopy{block}{quotationblock-3}{quotationblock-1} +\DeclareInstanceCopy{block}{quotationblock-4}{quotationblock-1} +\DeclareInstanceCopy{block}{quotationblock-5}{quotationblock-1} +\DeclareInstanceCopy{block}{quotationblock-6}{quotationblock-1} % \end{macrocode} +% \end{instance} +% +% +% \subsubsection{Block instances for the theorems} % +% +% \begin{instance}{block theoremblock-0} +% Theorems do not support nesting, so we have only one to set up. +% The \LaTeX{} default reused the general value of \tn{parindent} +% and \tn{parskip} and, of course, they start at the outer margin. +% \changes{v0.8w}{2024/11/23}{Add block instance for theorems} % \begin{macrocode} -\def\PARALABEL{NP-} +\DeclareInstance{block}{theoremblock-0}{display} + { + leftmargin = 0pt , + parindent = \parindent , + par-skip = \parskip , + } % \end{macrocode} -% \end{macro} +% \end{instance} +% +% % +% \subsubsection{Block instances for the standard lists} % -% \begin{macro}{\para_end:} -% If we see a \cs{par} in vmode and a \texttt{text-unit} is still open -% we need to close that. For this we check if a request for -% \text{@endpe} was made (but the \cs{par} redefinition got lost -% due to (bad?) coding). +% \begin{instance}{block list-1, +% block list-2, +% block list-3, +% block list-4, +% block list-5, +% block list-6 } +% The block instances for the various list environments use the +% same underlying instance (well, by default) and nothing +% needs to be set up specifically (because that is already done in +% the legacy \tn{list\meta{romannumeral}} unless a +% different layout is wanted. % \begin{macrocode} -\cs_set_protected:Npn \para_end: { - \scan_stop: - \mode_if_horizontal:TF { - \mode_if_inner:F { - \tex_unskip:D - \hook_use:n{para/end} - \@kernel@after@para@end - \mode_if_horizontal:TF { - \if_int_compare:w 11 = \tex_lastnodetype:D - \tex_hskip:D \c_zero_dim - \fi: - \tex_par:D - \hook_use:n{para/after} - \@kernel@after@para@after - } - { \msg_error:nnnn { hooks }{ para-mode }{end}{horizontal} } - } - } - { - \__kernel_endpe_vmode: % should do nothing if no tagging - \tex_par:D - } +\DeclareInstance{block}{list-1}{display}{ +% heading = , % unused, might vanish +% beginsep = \topsep , +% begin-par-skip = \partopsep , +% par-skip = \parsep , +% end-skip = \KeyValue{beginsep} , +% end-par-skip = \KeyValue{begin-par-skip} , +% beginpenalty = \UseName{@beginparpenalty} , +% endpenalty = \UseName{@endparpenalty} , +% leftmargin = \leftmargin , +% rightmargin = \rightmargin , +% parindent = 0pt , } -\cs_set_eq:NN \par \para_end: -\cs_set_eq:NN \@@par \para_end: -\cs_set_eq:NN \endgraf \para_end: +\DeclareInstance{block}{list-2}{display}{} +\DeclareInstance{block}{list-3}{display}{} +\DeclareInstance{block}{list-4}{display}{} +\DeclareInstance{block}{list-5}{display}{} +\DeclareInstance{block}{list-6}{display}{} % \end{macrocode} +% \end{instance} +% % -% \end{macro} +% +% \subsection{List instances for the standard lists} % +% For all list instances we have to say what kind of label we want +% (\key{item-label}) and how it should be formatted. +% +% \begin{instance}{list itemize-1, +% list itemize-2, +% list itemize-3, +% list itemize-4} +% For \env{itemize} environments this is all we need to do and we +% refer back to the external definitions rather than defining the +% \key{item-label} code in the instance to ensure that old +% documents still work. % -% \begin{macro}{\begin} -% We need to do a little more than canceling \texttt{@endpe} now. % \begin{macrocode} -\DeclareRobustCommand*\begin[1]{% - \UseHook{env/#1/before}% - \@ifundefined{#1}% - {\def\reserved@a{\@latex@error{Environment~#1~undefined}\@eha}}% - {\def\reserved@a{\def\@currenvir{#1}% - \edef\@currenvline{\on@line}% - \@execute@begin@hook{#1}% - \csname #1\endcsname}}% - \@ignorefalse - \begingroup - \__kernel_endpe_vmode: - \reserved@a} +\DeclareInstance{list}{itemize-1}{std}{ item-label = \labelitemi } +\DeclareInstance{list}{itemize-2}{std}{ item-label = \labelitemii } +\DeclareInstance{list}{itemize-3}{std}{ item-label = \labelitemiii } +\DeclareInstance{list}{itemize-4}{std}{ item-label = \labelitemiv } +% \end{macrocode} +% \end{instance} +% +% +% +% \begin{instance}{list enumerate-1, +% list enumerate-2, +% list enumerate-3, +% list enumerate-4} +% \env{enumerate} environments are similar, except that we also +% have to say which counter to use on each level. +% \begin{macrocode} +\DeclareInstance{list}{enum-1}{std} + { item-label = \labelenumi , counter = enumi } +\DeclareInstance{list}{enum-2}{std} + { item-label = \labelenumii , counter = enumii } +\DeclareInstance{list}{enum-3}{std} + { item-label = \labelenumiii , counter = enumiii } +\DeclareInstance{list}{enum-4}{std} + { item-label = \labelenumiv , counter = enumiv } % \end{macrocode} -% \end{macro} -% +% \end{instance} +% +% % -% \begin{macro}{\__kernel_endpe_vmode:} -% Close an open \texttt{text-unit} if \texttt{@endpe} is true and we -% are in vmode. Used in \cs{para_end:} and \cs{begin}. +% \begin{instance}{list legacy} +% For the legacy \env{list} environment there is only one instance +% which is reused on all levels. This is done this way one because +% the legacy \env{list} environment sets all its +% parameters through its arguments. So this instances shouldn't +% really be touched. It sets the \key{legacy-support} key to +% true, which means that the list code uses \tn{makelabel} for +% formatting the label % \begin{macrocode} -\cs_new:Npn \__kernel_endpe_vmode: { - \if@endpe \ifvmode - \bool_if:NT \l__tag_para_bool - { - \bool_if:NF \l__tag_para_flattened_bool - { - \__tag_gincr_para_main_end_int: - \tag_struct_end: - } - \@endpefalse - } - \fi \fi +\DeclareInstance{list}{legacy}{std} { + item-instance = basic , + legacy-support = true , } % \end{macrocode} -% \end{macro} -% +% \end{instance} +% % -% \begin{macro}{\__kernel_list_label_after:} -% If starting the text-unit/text tags got delayed because of a pending label we -% have to do it after the label got typeset +% \begin{instance}{list description} +% The \env{description} lists also use only a single list instance +% with only one key not using the default: % \begin{macrocode} -\cs_set:Npn \__kernel_list_label_after: { - \bool_if:NT \l__tag_para_bool - { - \@@_start_para_structure_unconditionally:n { LI- } - } -} +\DeclareInstance{list}{description}{std} { item-instance = description } % \end{macrocode} -% \end{macro} +% \end{instance} % +% +% \subsection{Item instances} % -% \begin{macro}{\@@_inner_begin:} -% Start a block that has an inner structure if it isn't also a list. +% +% \begin{instance}{item basic, item description} +% There two item instances set up: \keyvalue{description} for use +% with the \env{description} environment and \keyvalue{basic} for use +% with all other lists (up to now). % \begin{macrocode} -\cs_new:Npn \@@_inner_begin: { - \tagstructbegin{tag=\l_@@_tag_inner_tag_tl} -} +\DeclareInstance{item}{basic}{std} + { label-align = right } % \end{macrocode} -% \end{macro} -% % -% \begin{macro}{\@@_inner_end:} -% End a block (which isn't also a list). % \begin{macrocode} -\cs_new:Npn \@@_inner_end: { - \@@_debug_typeout:n{block-end \on@line} - \legacy_if:nT { @endpe } - { - \__tag_gincr_para_main_end_int: - \@@_debug_typeout:n{close~ /text-unit \on@line} - \tagstructend - } - \tagstructend % end inner structure -} +\DeclareInstance{item}{description}{std} + { + label-format = \normalfont\bfseries #1 , + label-align = left + } % \end{macrocode} -% \end{macro} -% -% -% -% +% \end{instance} % % -% \subsubsection{List tags} % +% \subsection{Para instances} % % \begin{macrocode} -\tl_new:N \l__tag_L_tag_tl -\tl_set:Nn \l__tag_L_tag_tl {L} - -\tl_new:N\l__tag_L_attr_class_tl -\tl_set:Nn \l__tag_L_attr_class_tl {list} -% \end{macrocode} -% -% \begin{macrocode} \tag_if_active:T { \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}, -% \end{macrocode} -% Initially, we had \texttt{/None} for the basic \env{list} -% environment, but that is not allowed in PDF/UA-2 if the list -% contains any Lbl tags. So now we default to -% \texttt{Unordered}. -% \begin{macrocode} - % default if unknown - role/new-attribute = {list}{/O /List /ListNumbering/Unordered}, + 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}, } } % \end{macrocode} -% -% \begin{macrocode} -\def\LItag{LI} -% \end{macrocode} % -% \begin{macro}{\@@_list_begin:} -% Start a list \ldots +% \begin{instance}{para center} % \begin{macrocode} -\cs_set:Npn \@@_list_begin: { - \tagstructbegin - { - tag=\l__tag_L_tag_tl - ,attribute-class=\l__tag_L_attr_class_tl - } +\DeclareInstance{para}{center}{std} +{ + para-class = center , + indent-width = 0pt , +% start-skip = 0pt , + left-skip = \@flushglue , + right-skip = \@flushglue , + end-skip = \z@skip , + final-hyphen-demerits = 0 , + cr-cmd = \@centercr , } % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@@_list_item_begin:} -% Start tagging a list item. -% \begin{macrocode} -\cs_set:Npn \@@_list_item_begin: { \tagstructbegin{tag=\LItag} } -% \end{macrocode} -% \end{macro} -% +% \end{instance} % -% \begin{macro}{\__kernel_list_label_begin:} -% A list label needs a \texttt{Lbl} structure tag and an MC. +% \begin{instance}{para raggedright} % \begin{macrocode} -\cs_set:Npn \__kernel_list_label_begin: { -% -% FMi: this needs a different logic to decide when to make the label -% an artifact (after cleaning up the \item code ), therefore -% disabled for now -% \tl_if_empty:oTF \@itemlabel -% { -% \tag_mc_begin:n {artifact} -% } -% { - \tagstructbegin{tag=Lbl} - \tagmcbegin{tag=Lbl} -% } +\DeclareInstance{para}{raggedright}{std} +{ + para-class = raggedright , + indent-width = 0pt , +% start-skip = 0pt , + left-skip = \z@skip , + right-skip = \@flushglue , + end-skip = \z@skip , + final-hyphen-demerits = 0 , + cr-cmd = \@centercr , } % \end{macrocode} -% \end{macro} -% -% +% \end{instance} % -% \begin{macro}{\__kernel_list_label_end:} -% And when we are done with the label we have to close the MC and -% the \texttt{Lbl} structure. We then start the \texttt{LBody}. The -% material inside will be \enquote{paragraph} text and the tagging -% for that is handled by the normal para tagging. +% \begin{instance}{para raggedleft} % \begin{macrocode} -\cs_set:Npn \__kernel_list_label_end: { - \tagmcend % end mc-Lbl or artifact -% FMi: unconditionally for now -% \tl_if_empty:oF \@itemlabel - \tagstructend % end Lbl - \tagstructbegin{tag=\LBody} +\DeclareInstance{para}{raggedleft}{std} +{ + para-class = raggedleft , + indent-width = 0pt , +% start-skip = 0pt , + left-skip = \@flushglue , + right-skip = \z@skip , + end-skip = \z@skip , + final-hyphen-demerits = 0 , + cr-cmd = \@centercr , } -\def\LBody{LBody} % \end{macrocode} -% \end{macro} -% -% +% \end{instance} % -% \begin{macro}{\@@_list_item_end:} -% When a list item ends we have to close \texttt{LBody} and -% \texttt{LI} but also a \struct{text} in the special case that the -% item material ends in a list (identifiable via \texttt{@endpe}). +% \begin{instance}{para justify} +% Justifying is exactly what the default values do, so the instance +% hasn't any special setup. % \begin{macrocode} -\cs_set:Npn \@@_list_item_end: { - \legacy_if:nT { @endpe } - { - \__tag_gincr_para_main_end_int: - \tagstructend % text-unit -% \@@_debug_typeout:n{Structure-end~ P~ at~ item-end \on@line } - } - \tagstructend \tagstructend % end LBody, LI +\DeclareInstance{para}{justify}{std} +{ +% para-class = justify , +% indent-width = \parindent , +% start-skip = 0pt , +% left-skip = \z@skip , +% right-skip = \z@skip , +% end-skip = \@flushglue , +% final-hyphen-demerits = 5000 , +% cr-cmd = \@normalcr , } % \end{macrocode} -% \end{macro} +% \end{instance} % % % -% \begin{macro}{\@@_list_end:} -% Finally, at the list end we have to close the open -% \texttt{LBody}, \texttt{LI}, \texttt{L}, and possibly a -% \struct{text} if the last item ends with a list. -% However, if the user forgot to add an \cs{item} then there will be no -% \texttt{LI} and \texttt{LBody} open, so we check for the status -% of \texttt{@newlist}. The corresponding no-item error was -% generated earlier outside the tagging code. % -% One could argue that it doesn't matter if the tagging is wrong -% after a \cs{@noitemerr} was issued. However, there is one case -% where it isn't an error: In the \texttt{thebibliography} -% environment (which is internally a list) it is often the case -% that documents start out with an empty environment, not -% containing any \cs{bibitem}s. For that reason \cs{@noitemerr} is -% redefined inside that environment to only produce a warning; -% hence we have to produce correct tag structures in that case. -% \changes{v0.8q}{2024/09/02}{Do not close LI and LBody if they -% never were opened.} +% \begin{macro}[no-user-doc]{\centering,\raggedleft,\raggedright,\justifying} +% % \begin{macrocode} -\cs_set:Npn \@@_list_end: { +\DeclareRobustCommand\centering {\UseInstance{para}{center}{}} +\DeclareRobustCommand\raggedleft {\UseInstance{para}{raggedleft}{}} +\DeclareRobustCommand\raggedright{\UseInstance{para}{raggedright}{}} +\DeclareRobustCommand\justifying {\UseInstance{para}{justify}{}} % \end{macrocode} -% If \texttt{@newlist} is true (i.e., when we have an error or warning -% situation) there is not much to close. +% % \begin{macrocode} - \legacy_if:nF { @newlist } - { - \legacy_if:nT { @endpe } - { - \__tag_gincr_para_main_end_int: - \tagstructend % text-unit - \@@_debug_typeout:n{Structure-end~ P~ at~ list-end \on@line } - } - \tagstructend\tagstructend % end LBody, LI - } - \tagstructend % end L -} +\justifying % \end{macrocode} % \end{macro} -% End of tagging related declarations. -% \begin{macrocode} -} -% \end{macrocode} -% These command should have a dummy declaration if tagging is not active -% \begin{macrocode} -{ - \cs_new:Npn \@@_start_para_structure_unconditionally:n #1 {} -} -% \end{macrocode} % % % % % -% -% -% -% % \begin{macrocode} % % \end{macrocode} @@ -4132,6 +4284,7 @@ % % \end{implementation} % +% \appendix % % \section{Documentation from first prototype implementations} % @@ -4143,10 +4296,11 @@ % % \subsection{Code cleanup} % \begin{itemize} +% \raggedright % \item Actually implement what's announced. % % \item Encapsulate most uses of \cs[no-index]{legacy_if\dots} into -% commands with \texttt{expl3} syntax: we cannot rename these booleans +% commands with \pkg{expl3} syntax: we cannot rename these booleans % for compatibility reasons but we can make the code cleaner % nevertheless. --- made issue --- % @@ -4181,8 +4335,8 @@ % % \item Add key--value settings mimicking \pkg{enumitem}'s ability to % set any four of five horizontal parameters and deduce the fifth by -% $\cs{leftmargin} + \cs{itemindent} = \cs{labelindent} + -% \cs{labelwidth} + \cs{labelsep}$. +% $\tn{leftmargin} + \tn{itemindent} = \tn{labelindent} + +% \tn{labelwidth} + \tn{labelsep}$. % % \item Provide good ways to customize how overlong labels are dealt with. % @@ -4232,8 +4386,8 @@ % horizontal spacing around it. This type of layout is shared with % environments such as \texttt{quote}, \texttt{flushright}, or % \texttt{tabbing}. This common layout is implemented in \LaTeXe{} -% through \cs{trivlist} (or \cs{list}). -% \item It defines how each \cs{item} should be typeset: how to +% through \tn{trivlist} (or \tn{list}). +% \item It defines how each \tn{item} should be typeset: how to % construct the label, in particular the \texttt{counter} name, and % how to format the content of the item. % \end{itemize} @@ -4259,6 +4413,7 @@ % run-in lists.} that omits the \texttt{heading} parameter and whose % default for \texttt{item-instance} is non-empty. % \begin{itemize} +% \raggedright % \item Structural parameters: the \texttt{heading} to place before, % \texttt{counter} name, \texttt{start} value, whether to % \texttt{resume} a previous list, and the \texttt{item-instance} (an @@ -4311,7 +4466,7 @@ % \texttt{label-strut} boolean. % \item Label alignment (\texttt{label-align}, \texttt{label-boxed}, % \texttt{next-line}). -% \item Content parameters: \texttt{text-font}. +% \item Content parameters: \key{text-font}. % \item A \texttt{compatibility} boolean that controls for instance % whether \tn{makelabel} is used. % \end{itemize} diff --git a/required/latex-lab/latex-lab-firstaid.dtx b/required/latex-lab/latex-lab-firstaid.dtx index 118baccd7..a5c44b824 100644 --- a/required/latex-lab/latex-lab-firstaid.dtx +++ b/required/latex-lab/latex-lab-firstaid.dtx @@ -16,8 +16,8 @@ % % for those people who are interested or want to report an issue. % -\def\ltlabfirstaiddate{2024-10-16} -\def\ltlabfirstaidversion{0.85h} +\def\ltlabfirstaiddate{2024-11-23} +\def\ltlabfirstaidversion{0.85i} %<*driver> \documentclass{l3doc} \EnableCrossrefs @@ -179,35 +179,38 @@ % While create the caption/label we disable para-tagging. % \begin{macrocode} \tagpdfparaOff - \mode_leave_vertical: -% \end{macrocode} -% The anchor for links. amsthm allows for unnumbered theorems so we have to test -% for an empty counter. -% \changes{v0.85h}{2024/10/16}{add test if counter is empty tagging/736} -% \begin{macrocode} - \tl_if_empty:NTF \l__block_thm_current_counter_tl - {\MakeLinkTarget[theorem]{}} - {\MakeLinkTarget{\l__block_thm_current_counter_tl}} \group_begin: - \normalfont - \the\thm@headfont \thm@indent + \normalfont + \the\thm@headfont \thm@indent +% \end{macrocode} +% The anchor for links. It must be inserted when we have started hmode +% (which happens with \cs{thm@indent}). \pkg{amsthm} allows for unnumbered +% theorems so we have to test for an empty counter. +% \changes{v0.85h}{2024/10/16}{add test if counter is empty +% tagging/736} +% \changes{v0.85i}{2024/11/23}{Do not use \cs{leavevmode} but wait +% for hmode to add the link target} +% \begin{macrocode} + \tl_if_empty:NTF \l__block_thm_current_counter_tl + {\MakeLinkTarget[theorem]{}} + {\MakeLinkTarget{\l__block_thm_current_counter_tl}} \@ifempty{##1} - {\let\thmname\@gobble} + {\let\thmname\@gobble} % \end{macrocode} % we insert the MC and the Lbl structure into \cs{thmname}, % \cs{thmnumber} and \cs{thmnote}. This will also work % with new theorem style as long as they use these command. % \begin{macrocode} - {\def\thmname####1{\tag_mc_begin:n {}####1\tag_mc_end:}}% + {\def\thmname####1{\tag_mc_begin:n {}####1\tag_mc_end:}}% \@ifempty{##2} - {\let\thmnumber\@gobble} - {\def\thmnumber####1 - {\tag_struct_begin:n{tag=Lbl}\tag_mc_begin:n {} - ####1 - \tag_mc_end:\tag_struct_end:}}% + {\let\thmnumber\@gobble} + {\def\thmnumber####1 + {\tag_struct_begin:n{tag=Lbl}\tag_mc_begin:n {} + ####1 + \tag_mc_end:\tag_struct_end:}}% \@ifempty{##3} - {\let\thmnote\@gobble} - {\def\thmnote####1{\tag_mc_begin:n{}####1\tag_mc_end:}}% + {\let\thmnote\@gobble} + {\def\thmnote####1{\tag_mc_begin:n{}####1\tag_mc_end:}}% \tag_struct_begin:n{tag=Caption} \thm@swap\swappedhead\thmhead{##1}{##2}{##3}% \tag_mc_begin:n{}\the\thm@headpunct\tag_mc_end: @@ -221,7 +224,7 @@ % be used if tagging is active! % \begin{macrocode} \tagpdfparaOn - \UseTaggingSocket{para/begin} % + \UseTaggingSocket{para/begin} \ignorespaces} % \end{macrocode} % This redefines the standard styles for the theorem heads. diff --git a/required/latex-lab/testfiles-block/blocks-000.luatex.tlg b/required/latex-lab/testfiles-block/blocks-000.luatex.tlg index 8645f87f5..cc933ae00 100644 --- a/required/latex-lab/testfiles-block/blocks-000.luatex.tlg +++ b/required/latex-lab/testfiles-block/blocks-000.luatex.tlg @@ -14,6 +14,7 @@ LaTeX template Info: Declaring template type 'item' taking 1 argument(s) on line \l__par_start_skip=\skip... \l__block_botsep_skip=\skip... \l__block_parbotsep_skip=\skip... +\l__block_parindent_dim=\dimen... \l__block_counter_start_int=\count... \l__block_one_label_box=\box... \g__block_labels_box=\box... diff --git a/required/latex-lab/testfiles-block/blocks-000.tlg b/required/latex-lab/testfiles-block/blocks-000.tlg index d1d395aef..94c48146c 100644 --- a/required/latex-lab/testfiles-block/blocks-000.tlg +++ b/required/latex-lab/testfiles-block/blocks-000.tlg @@ -14,6 +14,7 @@ LaTeX template Info: Declaring template type 'item' taking 1 argument(s) on line \l__par_start_skip=\skip... \l__block_botsep_skip=\skip... \l__block_parbotsep_skip=\skip... +\l__block_parindent_dim=\dimen... \l__block_counter_start_int=\count... \l__block_one_label_box=\box... \g__block_labels_box=\box... diff --git a/required/latex-lab/testfiles-block/blocks-theorem-01.luatex.tlg b/required/latex-lab/testfiles-block/blocks-theorem-01.luatex.tlg index ec5d05779..abc8e3e89 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-01.luatex.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-01.luatex.tlg @@ -43,7 +43,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 11 tagged /text Package tagpdf Info: closing structure 10 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -120,7 +120,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 22 tagged /text Package tagpdf Info: closing structure 21 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -154,7 +154,7 @@ Package tagpdf Info: closing structure 26 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 23 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -220,7 +220,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 37 tagged /text Package tagpdf Info: closing structure 36 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -268,7 +268,7 @@ Package tagpdf Info: closing structure 43 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 38 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -384,16 +384,6 @@ Package tagpdf Info: closing structure 59 tagged /LI Package tagpdf Info: Parent-Child 'L' --> 'LI'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'L' --> 'LI' on line ... -Package tagpdf Info: -1 has been pushed to the mc stack -Package tagpdf Info: -1 has been removed from the mc stack -Package tagpdf Info: -1 has been pushed to the mc stack -Package tagpdf Info: -1 has been removed from the mc stack -tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact -tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact -tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact -tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact -tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact [1 -] ==> template:item:std Package tagpdf Info: Parent-Child 'LI' --> 'Lbl'. (tagpdf) Relation is 1 (='0..n') @@ -418,6 +408,16 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. (tagpdf) Rolemapped from: 'P' --> 'MC' on line ... Package tagpdf Info: closing structure 68 tagged /text Package tagpdf Info: closing structure 67 tagged /text-unit +Package tagpdf Info: -1 has been pushed to the mc stack +Package tagpdf Info: -1 has been removed from the mc stack +Package tagpdf Info: -1 has been pushed to the mc stack +Package tagpdf Info: -1 has been removed from the mc stack +tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact +tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact +tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact +tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact +tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact [1 +] Package tagpdf Info: closing structure 66 tagged /LBody Package tagpdf Info: closing structure 64 tagged /LI Package tagpdf Info: Parent-Child 'L' --> 'LI'. diff --git a/required/latex-lab/testfiles-block/blocks-theorem-01.tlg b/required/latex-lab/testfiles-block/blocks-theorem-01.tlg index 546ab97e6..e434746fc 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-01.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-01.tlg @@ -40,7 +40,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 11 tagged /text Package tagpdf Info: closing structure 10 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -117,7 +117,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 22 tagged /text Package tagpdf Info: closing structure 21 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -151,7 +151,7 @@ Package tagpdf Info: closing structure 26 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 23 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -214,7 +214,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 37 tagged /text Package tagpdf Info: closing structure 36 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -262,7 +262,7 @@ Package tagpdf Info: closing structure 43 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 38 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -378,10 +378,6 @@ Package tagpdf Info: closing structure 59 tagged /LI Package tagpdf Info: Parent-Child 'L' --> 'LI'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'L' --> 'LI' on line ... -The sequence \g__tag_mc_main_marks_seq is empty -> . -[1 -] ==> template:item:std Package tagpdf Info: Parent-Child 'LI' --> 'Lbl'. (tagpdf) Relation is 1 (='0..n') @@ -406,6 +402,10 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. (tagpdf) Rolemapped from: 'P' --> 'MC' on line ... Package tagpdf Info: closing structure 68 tagged /text Package tagpdf Info: closing structure 67 tagged /text-unit +The sequence \g__tag_mc_main_marks_seq is empty +> . +[1 +] Package tagpdf Info: closing structure 66 tagged /LBody Package tagpdf Info: closing structure 64 tagged /LI Package tagpdf Info: Parent-Child 'L' --> 'LI'. diff --git a/required/latex-lab/testfiles-block/blocks-theorem-02.luatex.tlg b/required/latex-lab/testfiles-block/blocks-theorem-02.luatex.tlg index dfc267b23..fd207b57d 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-02.luatex.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-02.luatex.tlg @@ -117,7 +117,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 11 tagged /text Package tagpdf Info: closing structure 10 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -162,7 +162,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 18 tagged /text Package tagpdf Info: closing structure 17 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -196,7 +196,7 @@ Package tagpdf Info: closing structure 22 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 19 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -262,7 +262,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 33 tagged /text Package tagpdf Info: closing structure 32 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -310,7 +310,7 @@ Package tagpdf Info: closing structure 39 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 34 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... diff --git a/required/latex-lab/testfiles-block/blocks-theorem-02.tlg b/required/latex-lab/testfiles-block/blocks-theorem-02.tlg index 5da932d7e..d1b2b7bac 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-02.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-02.tlg @@ -40,7 +40,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 11 tagged /text Package tagpdf Info: closing structure 10 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -85,7 +85,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 18 tagged /text Package tagpdf Info: closing structure 17 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -119,7 +119,7 @@ Package tagpdf Info: closing structure 22 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 19 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -182,7 +182,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 33 tagged /text Package tagpdf Info: closing structure 32 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... @@ -230,7 +230,7 @@ Package tagpdf Info: closing structure 39 tagged /text-unit ==> block-end on input line ... Package tagpdf Info: closing structure 34 tagged /theorem-like ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Sect' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'theorem-like' on line ... diff --git a/required/latex-lab/testfiles-block/blocks-theorem-03.luatex.tlg b/required/latex-lab/testfiles-block/blocks-theorem-03.luatex.tlg index 24724e11c..7c4f8a324 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-03.luatex.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-03.luatex.tlg @@ -12,7 +12,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 6 tagged /text Package tagpdf Info: closing structure 5 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Document' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Document' --> 'theorem-like' on line ... diff --git a/required/latex-lab/testfiles-block/blocks-theorem-03.tlg b/required/latex-lab/testfiles-block/blocks-theorem-03.tlg index 86bba0e2a..43c5a7fd7 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-03.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-03.tlg @@ -12,7 +12,7 @@ Package tagpdf Info: Parent-Child 'P' --> 'MC'. Package tagpdf Info: closing structure 6 tagged /text Package tagpdf Info: closing structure 5 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Document' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Document' --> 'theorem-like' on line ... diff --git a/required/latex-lab/testfiles-block/blocks-theorem-04.luatex.tlg b/required/latex-lab/testfiles-block/blocks-theorem-04.luatex.tlg index 0902bc2b4..2e7d55c94 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-04.luatex.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-04.luatex.tlg @@ -1,7 +1,18 @@ This is a generated file for the l3build validation system. Don't change this file in any respect. +Package tagpdf Info: Parent-Child 'Document' --> 'Part'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text-unit' on line ... +Package tagpdf Info: Parent-Child 'Document' --> 'P'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text' on line ... +Package tagpdf Info: Parent-Child 'P' --> 'MC'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'P' --> 'MC' on line ... +Package tagpdf Info: closing structure 6 tagged /text +Package tagpdf Info: closing structure 5 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Document' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Document' --> 'theorem-like' on line ... @@ -17,11 +28,11 @@ Package tagpdf Info: Parent-Child 'Caption' --> 'Lbl'. Package tagpdf Info: Parent-Child 'Lbl' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Lbl' --> 'MC' on line ... -Package tagpdf Info: closing structure 7 tagged /Lbl +Package tagpdf Info: closing structure 9 tagged /Lbl Package tagpdf Info: Parent-Child 'Caption' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Caption' --> 'MC' on line ... -Package tagpdf Info: closing structure 6 tagged /Caption +Package tagpdf Info: closing structure 8 tagged /Caption Package tagpdf Info: Parent-Child 'Sect' --> 'Part'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'text-unit' on line ... @@ -32,13 +43,35 @@ Package tagpdf Info: Parent-Child 'Sect' --> 'P'. Package tagpdf Info: Parent-Child 'P' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'P' --> 'MC' on line ... -Package tagpdf Info: closing structure 9 tagged /text -Package tagpdf Info: closing structure 8 tagged /text-unit +Package tagpdf Info: closing structure 11 tagged /text +Package tagpdf Info: closing structure 10 tagged /text-unit +Package tagpdf Info: Parent-Child 'Sect' --> 'Part'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Sect' --> 'text-unit' on line ... +Package tagpdf Info: Parent-Child 'Sect' --> 'P'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Sect' --> 'text' on line ... +Package tagpdf Info: Parent-Child 'P' --> 'MC'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'P' --> 'MC' on line ... +Package tagpdf Info: closing structure 13 tagged /text +Package tagpdf Info: closing structure 12 tagged /text-unit ==> blockenv common ending on input line ... ==> block-end on input line ... -Package tagpdf Info: closing structure 5 tagged /theorem-like +Package tagpdf Info: closing structure 7 tagged /theorem-like +Package tagpdf Info: Parent-Child 'Document' --> 'Part'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text-unit' on line ... +Package tagpdf Info: Parent-Child 'Document' --> 'P'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text' on line ... +Package tagpdf Info: Parent-Child 'P' --> 'MC'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'P' --> 'MC' on line ... +Package tagpdf Info: closing structure 15 tagged /text +Package tagpdf Info: closing structure 14 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Document' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Document' --> 'theorem-like' on line ... @@ -54,8 +87,8 @@ Package tagpdf Info: Parent-Child 'Caption' --> 'Lbl'. Package tagpdf Info: Parent-Child 'Lbl' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Lbl' --> 'MC' on line ... -Package tagpdf Info: closing structure 12 tagged /Lbl -Package tagpdf Info: closing structure 11 tagged /Caption +Package tagpdf Info: closing structure 18 tagged /Lbl +Package tagpdf Info: closing structure 17 tagged /Caption Package tagpdf Info: Parent-Child 'Sect' --> 'Part'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'text-unit' on line ... @@ -73,16 +106,16 @@ Package tagpdf Info: Parent-Child 'P' --> 'Link'. Package tagpdf Info: Parent-Child 'Link' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Link' --> 'MC' on line ... -Package tagpdf Info: closing structure 15 tagged /Link +Package tagpdf Info: closing structure 21 tagged /Link Package tagpdf Info: text has been removed from the mc stack Package tagpdf Info: Parent-Child 'P' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'P' --> 'MC' on line ... ==> blockenv common ending on input line ... -Package tagpdf Info: closing structure 14 tagged /text -Package tagpdf Info: closing structure 13 tagged /text-unit +Package tagpdf Info: closing structure 20 tagged /text +Package tagpdf Info: closing structure 19 tagged /text-unit ==> block-end on input line ... -Package tagpdf Info: closing structure 10 tagged /theorem-like +Package tagpdf Info: closing structure 16 tagged /theorem-like Package tagpdf Info: -1 has been pushed to the mc stack Package tagpdf Info: -1 has been removed from the mc stack Package tagpdf Info: -1 has been pushed to the mc stack @@ -91,6 +124,7 @@ tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact +tagpdf: INFO TAG-NOT-TAGGED: this has not been tagged, using artifact Completed box being shipped out [1] \vbox(633.0+0.0)x407.0, direction TLT .\hbox(0.0+0.0)x0.0, direction TLT @@ -128,23 +162,44 @@ Completed box being shipped out [1] ....\pdflinkstate 0 ...\glue 25.0 ...\glue(\lineskip) 0.0 -...\vbox(550.0+0.0)x345.0, glue set 507.94574fil, direction TLT +...\vbox(550.0+0.0)x345.0, glue set 439.953fil, direction TLT ....\latelua0{ltx.__pdf.Page.Resources.ExtGState=true} ....\latelua0{ltx.pdf.Page_Resources_gpush(tex.count["g_shipout_readonly_int"])} ....\write-{} ....\pdfdest name{Doc-Start} xyz ....\pdfdest name{Doc-Start} xyz -....\glue(\topskip) 2.5 +....\glue(\topskip) 5.69446 +....\hbox(4.30554+0.0)x345.0, glue set 314.1666fil, direction TLT +.....\localpar +......\localinterlinepenalty=0 +......\localbrokenpenalty=0 +......\localleftbox=null +......\localrightbox=null +.....\hbox(0.0+0.0)x15.0, direction TLT +.....\pdfliteral page +.....\pdfliteral page +.....\OT1/cmr/m/n/10 x +.....\OT1/cmr/m/n/10 x +.....\OT1/cmr/m/n/10 x +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\penalty -51 +....\glue 10.0 plus 4.0 minus 5.0 +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 4.5 ....\hbox(7.5+2.5)x345.0, glue set 104.19038fil, direction TLT .....\localpar ......\localinterlinepenalty=0 ......\localbrokenpenalty=0 ......\localleftbox=null ......\localrightbox=null -.....\hbox(0.0+0.0)x0.0, direction TLT .....\penalty 10000 .....\hbox(0.0+0.0)x0.0, direction TLT ......\hbox(0.0+0.0)x0.0, shifted -12.0, direction TLT +.......\pdfliteral page +.......\pdfliteral page .......\pdfdest name{thm.0.1} xyz .......\pdfdest name{thm.0.1} xyz .......\penalty 10000 @@ -231,26 +286,130 @@ Completed box being shipped out [1] .....\OT1/cmr/m/it/10 . .....\kern1.53333 .....\penalty 10000 +.....\glue 0.0 plus 1.0fil +.....\penalty -10000 +.....\glue(\rightskip) 0.0 +....\penalty 300 +....\glue(\baselineskip) 2.55556 +....\hbox(6.94444+0.0)x345.0, glue set 249.67844fil, direction TLT +.....\OT1/cmr/m/it/10 w +.....\OT1/cmr/m/it/10 i +.....\OT1/cmr/m/it/10 t +.....\OT1/cmr/m/it/10 h +.....\TU/lmr/m/n/10 +.....\glue(\spaceskip) 0.24774 plus 1.53333 minus 1.0222 +.....\OT1/cmr/m/it/10 a +.....\TU/lmr/m/n/10 +.....\glue(\spaceskip) 0.24774 plus 1.53333 minus 1.0222 +.....\OT1/cmr/m/it/10 s +.....\OT1/cmr/m/it/10 e +.....\kern-0.51112 (font) +.....\OT1/cmr/m/it/10 c +.....\discretionary (penalty 50) +......< \OT1/cmr/m/it/10 - +......= \kern-0.51112 (font) +.....\OT1/cmr/m/it/10 o +.....\OT1/cmr/m/it/10 n +.....\OT1/cmr/m/it/10 d +.....\TU/lmr/m/n/10 +.....\glue(\spaceskip) 0.24774 plus 1.53333 minus 1.0222 +.....\OT1/cmr/m/it/10 l +.....\OT1/cmr/m/it/10 i +.....\OT1/cmr/m/it/10 n +.....\OT1/cmr/m/it/10 e +.....\TU/lmr/m/n/10 +.....\glue(\spaceskip) 0.24774 plus 1.53333 minus 1.0222 +.....\OT1/cmr/m/it/10 . +.....\kern1.53333 +.....\OT1/cmr/m/it/10 . +.....\kern1.53333 +.....\OT1/cmr/m/it/10 . +.....\kern1.53333 +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 5.05556 +....\hbox(6.94444+1.94444)x345.0, glue set 222.90079fil, direction TLT +.....\localpar +......\localinterlinepenalty=0 +......\localbrokenpenalty=0 +......\localleftbox=null +......\localrightbox=null +.....\hbox(0.0+0.0)x15.0, direction TLT +.....\pdfliteral page +.....\pdfliteral page +.....\OT1/cmr/m/it/10 A +.....\kern-0.25557 (font) +.....\OT1/cmr/m/it/10 n +.....\OT1/cmr/m/it/10 d +.....\TU/lmr/m/n/10 +.....\glue(\spaceskip) 0.24774 plus 1.53333 minus 1.0222 +.....\OT1/cmr/m/it/10 a +.....\TU/lmr/m/n/10 +.....\glue(\spaceskip) 0.24774 plus 1.53333 minus 1.0222 +.....\OT1/cmr/m/it/10 s +.....\OT1/cmr/m/it/10 e +.....\kern-0.51112 (font) +.....\OT1/cmr/m/it/10 c +.....\discretionary (penalty 50) +......< \OT1/cmr/m/it/10 - +......= \kern-0.51112 (font) +.....\OT1/cmr/m/it/10 o +.....\OT1/cmr/m/it/10 n +.....\OT1/cmr/m/it/10 d +.....\TU/lmr/m/n/10 +.....\glue(\spaceskip) 0.24774 plus 1.53333 minus 1.0222 +.....\OT1/cmr/m/it/10 p +.....\kern-0.51112 (font) +.....\OT1/cmr/m/it/10 a +.....\OT1/cmr/m/it/10 r +.....\kern-0.51112 (font) +.....\OT1/cmr/m/it/10 a +.....\discretionary (penalty 50) +......< \OT1/cmr/m/it/10 - +.....\OT1/cmr/m/it/10 g +.....\OT1/cmr/m/it/10 r +.....\kern-0.51112 (font) +.....\OT1/cmr/m/it/10 a +.....\OT1/cmr/m/it/10 p +.....\OT1/cmr/m/it/10 h +.....\OT1/cmr/m/it/10 . +.....\penalty 10000 .....\glue(\parfillskip) 0.0 plus 1.0fil .....\glue(\rightskip) 0.0 ....\penalty -51 ....\glue 10.0 plus 3.0 minus 5.0 -....\glue -12.5 plus -3.0 minus -5.0 +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 5.75002 +....\hbox(4.30554+0.0)x345.0, glue set 314.1666fil, direction TLT +.....\localpar +......\localinterlinepenalty=0 +......\localbrokenpenalty=0 +......\localleftbox=null +......\localrightbox=null +.....\hbox(0.0+0.0)x15.0, direction TLT +.....\pdfliteral page +.....\pdfliteral page +.....\OT1/cmr/m/n/10 x +.....\OT1/cmr/m/n/10 x +.....\OT1/cmr/m/n/10 x +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 ....\penalty -51 -....\glue 2.5 -....\glue 10.0 plus 3.0 minus 5.0 -....\glue -10.0 plus -3.0 minus -5.0 -....\glue 6.0 plus 1.0 minus 4.0 -....\glue(\parskip) 4.0 plus 2.0 minus 1.0 +....\glue 10.0 plus 4.0 minus 5.0 +....\glue(\parskip) 0.0 plus 1.0 ....\glue(\parskip) 0.0 -....\glue(\baselineskip) 2.55556 +....\glue(\baselineskip) 5.05556 ....\hbox(6.94444+1.94444)x345.0, glue set 82.23514fil, direction TLT .....\localpar ......\localinterlinepenalty=0 ......\localbrokenpenalty=0 ......\localleftbox=null ......\localrightbox=null -.....\hbox(0.0+0.0)x0.0, direction TLT .....\penalty 10000 .....\hbox(0.0+0.0)x0.0, direction TLT ......\hbox(0.0+0.0)x0.0, shifted -12.0, direction TLT @@ -382,8 +541,8 @@ Completed box being shipped out [1] (blocks-theorem-04.aux) Package tagpdf Info: closing structure 2 tagged /Document Package tagpdf Info: Finalizing the tagging structure: -(tagpdf) Writing out ~15 structure objects -(tagpdf) with ~11 'MC' leaf nodes. +(tagpdf) Writing out ~21 structure objects +(tagpdf) with ~14 'MC' leaf nodes. (tagpdf) Be patient if there are lots of objects! Package tagpdf Info: writing ParentTree Package tagpdf Info: writing IDTree diff --git a/required/latex-lab/testfiles-block/blocks-theorem-04.lvt b/required/latex-lab/testfiles-block/blocks-theorem-04.lvt index b24171273..9a98393d5 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-04.lvt +++ b/required/latex-lab/testfiles-block/blocks-theorem-04.lvt @@ -24,12 +24,19 @@ \START \showoutput +xxx + \begin{thm}[It has a name] \label{thm:B} - Another theorem \ldots + Another theorem \ldots \\ + with a second line \ldots + + And a second paragraph. \end{thm} +xxx + \begin{lem} A lemma needed for the proof of Theorem~\ref{thm:B}. \end{lem} diff --git a/required/latex-lab/testfiles-block/blocks-theorem-04.tlg b/required/latex-lab/testfiles-block/blocks-theorem-04.tlg index 8ac48d27d..98fc133ee 100644 --- a/required/latex-lab/testfiles-block/blocks-theorem-04.tlg +++ b/required/latex-lab/testfiles-block/blocks-theorem-04.tlg @@ -1,7 +1,18 @@ This is a generated file for the l3build validation system. Don't change this file in any respect. +Package tagpdf Info: Parent-Child 'Document' --> 'Part'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text-unit' on line ... +Package tagpdf Info: Parent-Child 'Document' --> 'P'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text' on line ... +Package tagpdf Info: Parent-Child 'P' --> 'MC'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'P' --> 'MC' on line ... +Package tagpdf Info: closing structure 6 tagged /text +Package tagpdf Info: closing structure 5 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Document' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Document' --> 'theorem-like' on line ... @@ -17,11 +28,11 @@ Package tagpdf Info: Parent-Child 'Caption' --> 'Lbl'. Package tagpdf Info: Parent-Child 'Lbl' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Lbl' --> 'MC' on line ... -Package tagpdf Info: closing structure 7 tagged /Lbl +Package tagpdf Info: closing structure 9 tagged /Lbl Package tagpdf Info: Parent-Child 'Caption' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Caption' --> 'MC' on line ... -Package tagpdf Info: closing structure 6 tagged /Caption +Package tagpdf Info: closing structure 8 tagged /Caption Package tagpdf Info: Parent-Child 'Sect' --> 'Part'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'text-unit' on line ... @@ -32,13 +43,35 @@ Package tagpdf Info: Parent-Child 'Sect' --> 'P'. Package tagpdf Info: Parent-Child 'P' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'P' --> 'MC' on line ... -Package tagpdf Info: closing structure 9 tagged /text -Package tagpdf Info: closing structure 8 tagged /text-unit +Package tagpdf Info: closing structure 11 tagged /text +Package tagpdf Info: closing structure 10 tagged /text-unit +Package tagpdf Info: Parent-Child 'Sect' --> 'Part'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Sect' --> 'text-unit' on line ... +Package tagpdf Info: Parent-Child 'Sect' --> 'P'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Sect' --> 'text' on line ... +Package tagpdf Info: Parent-Child 'P' --> 'MC'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'P' --> 'MC' on line ... +Package tagpdf Info: closing structure 13 tagged /text +Package tagpdf Info: closing structure 12 tagged /text-unit ==> blockenv common ending on input line ... ==> block-end on input line ... -Package tagpdf Info: closing structure 5 tagged /theorem-like +Package tagpdf Info: closing structure 7 tagged /theorem-like +Package tagpdf Info: Parent-Child 'Document' --> 'Part'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text-unit' on line ... +Package tagpdf Info: Parent-Child 'Document' --> 'P'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'Document' --> 'text' on line ... +Package tagpdf Info: Parent-Child 'P' --> 'MC'. +(tagpdf) Relation is 1 (='0..n') +(tagpdf) Rolemapped from: 'P' --> 'MC' on line ... +Package tagpdf Info: closing structure 15 tagged /text +Package tagpdf Info: closing structure 14 tagged /text-unit ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Document' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Document' --> 'theorem-like' on line ... @@ -54,8 +87,8 @@ Package tagpdf Info: Parent-Child 'Caption' --> 'Lbl'. Package tagpdf Info: Parent-Child 'Lbl' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Lbl' --> 'MC' on line ... -Package tagpdf Info: closing structure 12 tagged /Lbl -Package tagpdf Info: closing structure 11 tagged /Caption +Package tagpdf Info: closing structure 18 tagged /Lbl +Package tagpdf Info: closing structure 17 tagged /Caption Package tagpdf Info: Parent-Child 'Sect' --> 'Part'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Sect' --> 'text-unit' on line ... @@ -73,16 +106,16 @@ Package tagpdf Info: Parent-Child 'P' --> 'Link'. Package tagpdf Info: Parent-Child 'Link' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'Link' --> 'MC' on line ... -Package tagpdf Info: closing structure 15 tagged /Link +Package tagpdf Info: closing structure 21 tagged /Link Package tagpdf Info: text has been removed from the mc stack Package tagpdf Info: Parent-Child 'P' --> 'MC'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from: 'P' --> 'MC' on line ... ==> blockenv common ending on input line ... -Package tagpdf Info: closing structure 14 tagged /text -Package tagpdf Info: closing structure 13 tagged /text-unit +Package tagpdf Info: closing structure 20 tagged /text +Package tagpdf Info: closing structure 19 tagged /text-unit ==> block-end on input line ... -Package tagpdf Info: closing structure 10 tagged /theorem-like +Package tagpdf Info: closing structure 16 tagged /theorem-like The sequence \g__tag_mc_main_marks_seq is empty > . Completed box being shipped out [1] @@ -117,31 +150,50 @@ Completed box being shipped out [1] ....\glue 0.0 plus 1.0fil ....\pdfrunninglinkoff ....\pdfliteral page{/Artifact BMC} -....\marks4{b-,10,-1,} -....\marks4{b+,10,-1,} +....\marks4{b-,13,-1,} +....\marks4{b+,13,-1,} ....\hbox(0.0+0.0)x345.0 .....\hbox(0.0+0.0)x345.0 ....\pdfliteral page{EMC} -....\marks4{e-,10,2,} -....\marks4{e+,10,2,} +....\marks4{e-,13,2,} +....\marks4{e+,13,2,} ....\pdfrunninglinkon ...\glue 25.0 ...\glue(\lineskip) 0.0 -...\vbox(550.0+0.0)x345.0, glue set 507.94574fil +...\vbox(550.0+0.0)x345.0, glue set 439.953fil ....\hbox(0.0+0.0)x0.0 ....\write-{} ....\pdfdest name{Doc-Start} xyz ....\pdfdest struct10 name{Doc-Start} xyz -....\glue(\topskip) 2.50183 +....\glue(\topskip) 5.6955 +....\hbox(4.3045+0.0)x345.0, glue set 314.17053fil +.....\write1{\new@label@record{mcid-1}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{1}{tagmcid}{\__property_code_tagmcid: }}} +.....\pdfliteral shipout page{/text <> BDC} +.....\hbox(0.0+0.0)x15.0 +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{b-,1,6,text,,,} +....\marks4{b+,1,6,text,,,} +....\marks4{e-,1,6,} +....\marks4{e+,1,6,} +....\penalty -51 +....\glue 10.0 plus 4.0 minus 5.0 +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 4.50183 ....\hbox(7.49817+2.49939)x345.0, glue set 104.24785fil -.....\hbox(0.0+0.0)x0.0 .....\penalty 10000 .....\hbox(0.0+0.0)x0.0 ......\hbox(0.0+0.0)x0.0, shifted -12.0 .......\pdfdest name{thm.0.1} xyz -.......\pdfdest struct13 name{thm.0.1} xyz +.......\pdfdest struct15 name{thm.0.1} xyz .......\penalty 10000 -.....\write1{\new@label@record{mcid-1}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{1}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-2}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{2}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Caption <> BDC} .....\T1/cmr/bx/n/10 T .....\T1/cmr/bx/n/10 h @@ -152,13 +204,13 @@ Completed box being shipped out [1] .....\T1/cmr/bx/n/10 m .....\glue 3.8324 plus 1.9162 minus 1.27747 .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-2}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{2}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-3}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{3}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Lbl <> BDC} .....\T1/cmr/bx/n/10 0 .....\T1/cmr/bx/n/10 . .....\T1/cmr/bx/n/10 1 .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-3}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{3}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-4}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{4}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Caption <> BDC} .....\glue 3.8324 plus 1.9162 minus 1.27747 .....\T1/cmr/bx/n/10 ( @@ -177,7 +229,7 @@ Completed box being shipped out [1] .....\T1/cmr/bx/n/10 e .....\T1/cmr/bx/n/10 ) .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-4}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{4}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-5}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{5}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/text <> BDC} .....\glue 4.99878 .....\write1{\newlabel{thm:B}{{0.1}{\thepage }{It has a name}{thm.0.1}{}}} @@ -208,46 +260,137 @@ Completed box being shipped out [1] .....\kern 1.53294 .....\T1/cmr/m/it/10 . .....\kern 1.53294 +.....\penalty 10000 +.....\glue 0.0 plus 1.0fil +.....\penalty -10000 +.....\glue(\rightskip) 0.0 +....\marks4{b-,2,8,Caption,,,} +....\marks4{b+,2,8,Caption,,,} +....\marks4{e-,2,8,} +....\marks4{e+,2,8,} +....\marks4{b-,3,9,Lbl,,,} +....\marks4{b+,3,9,Lbl,,,} +....\marks4{e-,3,9,} +....\marks4{e+,3,9,} +....\marks4{b-,4,8,Caption,,,} +....\marks4{b+,4,8,Caption,,,} +....\marks4{e-,4,8,} +....\marks4{e+,4,8,} +....\marks4{b-,5,11,text,,,} +....\marks4{b+,5,11,text,,,} +....\penalty 300 +....\glue(\baselineskip) 2.6134 +....\hbox(6.8872+0.0)x345.0, glue set 249.70122fil +.....\T1/cmr/m/it/10 w +.....\T1/cmr/m/it/10 i +.....\T1/cmr/m/it/10 t +.....\T1/cmr/m/it/10 h +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 a +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 s +.....\T1/cmr/m/it/10 e +.....\kern-0.511 +.....\T1/cmr/m/it/10 c +.....\kern-0.511 +.....\T1/cmr/m/it/10 o +.....\T1/cmr/m/it/10 n +.....\T1/cmr/m/it/10 d +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 l +.....\T1/cmr/m/it/10 i +.....\T1/cmr/m/it/10 n +.....\T1/cmr/m/it/10 e +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 . +.....\kern 1.53294 +.....\T1/cmr/m/it/10 . +.....\kern 1.53294 +.....\T1/cmr/m/it/10 . +.....\kern 1.53294 .....\pdfliteral page{EMC} .....\penalty 10000 .....\glue(\parfillskip) 0.0 plus 1.0fil .....\glue(\rightskip) 0.0 -....\marks4{b-,1,6,Caption,,,} -....\marks4{b+,1,6,Caption,,,} -....\marks4{e-,1,6,} -....\marks4{e+,1,6,} -....\marks4{b-,2,7,Lbl,,,} -....\marks4{b+,2,7,Lbl,,,} -....\marks4{e-,2,7,} -....\marks4{e+,2,7,} -....\marks4{b-,3,6,Caption,,,} -....\marks4{b+,3,6,Caption,,,} -....\marks4{e-,3,6,} -....\marks4{e+,3,6,} -....\marks4{b-,4,9,text,,,} -....\marks4{b+,4,9,text,,,} -....\marks4{e-,4,9,} -....\marks4{e+,4,9,} +....\marks4{e-,5,11,} +....\marks4{e+,5,11,} +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 5.1128 +....\hbox(6.8872+1.94397)x345.0, glue set 222.9263fil +.....\write1{\new@label@record{mcid-6}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{6}{tagmcid}{\__property_code_tagmcid: }}} +.....\pdfliteral shipout page{/text <> BDC} +.....\hbox(0.0+0.0)x15.0 +.....\T1/cmr/m/it/10 A +.....\kern-0.2555 +.....\T1/cmr/m/it/10 n +.....\T1/cmr/m/it/10 d +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 a +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 s +.....\T1/cmr/m/it/10 e +.....\kern-0.511 +.....\T1/cmr/m/it/10 c +.....\kern-0.511 +.....\T1/cmr/m/it/10 o +.....\T1/cmr/m/it/10 n +.....\T1/cmr/m/it/10 d +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 p +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 r +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 g +.....\T1/cmr/m/it/10 r +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 p +.....\T1/cmr/m/it/10 h +.....\T1/cmr/m/it/10 . +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{b-,6,13,text,,,} +....\marks4{b+,6,13,text,,,} +....\marks4{e-,6,13,} +....\marks4{e+,6,13,} ....\penalty -51 ....\glue 10.0 plus 3.0 minus 5.0 -....\glue -12.49939 plus -3.0 minus -5.0 +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 5.75153 +....\hbox(4.3045+0.0)x345.0, glue set 314.17053fil +.....\write1{\new@label@record{mcid-7}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{7}{tagmcid}{\__property_code_tagmcid: }}} +.....\pdfliteral shipout page{/text <> BDC} +.....\hbox(0.0+0.0)x15.0 +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{b-,7,15,text,,,} +....\marks4{b+,7,15,text,,,} +....\marks4{e-,7,15,} +....\marks4{e+,7,15,} ....\penalty -51 -....\glue 2.49939 -....\glue 10.0 plus 3.0 minus 5.0 -....\glue -10.0 plus -3.0 minus -5.0 -....\glue 6.0 plus 1.0 minus 4.0 -....\glue(\parskip) 4.0 plus 2.0 minus 1.0 +....\glue 10.0 plus 4.0 minus 5.0 +....\glue(\parskip) 0.0 plus 1.0 ....\glue(\parskip) 0.0 -....\glue(\baselineskip) 2.59952 +....\glue(\baselineskip) 5.0989 ....\hbox(6.9011+1.94397)x345.0, glue set 82.29774fil -.....\hbox(0.0+0.0)x0.0 .....\penalty 10000 .....\hbox(0.0+0.0)x0.0 ......\hbox(0.0+0.0)x0.0, shifted -12.0 .......\pdfdest name{thm.0.2} xyz -.......\pdfdest struct18 name{thm.0.2} xyz +.......\pdfdest struct24 name{thm.0.2} xyz .......\penalty 10000 -.....\write1{\new@label@record{mcid-5}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{5}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-8}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{8}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Caption <> BDC} .....\T1/cmr/bx/n/10 L .....\T1/cmr/bx/n/10 e @@ -256,13 +399,13 @@ Completed box being shipped out [1] .....\T1/cmr/bx/n/10 a .....\glue 3.8324 plus 1.9162 minus 1.27747 .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-6}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{6}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-9}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{9}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Lbl <> BDC} .....\T1/cmr/bx/n/10 0 .....\T1/cmr/bx/n/10 . .....\T1/cmr/bx/n/10 2 .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-7}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{7}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-10}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{10}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/text <> BDC} .....\glue 4.99878 .....\T1/cmr/m/it/10 A @@ -314,7 +457,7 @@ Completed box being shipped out [1] .....\penalty 10000 .....\glue 3.5769 plus 1.53294 minus 1.02197 .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-8}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{8}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-11}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{11}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Link <> BDC} .....\pdfstartlink(*+*)x* attr{/Contents /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 1 } action goto name{thm.0.1} .....\T1/cmr/m/it/10 0 @@ -323,33 +466,33 @@ Completed box being shipped out [1] .....\pdfendlink .....\write1{\new@label@record{@tag@objr@page@1}{{tagabspage}{\__property_code_tagabspage: }}} .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-9}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{9}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-12}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{12}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/text <> BDC} .....\T1/cmr/m/it/10 . .....\pdfliteral page{EMC} .....\penalty 10000 .....\glue(\parfillskip) 0.0 plus 1.0fil .....\glue(\rightskip) 0.0 -....\marks4{b-,5,11,Caption,,,} -....\marks4{b+,5,11,Caption,,,} -....\marks4{e-,5,11,} -....\marks4{e+,5,11,} -....\marks4{b-,6,12,Lbl,,,} -....\marks4{b+,6,12,Lbl,,,} -....\marks4{e-,6,12,} -....\marks4{e+,6,12,} -....\marks4{b-,7,14,text,,,} -....\marks4{b+,7,14,text,,,} -....\marks4{e-,7,14,} -....\marks4{e+,7,14,} -....\marks4{b-,8,15,Link,,,} -....\marks4{b+,8,15,Link,,,} -....\marks4{e-,8,15,} -....\marks4{e+,8,15,} -....\marks4{b-,9,14,text,,,} -....\marks4{b+,9,14,text,,,} -....\marks4{e-,9,14,} -....\marks4{e+,9,14,} +....\marks4{b-,8,17,Caption,,,} +....\marks4{b+,8,17,Caption,,,} +....\marks4{e-,8,17,} +....\marks4{e+,8,17,} +....\marks4{b-,9,18,Lbl,,,} +....\marks4{b+,9,18,Lbl,,,} +....\marks4{e-,9,18,} +....\marks4{e+,9,18,} +....\marks4{b-,10,20,text,,,} +....\marks4{b+,10,20,text,,,} +....\marks4{e-,10,20,} +....\marks4{e+,10,20,} +....\marks4{b-,11,21,Link,,,} +....\marks4{b+,11,21,Link,,,} +....\marks4{e-,11,21,} +....\marks4{e+,11,21,} +....\marks4{b-,12,20,text,,,} +....\marks4{b+,12,20,text,,,} +....\marks4{e-,12,20,} +....\marks4{e+,12,20,} ....\penalty -51 ....\glue 10.0 plus 3.0 minus 5.0 ....\glue -1.94397 @@ -362,8 +505,8 @@ Completed box being shipped out [1] ....\glue 0.0 plus 0.0001fil ...\pdfrunninglinkoff ...\pdfliteral page{/Artifact BMC} -...\marks4{b-,11,-1,} -...\marks4{b+,11,-1,} +...\marks4{b-,14,-1,} +...\marks4{b+,14,-1,} ...\glue(\baselineskip) 23.5849 ...\hbox(6.4151+0.0)x345.0 ....\hbox(6.4151+0.0)x345.0, glue set 170.00061fil @@ -371,8 +514,8 @@ Completed box being shipped out [1] .....\T1/cmr/m/n/10 1 .....\glue 0.0 plus 1.0fil ...\pdfliteral page{EMC} -...\marks4{e-,11,2,} -...\marks4{e+,11,2,} +...\marks4{e-,14,2,} +...\marks4{e+,14,2,} ...\pdfrunninglinkon .\kern 0.0 .\kern 0.0 @@ -382,8 +525,8 @@ Completed box being shipped out [1] (blocks-theorem-04.aux) Package tagpdf Info: closing structure 2 tagged /Document Package tagpdf Info: Finalizing the tagging structure: -(tagpdf) Writing out ~15 structure objects -(tagpdf) with ~11 'MC' leaf nodes. +(tagpdf) Writing out ~21 structure objects +(tagpdf) with ~14 'MC' leaf nodes. (tagpdf) Be patient if there are lots of objects! Package tagpdf Info: writing ParentTree Package tagpdf Info: writing IDTree diff --git a/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg b/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg index a0e6ee687..b940ba37c 100644 --- a/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg +++ b/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg @@ -1,5 +1,10 @@ This is a generated file for the l3build validation system. Don't change this file in any respect. +before ---> \leftmargin = 25.00003pt +verse ---> \itemindent = -15.00002pt +verse ---> \parindent = -15.00002pt +verse ---> \listparindent = 0.0pt +verse ---> \leftmargin = 40.00005pt Completed box being shipped out [1] \vbox(633.0+0.0)x407.0, direction TLT .\hbox(0.0+0.0)x0.0, direction TLT @@ -18,7 +23,7 @@ Completed box being shipped out [1] ....\hbox(0.0+0.0)x345.0, direction TLT ..\glue 25.0 ..\glue(\lineskip) 0.0 -..\vbox(550.0+0.0)x345.0, glue set 459.95087fil, direction TLT +..\vbox(550.0+0.0)x345.0, glue set 373.96005fil, direction TLT ...\latelua0{ltx.__pdf.Page.Resources.ExtGState=true} ...\latelua0{ltx.pdf.Page_Resources_gpush(tex.count["g_shipout_readonly_int"])} ...\write-{} @@ -161,7 +166,326 @@ Completed box being shipped out [1] ....\glue(\rightskip) 0.0 ...\penalty -51 ...\glue 10.0 plus 3.0 minus 5.0 -...\glue -1.94444 +...\glue -11.94444 plus -3.0 minus -5.0 +...\penalty -51 +...\glue 1.94444 +...\glue 10.0 plus 3.0 minus 5.0 +...\glue -10.0 plus -3.0 minus -5.0 +...\glue 6.0 plus 1.0 minus 4.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.11111 +...\hbox(6.94444+0.0)x279.99992, glue set 147.55528fil, shifted 40.00005, direction TLT +....\localpar +.....\localinterlinepenalty=0 +.....\localbrokenpenalty=0 +.....\localleftbox=null +.....\localrightbox=null +....\hbox(0.0+0.0)x-15.00002, direction TLT +.....\glue -40.00005 +.....\hbox(0.0+0.0)x20.00003, glue set 20.00003fil, direction TLT +......\glue 0.0 plus 1.0fil minus 1.0fil +......\hbox(0.0+0.0)x0.0, direction TLT +.......\glue 0.0 plus 1.0fil +.......\hbox(0.0+0.0)x0.0, direction TLT +.....\glue 5.0 +....\penalty 0 +....\OT1/cmr/m/n/10 T +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 i +....\OT1/cmr/m/n/10 s +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 n +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 n +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +.....= \kern-0.27779 (font) +....\OT1/cmr/m/n/10 v +....\OT1/cmr/m/n/10 i +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 n +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +....\OT1/cmr/m/n/10 m +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 n +....\kern-0.27779 (font) +....\OT1/cmr/m/n/10 t +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 f +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 r +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 v +....\kern-0.27779 (font) +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 s +....\OT1/cmr/m/n/10 e +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue -4.0 plus -2.0 minus -1.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 5.05556 +...\hbox(6.94444+1.94444)x279.99992, glue set 133.05525fil, shifted 40.00005, direction TLT +....\localpar +.....\localinterlinepenalty=0 +.....\localbrokenpenalty=0 +.....\localleftbox=null +.....\localrightbox=null +....\hbox(0.0+0.0)x-15.00002, direction TLT +....\OT1/cmr/m/n/10 W +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 s +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 f +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 a +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 u +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 s +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 m +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 p +....\kern0.27779 (font) +....\OT1/cmr/m/n/10 o +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +.....= \kern0.27779 (font) +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 s +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 w +....\OT1/cmr/m/n/10 i +....\OT1/cmr/m/n/10 l +....\OT1/cmr/m/n/10 l +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 c +....\OT1/cmr/m/n/10 u +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 s +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 . +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.11111 +...\hbox(6.94444+1.94444)x279.99992, glue set 199.22194fil, shifted 40.00005, direction TLT +....\localpar +.....\localinterlinepenalty=0 +.....\localbrokenpenalty=0 +.....\localleftbox=null +.....\localrightbox=null +....\hbox(0.0+0.0)x-15.00002, direction TLT +....\OT1/cmr/m/n/10 F +....\kern-0.83334 (font) +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 r +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 i +....\OT1/cmr/m/n/10 n +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +....\OT1/cmr/m/n/10 s +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 d +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 f +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 m +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 k +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +....\OT1/cmr/m/n/10 i +....\OT1/cmr/m/n/10 n +....\OT1/cmr/m/n/10 g +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue -4.0 plus -2.0 minus -1.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.11111 +...\hbox(6.94444+1.94444)x279.99992, glue set 175.24973fil, shifted 40.00005, direction TLT +....\localpar +.....\localinterlinepenalty=0 +.....\localbrokenpenalty=0 +.....\localleftbox=null +.....\localrightbox=null +....\hbox(0.0+0.0)x-15.00002, direction TLT +....\OT1/cmr/m/n/10 T +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 m +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 d +....\OT1/cmr/m/n/10 o +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 l +....\OT1/cmr/m/n/10 l +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 l +....\OT1/cmr/m/n/10 i +....\OT1/cmr/m/n/10 n +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 b +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 k +....\OT1/cmr/m/n/10 , +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue -4.0 plus -2.0 minus -1.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.11111 +...\hbox(6.94444+1.94444)x279.99992, glue set 0.00381, shifted 40.00005, direction TLT +....\localpar +.....\localinterlinepenalty=0 +.....\localbrokenpenalty=0 +.....\localleftbox=null +.....\localrightbox=null +....\hbox(0.0+0.0)x-15.00002, direction TLT +....\OT1/cmr/m/n/10 I +....\OT1/cmr/m/n/10 t +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 l +....\discretionary (penalty 50) +.....< \OT1/cmr/m/n/10 - +....\OT1/cmr/m/n/10 l +....\OT1/cmr/m/n/10 o +....\kern-0.27779 (font) +....\OT1/cmr/m/n/10 w +....\OT1/cmr/m/n/10 s +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 m +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 o +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 p +....\OT1/cmr/m/n/10 u +....\OT1/cmr/m/n/10 t +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 o +....\kern0.27779 (font) +....\OT1/cmr/m/n/10 o +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 m +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 n +....\kern-0.27779 (font) +....\OT1/cmr/m/n/10 y +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 w +....\kern-0.27779 (font) +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 d +....\OT1/cmr/m/n/10 s +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 n +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 a +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 l +....\OT1/cmr/m/n/10 i +....\OT1/cmr/m/n/10 n +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 w +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 n +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 y +....\OT1/cmr/m/n/10 ' +....\OT1/cmr/m/n/10 d +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 a +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 h +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 r +....\glue(\rightskip) 0.0 +...\penalty 300 +...\glue(\baselineskip) 3.11111 +...\hbox(6.94444+0.0)x279.99992, glue set 187.38869fil, shifted 40.00005, direction TLT +....\OT1/cmr/m/n/10 b +....\kern0.27779 (font) +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 f +....\OT1/cmr/m/n/10 o +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 c +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 d +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 o +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 b +....\kern0.27779 (font) +....\OT1/cmr/m/n/10 e +....\glue(\spaceskip) 3.33333 plus 1.66666 minus 1.11111 +....\OT1/cmr/m/n/10 t +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 r +....\OT1/cmr/m/n/10 s +....\OT1/cmr/m/n/10 e +....\OT1/cmr/m/n/10 . +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\penalty -51 +...\glue 10.0 plus 3.0 minus 5.0 ...\glue 0.0 plus 1.0fil ...\glue 0.0 ...\glue 0.0 plus 0.0001fil diff --git a/required/latex-lab/testfiles-block/blocks-verse-01.lvt b/required/latex-lab/testfiles-block/blocks-verse-01.lvt index 9ea2d202a..1fc060a68 100644 --- a/required/latex-lab/testfiles-block/blocks-verse-01.lvt +++ b/required/latex-lab/testfiles-block/blocks-verse-01.lvt @@ -5,6 +5,7 @@ \begin{document} \START \showoutput + xxxx\\xxxx \begin{verse} @@ -15,4 +16,19 @@ xxxx\\xxxx \newline line long line long line \end{verse} +\typeout{before ---> \leftmargin = \the\leftmargin} + +\begin{verse} +\typeout{verse ---> \itemindent = \the\itemindent} +\typeout{verse ---> \parindent = \the\parindent} +\typeout{verse ---> \listparindent = \the\listparindent} +\typeout{verse ---> \leftmargin = \the\leftmargin} + There is an environment for verse \\ + Whose feature some poets will curse. + + For instead of making\\ + Them do all the line break, \\ + It allows them to put too many words on a line when they'd rather be forced to be terse. +\end{verse} + \end{document} diff --git a/required/latex-lab/testfiles-block/blocks-verse-01.tlg b/required/latex-lab/testfiles-block/blocks-verse-01.tlg index ce1116441..462aa8c25 100644 --- a/required/latex-lab/testfiles-block/blocks-verse-01.tlg +++ b/required/latex-lab/testfiles-block/blocks-verse-01.tlg @@ -1,5 +1,10 @@ This is a generated file for the l3build validation system. Don't change this file in any respect. +before ---> \leftmargin = 24.9939pt +verse ---> \itemindent = -14.99634pt +verse ---> \parindent = -14.99634pt +verse ---> \listparindent = 0.0pt +verse ---> \leftmargin = 39.99023pt Completed box being shipped out [1] \vbox(633.0+0.0)x407.0 .\hbox(0.0+0.0)x0.0 @@ -17,7 +22,7 @@ Completed box being shipped out [1] ....\hbox(0.0+0.0)x345.0 ..\glue 25.0 ..\glue(\lineskip) 0.0 -..\vbox(550.0+0.0)x345.0, glue set 459.95087fil +..\vbox(550.0+0.0)x345.0, glue set 373.96005fil ...\write-{} ...\glue(\topskip) 5.6955 ...\hbox(4.3045+0.0)x345.0, glue set 308.89404fil @@ -143,7 +148,285 @@ Completed box being shipped out [1] ....\glue(\rightskip) 0.0 ...\penalty -51 ...\glue 10.0 plus 3.0 minus 5.0 -...\glue -1.94397 +...\glue -11.94397 plus -3.0 minus -5.0 +...\penalty -51 +...\glue 1.94397 +...\glue 10.0 plus 3.0 minus 5.0 +...\glue -10.0 plus -3.0 minus -5.0 +...\glue 6.0 plus 1.0 minus 4.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.16882 +...\hbox(6.8872+0.0)x280.01587, glue set 147.60376fil, shifted 39.99023 +....\hbox(0.0+0.0)x-14.99634 +.....\glue -39.99023 +.....\hbox(0.0+0.0)x19.99512, glue set 19.99512fil +......\glue 0.0 plus 1.0fil minus 1.0fil +......\hbox(0.0+0.0)x0.0 +.......\glue 0.0 plus 1.0fil +.......\hbox(0.0+0.0)x0.0 +.....\glue 4.99878 +....\penalty 0 +....\T1/cmr/m/n/10 T +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 i +....\T1/cmr/m/n/10 s +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 n +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 n +....\kern-0.27771 +....\T1/cmr/m/n/10 v +....\T1/cmr/m/n/10 i +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 n +....\T1/cmr/m/n/10 m +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 n +....\kern-0.27771 +....\T1/cmr/m/n/10 t +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 f +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 r +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 v +....\kern-0.27771 +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 s +....\T1/cmr/m/n/10 e +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue -4.0 plus -2.0 minus -1.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 5.1128 +...\hbox(6.8872+1.94397)x280.01587, glue set 133.1073fil, shifted 39.99023 +....\hbox(0.0+0.0)x-14.99634 +....\T1/cmr/m/n/10 W +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 s +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 f +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 u +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 s +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 m +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 p +....\kern0.27771 +....\T1/cmr/m/n/10 o +....\kern0.27771 +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 s +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 w +....\T1/cmr/m/n/10 i +....\T1/cmr/m/n/10 l +....\T1/cmr/m/n/10 l +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 c +....\T1/cmr/m/n/10 u +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 s +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 . +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.16882 +...\hbox(6.8872+1.94397)x280.01587, glue set 199.25781fil, shifted 39.99023 +....\hbox(0.0+0.0)x-14.99634 +....\T1/cmr/m/n/10 F +....\kern-0.83313 +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 r +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 i +....\T1/cmr/m/n/10 n +....\T1/cmr/m/n/10 s +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 d +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 f +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 m +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 k +....\T1/cmr/m/n/10 i +....\T1/cmr/m/n/10 n +....\T1/cmr/m/n/10 g +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue -4.0 plus -2.0 minus -1.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.16882 +...\hbox(6.8872+1.94397)x280.01587, glue set 175.29144fil, shifted 39.99023 +....\hbox(0.0+0.0)x-14.99634 +....\T1/cmr/m/n/10 T +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 m +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 d +....\T1/cmr/m/n/10 o +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 l +....\T1/cmr/m/n/10 l +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 l +....\T1/cmr/m/n/10 i +....\T1/cmr/m/n/10 n +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 b +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 k +....\T1/cmr/m/n/10 , +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\glue -4.0 plus -2.0 minus -1.0 +...\glue(\parskip) 4.0 plus 2.0 minus 1.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.16882 +...\hbox(6.8872+1.94397)x280.01587, glue set 0.00774, shifted 39.99023 +....\hbox(0.0+0.0)x-14.99634 +....\T1/cmr/m/n/10 I +....\T1/cmr/m/n/10 t +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 l +....\T1/cmr/m/n/10 l +....\T1/cmr/m/n/10 o +....\kern-0.27771 +....\T1/cmr/m/n/10 w +....\T1/cmr/m/n/10 s +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 m +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 o +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 p +....\T1/cmr/m/n/10 u +....\T1/cmr/m/n/10 t +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 o +....\kern0.27771 +....\T1/cmr/m/n/10 o +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 m +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 n +....\kern-0.27771 +....\T1/cmr/m/n/10 y +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 w +....\kern-0.27771 +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 d +....\T1/cmr/m/n/10 s +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 n +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 a +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 l +....\T1/cmr/m/n/10 i +....\T1/cmr/m/n/10 n +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 w +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 n +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 y +....\T1/cmr/m/n/10 ' +....\T1/cmr/m/n/10 d +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 a +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 h +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 r +....\glue(\rightskip) 0.0 +...\penalty 300 +...\glue(\baselineskip) 3.16882 +...\hbox(6.8872+0.0)x280.01587, glue set 187.42737fil, shifted 39.99023 +....\T1/cmr/m/n/10 b +....\kern0.27771 +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 f +....\T1/cmr/m/n/10 o +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 c +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 d +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 o +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 b +....\kern0.27771 +....\T1/cmr/m/n/10 e +....\glue 3.33252 plus 1.66626 minus 1.11084 +....\T1/cmr/m/n/10 t +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 r +....\T1/cmr/m/n/10 s +....\T1/cmr/m/n/10 e +....\T1/cmr/m/n/10 . +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\penalty -51 +...\glue 10.0 plus 3.0 minus 5.0 ...\glue 0.0 plus 1.0fil ...\glue 0.0 ...\glue 0.0 plus 0.0001fil diff --git a/required/latex-lab/testfiles-block/tagging-0767.lvt b/required/latex-lab/testfiles-block/tagging-0767.lvt new file mode 100644 index 000000000..8fa0935be --- /dev/null +++ b/required/latex-lab/testfiles-block/tagging-0767.lvt @@ -0,0 +1,106 @@ + +\DocumentMetadata{ + testphase=phase-III + ,uncompress +% ,pdfversion=2.0 + ,debug={ +% para, +% log=vv + } +} + +\DebugBlocksOn + + +\documentclass{article} + +\input{regression-test} + +\usepackage{kantlipsum} + +\newtheorem{theorem}{Theorem} + +\begin{document} + +\START + +\typeout{toplevel ---> \parskip = \the\parskip} +\typeout{toplevel ---> \parindent = \the\parindent} +\typeout{toplevel ---> \listparindent = \the\listparindent} + + +\begin{theorem} +\typeout{theorem ---> \parskip = \the\parskip} +\typeout{theorem ---> \parindent = \the\parindent} +\typeout{theorem ---> \listparindent = \the\listparindent} + \kant[1][1-2] + + \kant[2][1-2] + \begin{enumerate} + \typeout{theorem-enumerate-1 ---> \parskip = \the\parskip} + \typeout{theorem-enumerate-1 ---> \parindent = \the\parindent} + \typeout{theorem-enumerate-1 ---> \listparindent = \the\listparindent} + \item abc + \item \kant[3][1-2] + + \kant[4][1-2] + \begin{enumerate} + \typeout{theorem-enumerate-2 ---> \parskip = \the\parskip} + \typeout{theorem-enumerate-2 ---> \parindent = \the\parindent} + \typeout{theorem-enumerate-2 ---> \listparindent = \the\listparindent} + \item abc + \item \kant[3][1-2] + + \kant[4][1-2] + \end{enumerate} + \end{enumerate} +\end{theorem} + + +\setlength\listparindent{22pt} + +\typeout{toplevel ---> \parskip = \the\parskip} +\typeout{toplevel ---> \parindent = \the\parindent} +\typeout{toplevel ---> \listparindent = \the\listparindent} + +\begin{theorem} +\typeout{theorem ---> \parskip = \the\parskip} +\typeout{theorem ---> \parindent = \the\parindent} +\typeout{theorem ---> \listparindent = \the\listparindent} + \kant[1][1-2] + + \kant[2][1-2] + \begin{enumerate} + \typeout{theorem-enumerate-1 ---> \parskip = \the\parskip} + \typeout{theorem-enumerate-1 ---> \parindent = \the\parindent} + \typeout{theorem-enumerate-1 ---> \listparindent = \the\listparindent} + \item abc + \item \kant[3][1-2] + + + \kant[4][1-2] + \begin{enumerate} +\setlength\listparindent{33pt} % ignored here + \typeout{theorem-enumerate-2 ---> \parskip = \the\parskip} + \typeout{theorem-enumerate-2 ---> \parindent = \the\parindent} + \typeout{theorem-enumerate-2 ---> \listparindent = \the\listparindent} + \item abc + \item \kant[3][1-2] + + \kant[4][1-2] + \end{enumerate} + \end{enumerate} +\end{theorem} + + +\begin{enumerate} +\typeout{enumerate-1 ---> \parskip = \the\parskip} +\typeout{enumerate-1 ---> \parindent = \the\parindent} +\typeout{theorem-enumerate-1 ---> \listparindent = \the\listparindent} + \item abc + \item \kant[3][1-2] + + \kant[4][1-2] +\end{enumerate} + +\end{document} diff --git a/required/latex-lab/testfiles-block/tagging-0767.tlg b/required/latex-lab/testfiles-block/tagging-0767.tlg new file mode 100644 index 000000000..8912f7a37 --- /dev/null +++ b/required/latex-lab/testfiles-block/tagging-0767.tlg @@ -0,0 +1,129 @@ +This is a generated file for the l3build validation system. +Don't change this file in any respect. +toplevel ---> \parskip = 0.0pt plus 1.0pt +toplevel ---> \parindent = 15.0pt +toplevel ---> \listparindent = 0.0pt +==> theorem-like-env-start +==> use instance: theoremblock-0 +==> increment P on input line ... +theorem ---> \parskip = 0.0pt plus 1.0pt +theorem ---> \parindent = 15.0pt +theorem ---> \listparindent = 0.0pt +==> enumerate-env-start +==> use instance: list-1 +==> @endpe=false on input line ... +==> use instance: enum-1 +==> template:list:std +==> template:list:std end +theorem-enumerate-1 ---> \parskip = 4.0pt plus 2.0pt minus 1.0pt +theorem-enumerate-1 ---> \parindent = 0.0pt +theorem-enumerate-1 ---> \listparindent = 0.0pt +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> item everypar on input line ... +==> enumerate-env-start +==> use instance: list-2 +==> @endpe=false on input line ... +==> use instance: enum-2 +==> template:list:std +==> template:list:std end +theorem-enumerate-2 ---> \parskip = 2.0pt plus 1.0pt minus 1.0pt +theorem-enumerate-2 ---> \parindent = 0.0pt +theorem-enumerate-2 ---> \listparindent = 0.0pt +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> item everypar on input line ... +==> blockenv common ending on input line ... +==> blockenv common ending on input line ... +==> Structure-end P at list-end on input line ... +==> blockenv common ending on input line ... +==> block-end on input line ... +==> close /text-unit on input line ... +toplevel ---> \parskip = 0.0pt plus 1.0pt +toplevel ---> \parindent = 15.0pt +toplevel ---> \listparindent = 22.0pt +==> theorem-like-env-start +==> use instance: theoremblock-0 +==> increment P on input line ... +theorem ---> \parskip = 0.0pt plus 1.0pt +theorem ---> \parindent = 15.0pt +theorem ---> \listparindent = 22.0pt +==> enumerate-env-start +==> use instance: list-1 +==> @endpe=false on input line ... +==> use instance: enum-1 +==> template:list:std +==> template:list:std end +theorem-enumerate-1 ---> \parskip = 4.0pt plus 2.0pt minus 1.0pt +theorem-enumerate-1 ---> \parindent = 0.0pt +theorem-enumerate-1 ---> \listparindent = 22.0pt +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +[1 +] +==> item everypar on input line ... +==> enumerate-env-start +==> use instance: list-2 +==> @endpe=false on input line ... +==> use instance: enum-2 +==> template:list:std +==> template:list:std end +theorem-enumerate-2 ---> \parskip = 2.0pt plus 1.0pt minus 1.0pt +theorem-enumerate-2 ---> \parindent = 0.0pt +theorem-enumerate-2 ---> \listparindent = 33.0pt +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> item everypar on input line ... +==> blockenv common ending on input line ... +==> blockenv common ending on input line ... +==> Structure-end P at list-end on input line ... +==> blockenv common ending on input line ... +==> block-end on input line ... +==> close /text-unit on input line ... +==> enumerate-env-start +==> use instance: list-1 +==> @endpe=false on input line ... +==> use instance: enum-1 +==> template:list:std +==> template:list:std end +enumerate-1 ---> \parskip = 4.0pt plus 2.0pt minus 1.0pt +enumerate-1 ---> \parindent = 0.0pt +theorem-enumerate-1 ---> \listparindent = 22.0pt +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> template:item:std +==> item everypar on input line ... +==> increment P on input line ... +==> item everypar on input line ... +==> blockenv common ending on input line ... +==> flattened=false on input line ... +==> Structure-end text-unit after displayblock on input line ... +[2] (tagging-0767.aux) +Package tagpdf Info: Finalizing the tagging structure: +(tagpdf) Writing out ~88 structure objects +(tagpdf) with ~37 'MC' leaf nodes. +(tagpdf) Be patient if there are lots of objects! +Package tagpdf Info: writing ParentTree +Package tagpdf Info: writing IDTree +Package tagpdf Info: writing RoleMap +Package tagpdf Info: writing ClassMap +Package tagpdf Info: writing NameSpaces +Package tagpdf Info: writing StructElems +Package tagpdf Info: writing Root diff --git a/required/latex-lab/testfiles-firstaid/test-amsart-733.lvt b/required/latex-lab/testfiles-firstaid/test-amsart-733.lvt index 73fe403d4..dfb207983 100644 --- a/required/latex-lab/testfiles-firstaid/test-amsart-733.lvt +++ b/required/latex-lab/testfiles-firstaid/test-amsart-733.lvt @@ -14,6 +14,8 @@ % \newline = linebreak {\thmnumber{#2 }\thmname{#1}\thmnote{: #3}}% Thm head spec + + \theoremstyle{citing} \newtheorem{theorem}{Theorem} @@ -22,14 +24,18 @@ xxxx \begin{theorem} -text +para 1 \\ para1 + +para 2 \\ para2 \end{theorem} xxxx xxxx \begin{theorem} -text +para 1 \\ para1 + +para 2 \\ para2 \end{theorem} xxxx diff --git a/required/latex-lab/testfiles-firstaid/test-amsart-733.tlg b/required/latex-lab/testfiles-firstaid/test-amsart-733.tlg index 9662a65d8..616b71507 100644 --- a/required/latex-lab/testfiles-firstaid/test-amsart-733.tlg +++ b/required/latex-lab/testfiles-firstaid/test-amsart-733.tlg @@ -17,17 +17,17 @@ Completed box being shipped out [1] ...\glue 0.0 plus 1.0fil ...\pdfrunninglinkoff ...\pdfliteral page{/Artifact BMC} -...\marks4{b-,13,-1,} -...\marks4{b+,13,-1,} +...\marks4{b-,15,-1,} +...\marks4{b+,15,-1,} ...\hbox(0.0+0.0)x360.0 ....\hbox(0.0+0.0)x360.0 ...\pdfliteral page{EMC} -...\marks4{e-,13,2,} -...\marks4{e+,13,2,} +...\marks4{e-,15,2,} +...\marks4{e+,15,2,} ...\pdfrunninglinkon ..\glue 14.0 ..\glue(\lineskip) 0.0 -..\vbox(584.0+0.0)x360.0, glue set 354.0fil +..\vbox(584.0+0.0)x360.0, glue set 282.0fil ...\hbox(0.0+0.0)x0.0 ...\glue(\topskip) 5.6955 ...\hbox(4.3045+0.0)x360.0, glue set 326.89404fil @@ -51,8 +51,7 @@ Completed box being shipped out [1] ...\glue(\parskip) 0.0 ...\glue(\parskip) 0.0 ...\glue(\baselineskip) 5.0989 -...\hbox(6.9011+0.0)x360.0, glue set 281.24706fil -....\hbox(0.0+0.0)x0.0 +...\hbox(6.9011+1.94397)x360.0, glue set 269.91647fil ....\hbox(0.0+0.0)x0.0 ....\write1{\new@label@record{mcid-2}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{2}{tagmcid}{\__property_code_tagmcid: }}} ....\pdfliteral shipout page{/Lbl <> BDC} @@ -78,13 +77,17 @@ Completed box being shipped out [1] ....\penalty 10000 ....\glue 0.0 ....\pdfliteral shipout page{/text <> BDC} -....\T1/cmr/m/it/10 t -....\T1/cmr/m/it/10 e -....\T1/cmr/m/it/10 x -....\T1/cmr/m/it/10 t -....\pdfliteral page{EMC} +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\glue 3.5769 plus 1.53294 minus 1.02197 +....\T1/cmr/m/it/10 1 ....\penalty 10000 -....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue 0.0 plus 1.0fil +....\penalty -10000 ....\glue(\rightskip) 0.0 ...\marks4{b-,2,9,Lbl,,,} ...\marks4{b+,2,9,Lbl,,,} @@ -100,32 +103,64 @@ Completed box being shipped out [1] ...\marks4{e+,4,8,} ...\marks4{b-,5,11,text,,,} ...\marks4{b+,5,11,text,,,} +...\penalty 20000 +...\glue(\baselineskip) 3.64093 +...\hbox(6.4151+1.94397)x360.0, glue set 336.36691fil +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 1 +....\pdfliteral page{EMC} +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 ...\marks4{e-,5,11,} ...\marks4{e+,5,11,} -...\penalty -51 -...\glue 50.0 ...\glue(\parskip) 0.0 ...\glue(\parskip) 0.0 -...\glue(\baselineskip) 7.6955 -...\hbox(4.3045+0.0)x360.0, glue set 326.89404fil +...\glue(\baselineskip) 3.64093 +...\hbox(6.4151+1.94397)x360.0, glue set 320.79001fil ....\write1{\new@label@record{mcid-6}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{6}{tagmcid}{\__property_code_tagmcid: }}} ....\pdfliteral shipout page{/text <> BDC} ....\hbox(0.0+0.0)x12.0 -....\T1/cmr/m/n/10 x -....\T1/cmr/m/n/10 x -....\T1/cmr/m/n/10 x -....\T1/cmr/m/n/10 x -....\pdfliteral page{EMC} +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\glue 3.5769 plus 1.53294 minus 1.02197 +....\T1/cmr/m/it/10 2 ....\penalty 10000 -....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue 0.0 plus 1.0fil +....\penalty -10000 ....\glue(\rightskip) 0.0 ...\marks4{b-,6,13,text,,,} ...\marks4{b+,6,13,text,,,} +...\penalty 20000 +...\glue(\baselineskip) 3.64093 +...\hbox(6.4151+1.94397)x360.0, glue set 336.36691fil +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 2 +....\pdfliteral page{EMC} +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 ...\marks4{e-,6,13,} ...\marks4{e+,6,13,} +...\penalty -51 +...\glue 50.0 ...\glue(\parskip) 0.0 ...\glue(\parskip) 0.0 -...\glue(\baselineskip) 7.6955 +...\glue(\baselineskip) 5.75153 ...\hbox(4.3045+0.0)x360.0, glue set 326.89404fil ....\write1{\new@label@record{mcid-7}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{7}{tagmcid}{\__property_code_tagmcid: }}} ....\pdfliteral shipout page{/text <> BDC} @@ -142,20 +177,38 @@ Completed box being shipped out [1] ...\marks4{b+,7,15,text,,,} ...\marks4{e-,7,15,} ...\marks4{e+,7,15,} +...\glue(\parskip) 0.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 7.6955 +...\hbox(4.3045+0.0)x360.0, glue set 326.89404fil +....\write1{\new@label@record{mcid-8}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{8}{tagmcid}{\__property_code_tagmcid: }}} +....\pdfliteral shipout page{/text <> BDC} +....\hbox(0.0+0.0)x12.0 +....\T1/cmr/m/n/10 x +....\T1/cmr/m/n/10 x +....\T1/cmr/m/n/10 x +....\T1/cmr/m/n/10 x +....\pdfliteral page{EMC} +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\marks4{b-,8,17,text,,,} +...\marks4{b+,8,17,text,,,} +...\marks4{e-,8,17,} +...\marks4{e+,8,17,} ...\penalty -51 ...\glue 30.0 ...\glue(\parskip) 0.0 ...\glue(\parskip) 0.0 ...\glue(\baselineskip) 5.0989 -...\hbox(6.9011+0.0)x360.0, glue set 281.24706fil -....\hbox(0.0+0.0)x0.0 +...\hbox(6.9011+1.94397)x360.0, glue set 269.91647fil ....\hbox(0.0+0.0)x0.0 -....\write1{\new@label@record{mcid-8}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{8}{tagmcid}{\__property_code_tagmcid: }}} +....\write1{\new@label@record{mcid-9}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{9}{tagmcid}{\__property_code_tagmcid: }}} ....\pdfliteral shipout page{/Lbl <> BDC} ....\T1/cmr/bx/n/10 2 ....\glue 3.8324 plus 1.9162 minus 1.27747 ....\pdfliteral page{EMC} -....\write1{\new@label@record{mcid-9}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{9}{tagmcid}{\__property_code_tagmcid: }}} +....\write1{\new@label@record{mcid-10}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{10}{tagmcid}{\__property_code_tagmcid: }}} ....\pdfliteral shipout page{/Caption <> BDC} ....\T1/cmr/bx/n/10 T ....\T1/cmr/bx/n/10 h @@ -165,46 +218,101 @@ Completed box being shipped out [1] ....\T1/cmr/bx/n/10 e ....\T1/cmr/bx/n/10 m ....\pdfliteral page{EMC} -....\write1{\new@label@record{mcid-10}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{10}{tagmcid}{\__property_code_tagmcid: }}} +....\write1{\new@label@record{mcid-11}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{11}{tagmcid}{\__property_code_tagmcid: }}} ....\pdfliteral shipout page{/Caption <> BDC} ....\T1/cmr/bx/n/10 . ....\pdfliteral page{EMC} ....\glue 5.10986 -....\write1{\new@label@record{mcid-11}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{11}{tagmcid}{\__property_code_tagmcid: }}} +....\write1{\new@label@record{mcid-12}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{12}{tagmcid}{\__property_code_tagmcid: }}} ....\penalty 10000 ....\glue 0.0 ....\pdfliteral shipout page{/text <> BDC} -....\T1/cmr/m/it/10 t -....\T1/cmr/m/it/10 e -....\T1/cmr/m/it/10 x -....\T1/cmr/m/it/10 t +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\glue 3.5769 plus 1.53294 minus 1.02197 +....\T1/cmr/m/it/10 1 +....\penalty 10000 +....\glue 0.0 plus 1.0fil +....\penalty -10000 +....\glue(\rightskip) 0.0 +...\marks4{b-,9,20,Lbl,,,} +...\marks4{b+,9,20,Lbl,,,} +...\marks4{e-,9,20,} +...\marks4{e+,9,20,} +...\marks4{b-,10,19,Caption,,,} +...\marks4{b+,10,19,Caption,,,} +...\marks4{e-,10,19,} +...\marks4{e+,10,19,} +...\marks4{b-,11,19,Caption,,,} +...\marks4{b+,11,19,Caption,,,} +...\marks4{e-,11,19,} +...\marks4{e+,11,19,} +...\marks4{b-,12,22,text,,,} +...\marks4{b+,12,22,text,,,} +...\penalty 20000 +...\glue(\baselineskip) 3.64093 +...\hbox(6.4151+1.94397)x360.0, glue set 336.36691fil +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 1 ....\pdfliteral page{EMC} ....\penalty 10000 ....\glue(\parfillskip) 0.0 plus 1.0fil ....\glue(\rightskip) 0.0 -...\marks4{b-,8,18,Lbl,,,} -...\marks4{b+,8,18,Lbl,,,} -...\marks4{e-,8,18,} -...\marks4{e+,8,18,} -...\marks4{b-,9,17,Caption,,,} -...\marks4{b+,9,17,Caption,,,} -...\marks4{e-,9,17,} -...\marks4{e+,9,17,} -...\marks4{b-,10,17,Caption,,,} -...\marks4{b+,10,17,Caption,,,} -...\marks4{e-,10,17,} -...\marks4{e+,10,17,} -...\marks4{b-,11,20,text,,,} -...\marks4{b+,11,20,text,,,} -...\marks4{e-,11,20,} -...\marks4{e+,11,20,} +...\marks4{e-,12,22,} +...\marks4{e+,12,22,} +...\glue(\parskip) 0.0 +...\glue(\parskip) 0.0 +...\glue(\baselineskip) 3.64093 +...\hbox(6.4151+1.94397)x360.0, glue set 320.79001fil +....\write1{\new@label@record{mcid-13}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{13}{tagmcid}{\__property_code_tagmcid: }}} +....\pdfliteral shipout page{/text <> BDC} +....\hbox(0.0+0.0)x12.0 +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\glue 3.5769 plus 1.53294 minus 1.02197 +....\T1/cmr/m/it/10 2 +....\penalty 10000 +....\glue 0.0 plus 1.0fil +....\penalty -10000 +....\glue(\rightskip) 0.0 +...\marks4{b-,13,24,text,,,} +...\marks4{b+,13,24,text,,,} +...\penalty 20000 +...\glue(\baselineskip) 3.64093 +...\hbox(6.4151+1.94397)x360.0, glue set 336.36691fil +....\T1/cmr/m/it/10 p +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 r +....\kern-0.511 +....\T1/cmr/m/it/10 a +....\T1/cmr/m/it/10 2 +....\pdfliteral page{EMC} +....\penalty 10000 +....\glue(\parfillskip) 0.0 plus 1.0fil +....\glue(\rightskip) 0.0 +...\marks4{e-,13,24,} +...\marks4{e+,13,24,} ...\penalty -51 ...\glue 50.0 ...\glue(\parskip) 0.0 ...\glue(\parskip) 0.0 -...\glue(\baselineskip) 7.6955 +...\glue(\baselineskip) 5.75153 ...\hbox(4.3045+0.0)x360.0, glue set 326.89404fil -....\write1{\new@label@record{mcid-12}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{12}{tagmcid}{\__property_code_tagmcid: }}} +....\write1{\new@label@record{mcid-14}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{14}{tagmcid}{\__property_code_tagmcid: }}} ....\pdfliteral shipout page{/text <> BDC} ....\hbox(0.0+0.0)x12.0 ....\T1/cmr/m/n/10 x @@ -215,18 +323,18 @@ Completed box being shipped out [1] ....\penalty 10000 ....\glue(\parfillskip) 0.0 plus 1.0fil ....\glue(\rightskip) 0.0 -...\marks4{b-,12,22,text,,,} -...\marks4{b+,12,22,text,,,} -...\marks4{e-,12,22,} -...\marks4{e+,12,22,} +...\marks4{b-,14,26,text,,,} +...\marks4{b+,14,26,text,,,} +...\marks4{e-,14,26,} +...\marks4{e+,14,26,} ...\glue 0.0 plus 1.0fil ...\kern 0.0 ...\hbox(0.0+0.0)x0.0 ...\glue 0.0 ..\pdfrunninglinkoff ..\pdfliteral page{/Artifact BMC} -..\marks4{b-,14,-1,} -..\marks4{b+,14,-1,} +..\marks4{b-,16,-1,} +..\marks4{b+,16,-1,} ..\glue(\baselineskip) 7.46777 ..\hbox(4.53223+0.0)x360.0 ...\hbox(4.53223+0.0)x360.0, glue set 178.00743fil @@ -234,8 +342,8 @@ Completed box being shipped out [1] ....\T1/cmr/m/n/7 1 ....\glue 0.0 plus 1.0fil ..\pdfliteral page{EMC} -..\marks4{e-,14,2,} -..\marks4{e+,14,2,} +..\marks4{e-,16,2,} +..\marks4{e+,16,2,} ..\pdfrunninglinkon .\kern 0.0 .\kern 0.0 @@ -244,8 +352,8 @@ Completed box being shipped out [1] .\kern 640.215 (test-amsart-733.aux) Package tagpdf Info: Finalizing the tagging structure: -(tagpdf) Writing out ~22 structure objects -(tagpdf) with ~14 'MC' leaf nodes. +(tagpdf) Writing out ~26 structure objects +(tagpdf) with ~16 'MC' leaf nodes. (tagpdf) Be patient if there are lots of objects! Package tagpdf Info: writing ParentTree Package tagpdf Info: writing IDTree diff --git a/required/latex-lab/testfiles-firstaid/test-amsthm-736.lvt b/required/latex-lab/testfiles-firstaid/test-amsthm-736.lvt index 8d7d0b68b..ffd28509d 100644 --- a/required/latex-lab/testfiles-firstaid/test-amsthm-736.lvt +++ b/required/latex-lab/testfiles-firstaid/test-amsthm-736.lvt @@ -13,8 +13,13 @@ \begin{document} \START\showoutput +xxx \begin{theorem} -text +para 1 \\ para1 + +para 2 \\ para2 \end{theorem} +xxx +yyy \end{document} diff --git a/required/latex-lab/testfiles-firstaid/test-amsthm-736.tlg b/required/latex-lab/testfiles-firstaid/test-amsthm-736.tlg index 39ad16f35..18c236290 100644 --- a/required/latex-lab/testfiles-firstaid/test-amsthm-736.tlg +++ b/required/latex-lab/testfiles-firstaid/test-amsthm-736.tlg @@ -32,31 +32,50 @@ Completed box being shipped out [1] ....\glue 0.0 plus 1.0fil ....\pdfrunninglinkoff ....\pdfliteral page{/Artifact BMC} -....\marks4{b-,4,-1,} -....\marks4{b+,4,-1,} +....\marks4{b-,8,-1,} +....\marks4{b+,8,-1,} ....\hbox(0.0+0.0)x345.0 .....\hbox(0.0+0.0)x345.0 ....\pdfliteral page{EMC} -....\marks4{e-,4,2,} -....\marks4{e+,4,2,} +....\marks4{e-,8,2,} +....\marks4{e+,8,2,} ....\pdfrunninglinkon ...\glue 25.0 ...\glue(\lineskip) 0.0 -...\vbox(550.0+0.0)x345.0, glue set 531.94318fil +...\vbox(550.0+0.0)x345.0, glue set 449.95193fil ....\hbox(0.0+0.0)x0.0 ....\write-{} ....\pdfdest name{Doc-Start} xyz ....\pdfdest struct10 name{Doc-Start} xyz -....\glue(\topskip) 3.0989 -....\hbox(6.9011+0.0)x345.0, glue set 275.93791fil -.....\hbox(0.0+0.0)x0.0 +....\glue(\topskip) 5.6955 +....\hbox(4.3045+0.0)x345.0, glue set 314.17053fil +.....\write1{\new@label@record{mcid-1}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{1}{tagmcid}{\__property_code_tagmcid: }}} +.....\pdfliteral shipout page{/text <> BDC} +.....\hbox(0.0+0.0)x15.0 +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{b-,1,6,text,,,} +....\marks4{b+,1,6,text,,,} +....\marks4{e-,1,6,} +....\marks4{e+,1,6,} +....\penalty -51 +....\glue 10.0 plus 4.0 minus 5.0 +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 5.0989 +....\hbox(6.9011+1.94397)x345.0, glue set 264.60733fil .....\penalty 10000 .....\hbox(0.0+0.0)x0.0 ......\hbox(0.0+0.0)x0.0, shifted -12.0 .......\pdfdest name{theorem*.1} xyz -.......\pdfdest struct13 name{theorem*.1} xyz +.......\pdfdest struct15 name{theorem*.1} xyz .......\penalty 10000 -.....\write1{\new@label@record{mcid-1}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{1}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-2}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{2}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Caption <> BDC} .....\T1/cmr/bx/n/10 T .....\T1/cmr/bx/n/10 h @@ -66,37 +85,129 @@ Completed box being shipped out [1] .....\T1/cmr/bx/n/10 e .....\T1/cmr/bx/n/10 m .....\pdfliteral page{EMC} -.....\write1{\new@label@record{mcid-2}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{2}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-3}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{3}{tagmcid}{\__property_code_tagmcid: }}} .....\pdfliteral shipout page{/Caption <> BDC} .....\T1/cmr/bx/n/10 . .....\pdfliteral page{EMC} .....\glue 5.0 plus 1.0 minus 1.0 -.....\write1{\new@label@record{mcid-3}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{3}{tagmcid}{\__property_code_tagmcid: }}} +.....\write1{\new@label@record{mcid-4}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{4}{tagmcid}{\__property_code_tagmcid: }}} .....\penalty 10000 .....\glue 0.0 .....\pdfliteral shipout page{/text <> BDC} -.....\T1/cmr/m/it/10 t -.....\T1/cmr/m/it/10 e -.....\T1/cmr/m/it/10 x -.....\T1/cmr/m/it/10 t -.....\pdfliteral page{EMC} +.....\T1/cmr/m/it/10 p +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 r +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 1 .....\penalty 10000 -.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue 0.0 plus 1.0fil +.....\penalty -10000 .....\glue(\rightskip) 0.0 -....\marks4{b-,1,6,Caption,,,} -....\marks4{b+,1,6,Caption,,,} -....\marks4{e-,1,6,} -....\marks4{e+,1,6,} -....\marks4{b-,2,6,Caption,,,} -....\marks4{b+,2,6,Caption,,,} -....\marks4{e-,2,6,} -....\marks4{e+,2,6,} -....\marks4{b-,3,8,text,,,} -....\marks4{b+,3,8,text,,,} +....\marks4{b-,2,8,Caption,,,} +....\marks4{b+,2,8,Caption,,,} +....\marks4{e-,2,8,} +....\marks4{e+,2,8,} +....\marks4{b-,3,8,Caption,,,} +....\marks4{b+,3,8,Caption,,,} ....\marks4{e-,3,8,} ....\marks4{e+,3,8,} +....\marks4{b-,4,10,text,,,} +....\marks4{b+,4,10,text,,,} +....\penalty 300 +....\glue(\baselineskip) 3.64093 +....\hbox(6.4151+1.94397)x345.0, glue set 321.36691fil +.....\T1/cmr/m/it/10 p +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 r +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 1 +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{e-,4,10,} +....\marks4{e+,4,10,} +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 3.64093 +....\hbox(6.4151+1.94397)x345.0, glue set 302.79001fil +.....\write1{\new@label@record{mcid-5}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{5}{tagmcid}{\__property_code_tagmcid: }}} +.....\pdfliteral shipout page{/text <> BDC} +.....\hbox(0.0+0.0)x15.0 +.....\T1/cmr/m/it/10 p +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 r +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\glue 3.5769 plus 1.53294 minus 1.02197 +.....\T1/cmr/m/it/10 2 +.....\penalty 10000 +.....\glue 0.0 plus 1.0fil +.....\penalty -10000 +.....\glue(\rightskip) 0.0 +....\marks4{b-,5,12,text,,,} +....\marks4{b+,5,12,text,,,} +....\penalty 300 +....\glue(\baselineskip) 3.64093 +....\hbox(6.4151+1.94397)x345.0, glue set 321.36691fil +.....\T1/cmr/m/it/10 p +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 r +.....\kern-0.511 +.....\T1/cmr/m/it/10 a +.....\T1/cmr/m/it/10 2 +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{e-,5,12,} +....\marks4{e+,5,12,} ....\penalty -51 ....\glue 8.0 plus 2.0 minus 4.0 +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 5.75153 +....\hbox(4.3045+0.0)x345.0, glue set 314.17053fil +.....\write1{\new@label@record{mcid-6}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{6}{tagmcid}{\__property_code_tagmcid: }}} +.....\pdfliteral shipout page{/text <> BDC} +.....\hbox(0.0+0.0)x15.0 +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\T1/cmr/m/n/10 x +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{b-,6,14,text,,,} +....\marks4{b+,6,14,text,,,} +....\marks4{e-,6,14,} +....\marks4{e+,6,14,} +....\glue(\parskip) 0.0 plus 1.0 +....\glue(\parskip) 0.0 +....\glue(\baselineskip) 7.6955 +....\hbox(4.3045+1.94397)x345.0, glue set 314.17053fil +.....\write1{\new@label@record{mcid-7}{{tagabspage}{\__property_code_tagabspage: }{tagmcabs}{7}{tagmcid}{\__property_code_tagmcid: }}} +.....\pdfliteral shipout page{/text <> BDC} +.....\hbox(0.0+0.0)x15.0 +.....\T1/cmr/m/n/10 y +.....\T1/cmr/m/n/10 y +.....\T1/cmr/m/n/10 y +.....\pdfliteral page{EMC} +.....\penalty 10000 +.....\glue(\parfillskip) 0.0 plus 1.0fil +.....\glue(\rightskip) 0.0 +....\marks4{b-,7,16,text,,,} +....\marks4{b+,7,16,text,,,} +....\marks4{e-,7,16,} +....\marks4{e+,7,16,} +....\glue -1.94397 ....\glue 0.0 plus 1.0fil ....\glue 0.0 plus -1.0fil ....\kern 0.0 @@ -106,8 +217,8 @@ Completed box being shipped out [1] ....\glue 0.0 plus 0.0001fil ...\pdfrunninglinkoff ...\pdfliteral page{/Artifact BMC} -...\marks4{b-,5,-1,} -...\marks4{b+,5,-1,} +...\marks4{b-,9,-1,} +...\marks4{b+,9,-1,} ...\glue(\baselineskip) 23.5849 ...\hbox(6.4151+0.0)x345.0 ....\hbox(6.4151+0.0)x345.0, glue set 170.00061fil @@ -115,8 +226,8 @@ Completed box being shipped out [1] .....\T1/cmr/m/n/10 1 .....\glue 0.0 plus 1.0fil ...\pdfliteral page{EMC} -...\marks4{e-,5,2,} -...\marks4{e+,5,2,} +...\marks4{e-,9,2,} +...\marks4{e+,9,2,} ...\pdfrunninglinkon .\kern 0.0 .\kern 0.0 @@ -125,8 +236,8 @@ Completed box being shipped out [1] .\kern 633.0 (test-amsthm-736.aux) Package tagpdf Info: Finalizing the tagging structure: -(tagpdf) Writing out ~8 structure objects -(tagpdf) with ~5 'MC' leaf nodes. +(tagpdf) Writing out ~16 structure objects +(tagpdf) with ~9 'MC' leaf nodes. (tagpdf) Be patient if there are lots of objects! Package tagpdf Info: writing ParentTree Package tagpdf Info: writing IDTree diff --git a/required/latex-lab/testfiles-math/mtag-004.tlg b/required/latex-lab/testfiles-math/mtag-004.tlg index 4aad6b590..8a5b55da5 100644 --- a/required/latex-lab/testfiles-math/mtag-004.tlg +++ b/required/latex-lab/testfiles-math/mtag-004.tlg @@ -1,7 +1,7 @@ This is a generated file for the l3build validation system. Don't change this file in any respect. ==> theorem-like-env-start -==> use instance: displayblock-0 +==> use instance: theoremblock-0 Package tagpdf Info: Parent-Child 'Document' --> 'Sect'. (tagpdf) Relation is 1 (='0..n') (tagpdf) Rolemapped from 'Document/pdf2' --> 'theorem-like/latex' on line ... diff --git a/required/latex-lab/update-blocks-all.sh b/required/latex-lab/update-blocks-all.sh index 8f9fbba54..7d35a7a72 100644 --- a/required/latex-lab/update-blocks-all.sh +++ b/required/latex-lab/update-blocks-all.sh @@ -1,18 +1,26 @@ #l3build save -cconfig-block -epdftex,luatex \ -#l3build save -cconfig-block -epdftex \ + + +l3build save -cconfig-block -epdftex \ + tagging-0767 l3build save -cconfig-block -epdftex,luatex \ - blocks-item-01 \ - blocks-item-02 \ - blocks-item-03 \ - blocks-item-04 \ blocks-000 \ + blocks-description-01 \ + blocks-description-01b \ + blocks-description-02b \ + blocks-description-03 \ blocks-enumerate-01 \ blocks-enumerate-01b \ blocks-enumerate-02 \ blocks-enumerate-02b \ blocks-enumerate-05 \ + blocks-hyperref-01 \ + blocks-item-01 \ + blocks-item-02 \ + blocks-item-03 \ + blocks-item-04 \ blocks-itemize-01 \ blocks-itemize-01b \ blocks-itemize-02 \ @@ -22,27 +30,25 @@ l3build save -cconfig-block -epdftex,luatex \ blocks-list-02b \ blocks-list-03b \ blocks-list-04 \ - blocks-description-01 \ - blocks-description-01b \ - blocks-description-02b \ - blocks-description-03 \ - blocks-hyperref-01 \ blocks-minipage-gh544 \ + blocks-quote-01 \ + blocks-quote-02 \ blocks-theorem-01 \ blocks-theorem-02 \ blocks-theorem-03 \ - blocks-quote-01 \ - blocks-quote-02 \ - blocks-trivlist-00 \ + blocks-theorem-04 \ + blocks-trivlist-00 \ blocks-trivlist-01 \ blocks-trivlist-02 \ blocks-verbatim-01 \ blocks-verbatim-02 \ - hyperref-target \ - ptag-001 \ - problem-blocks-tabbing \ + blocks-verbatim-nested-gh119 \ + blocks-verse-01 \ gallery-III \ gallery-III-with-sec \ + hyperref-target \ + problem-blocks-tabbing \ + ptag-001 \ tagging-0097 \ tagging-0097b \ tagging-0730 @@ -55,7 +61,7 @@ exit l3build save \ l3lists-prototype-enumerate-02 \ l3lists-prototype-itemize-01 - +