[latex3-commits] [git/LaTeX3-latex3-latex2e] testnewpara: adapt sec-mapping to new para handling (845768bc)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Mar 2 18:53:31 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : testnewpara
Link       : https://github.com/latex3/latex2e/commit/845768bca23268fbc2e3ae06b18d532610df05da

>---------------------------------------------------------------

commit 845768bca23268fbc2e3ae06b18d532610df05da
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Mar 2 18:53:31 2023 +0100

    adapt sec-mapping to new para handling


>---------------------------------------------------------------

845768bca23268fbc2e3ae06b18d532610df05da
 required/latex-lab/latex-lab-sec-tagging.dtx | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/required/latex-lab/latex-lab-sec-tagging.dtx b/required/latex-lab/latex-lab-sec-tagging.dtx
index c8efc650..1b923c92 100644
--- a/required/latex-lab/latex-lab-sec-tagging.dtx
+++ b/required/latex-lab/latex-lab-sec-tagging.dtx
@@ -155,19 +155,14 @@
 %  We use a stack to record the levels of the open \texttt{Sect}. The first item
 %  has level -100. A sectioning command will take a record from the stack. If its level is
 %  greater or equal it closes this structure and takes the next record from the stack.
-%  If the record has a smaller level smaller then it puts it back and stops.
+%  If the record has a smaller level then it puts it back and stops.
 %  The stack is compared with the main structure stack, if they don't match 
 %  it means we can't safely close the \texttt{Sect} and so we issue a warning 
 %  and do nothing. 
 %    
 % \subsubsection{Loading general kernel changes}
 % [kernel?]
-%  Also done in the toc-tagging, only repeated here for the record and
-%  for consistency in case the toc-tagging code is not loaded.
-%  We assume that all sectioning commands have a well-defined
-%  level. We use here the commands also used by the toc-tagging \cs{toclevel at xx}.
-%  and by hyperref. 
-%  The numbers are a bit different to the one in hyperref, but imho sensible.
+%  Also loaded in the toc-tagging code.
 %    \begin{macrocode}
 \RequirePackage{latex-lab-kernel-changes}
 %    \end{macrocode}
@@ -306,7 +301,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \__tag_sec_end_display:
   {
-    \tag_struct_end:
+    \tag_struct_end: %P = Hn
     \__tag_setup_restore_para_default:
   }
 %    \end{macrocode}
@@ -350,6 +345,15 @@
             \__tag_sec_begin:nn{-1}{tag=Part}
           }  
          \tag_struct_begin:n{tag=part,title=#1}
+%    \end{macrocode}
+% We remap here the tpara from the paragraph to NonStruct.
+% It would be better to suppress it completly as with the other
+% sectioning commands, but this would require to redefine \cs{@spart}
+% and \cs{@part}, as there is the grouping, and these commands are
+% all slightly different in the standard classes. So this is delayed 
+% to the time when sectioning commands are redefined with templates.
+%    \begin{macrocode}
+         \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
          \tl_set:Nn\l__tag_para_tag_tl {Span}
       }
     ,sec-stop-part .code:n = {\__tag_sec_end_display:}
@@ -361,6 +365,10 @@
            \__tag_sec_begin:nn{0}{tag=Sect}
          }  
         \tag_struct_begin:n{tag=chapter,title=#1}
+%    \end{macrocode}
+% similar to part we remap to NonStruct for now ...
+%    \begin{macrocode}
+        \tl_set:Nn\l__tag_para_main_tag_tl {NonStruct}
         \tl_set:Nn\l__tag_para_tag_tl {Span}
      }
     ,sec-stop-chapter .meta:n = { sec-stop-part}  
@@ -693,6 +701,7 @@
   \@tempskipa #5\relax
   \ifdim \@tempskipa>\z@
     \begingroup
+    \tagtool{para-main=false} % or \bool_set_false\l__tag_para_main_bool
       #6{%
          \ifnum #2>\c at secnumdepth
           \@hangfrom {\hskip #3\relax\@svsec}%





More information about the latex3-commits mailing list.