[latex3-commits] [latex3/latex2e] latexlab/uf-review-03: use sockets in minipage/parbox tagging (d99ed22c)

github at latex-project.org github at latex-project.org
Sat Oct 21 17:00:42 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : latexlab/uf-review-03
Link       : https://github.com/latex3/latex2e/commit/d99ed22cb848526532f7bff95415497c1925f3f9

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

commit d99ed22cb848526532f7bff95415497c1925f3f9
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Oct 21 17:00:42 2023 +0200

    use sockets in minipage/parbox tagging


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

d99ed22cb848526532f7bff95415497c1925f3f9
 required/latex-lab/latex-lab-minipage.dtx | 46 ++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 16 deletions(-)

diff --git a/required/latex-lab/latex-lab-minipage.dtx b/required/latex-lab/latex-lab-minipage.dtx
index bbd40a3c..754678e9 100644
--- a/required/latex-lab/latex-lab-minipage.dtx
+++ b/required/latex-lab/latex-lab-minipage.dtx
@@ -82,12 +82,13 @@
 \def\@kernel at init@minipage{}
 \def\@kernel at init@parbox{}
 %    \end{macrocode}
-% We need a few hooks.
+% We use sockets for the tag support code, as there will be cases where we want
+% to exchange the content or disable it.
 %    \begin{macrocode}
-\def\@kernel at before@minipage{}
-\def\@kernel at after@minipage{}
-\def\@kernel at before@parbox{}
-\def\@kernel at after@parbox{}
+\socket_new:nn {tagsupport/minipage/before}{0}
+\socket_new:nn {tagsupport/minipage/after} {0}
+\socket_new:nn {tagsupport/parbox/before}  {0}
+\socket_new:nn {tagsupport/parbox/after}{0}
 %    \end{macrocode}
 %
 % \subsection{Patch minipage}
@@ -106,16 +107,16 @@
   \setlength\@tempdima{#4}%
   \def\@mpargs{{#1}{#2}[#3]{#4}}%
 %    \end{macrocode}
-% insert the hook
+% insert the socket
 %    \begin{macrocode}
-  \@kernel at before@minipage% new
+  \socket_use:n{tagsupport/minipage/before}% new
   \setbox\@tempboxa\vbox\bgroup
     \color at begingroup
       \hsize\@tempdima
       \textwidth\hsize \columnwidth\hsize
       \@parboxrestore
       \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c at mpfootnote\z@
-      \AssignSocketPlug{fntext/process}{mp}%
+      \socket_assign_plug:nn{fntext/process}{mp}%
       \let\@listdepth\@mplistdepth \@mplistdepth\z@
       \@minipagerestore
       \@setminipage}
@@ -141,7 +142,7 @@
   \tag_stop:n{minipage}
   \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}%
   \tag_start:n{minipage}
-  \@kernel at after@minipage%new end ...
+  \socket_use:n{tagsupport/minipage/after} %new end ...
   }
 %    \end{macrocode}
 %
@@ -152,7 +153,7 @@
   \leavevmode
   \@pboxswfalse
   \setlength\@tempdima{#4}%
-  \@kernel at before@parbox% new
+  \socket_use:n{tagsupport/parbox/before}
   \@begin at tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
     \ifx\relax#2\else
       \setlength\@tempdimb{#2}%
@@ -167,7 +168,7 @@
        \csname bm@#3\endcsname}%
     \if at pboxsw \m at th$\fi
   \@end at tempboxa%
-  \@kernel at after@parbox%new end
+  \socket_use:n{tagsupport/parbox/after}
   }
 %    \end{macrocode}
 %
@@ -176,7 +177,7 @@
 %    \begin{macrocode}
 \tl_new:N  \l__ltboxes_tag_tl
 \tl_set:Nn \l__ltboxes_tag_tl {Div}
-\cs_set_protected:Npn\@kernel at before@minipage
+\socket_new_plug:nnn{tagsupport/minipage/before}{tag/dflt}
   {
 %    \end{macrocode}
 % As there was a \cs{leavevmode} before that is a P/text open that we have to close.
@@ -185,14 +186,27 @@
 %    \end{macrocode}
 % TODO: the P can be further up, we need a proper method to test and handle this. 
 %    \begin{macrocode}   
-    \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
-\cs_set_protected:Npn\@kernel at after@minipage
+    \tag_struct_begin:n{tag=\l__ltboxes_tag_tl}
+  }
+%    \end{macrocode}
+% similar for the other sockets:
+%    \begin{macrocode}
+\socket_new_plug:nnn{tagsupport/minipage/after}{tag/dflt}
   {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
-\cs_set_protected:Npn\@kernel at before@parbox
+  
+\socket_new_plug:nnn{tagsupport/parbox/before}{tag/dflt}
   {\tag_mc_end_push:\tag_struct_end:\tag_struct_begin:n{tag=\l__ltboxes_tag_tl}}
-\cs_set_protected:Npn\@kernel at after@parbox
+  
+\socket_new_plug:nnn{tagsupport/parbox/after}{tag/dflt}
   {\tag_struct_end:\tag_struct_begin:n{tag=\l__tag_para_tag_tl}\tag_mc_begin_pop:n{}}
 %    \end{macrocode}
+% Activate the default tagging plug
+%    \begin{macrocode}
+\socket_assign_plug:nn{tagsupport/minipage/before}{tag/dflt}
+\socket_assign_plug:nn{tagsupport/minipage/after} {tag/dflt}
+\socket_assign_plug:nn{tagsupport/parbox/before}  {tag/dflt}
+\socket_assign_plug:nn{tagsupport/parbox/after}   {tag/dflt}
+%    \end{macrocode}
 %    \begin{macrocode}
 %</package>  
 %    \end{macrocode}





More information about the latex3-commits mailing list.