[latex3-commits] [latex3/latex2e] latex-lab/uf-review-05: more sockets (301f7159)

github at latex-project.org github at latex-project.org
Fri Nov 24 00:51:40 CET 2023


Repository : https://github.com/latex3/latex2e
On branch  : latex-lab/uf-review-05
Link       : https://github.com/latex3/latex2e/commit/301f7159c60d1f15903c028ed808a056eed4fc66

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

commit 301f7159c60d1f15903c028ed808a056eed4fc66
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Fri Nov 24 00:51:40 2023 +0100

    more sockets


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

301f7159c60d1f15903c028ed808a056eed4fc66
 required/latex-lab/latex-lab-math.dtx | 88 +++++++++++++++++++++++++++++------
 1 file changed, 73 insertions(+), 15 deletions(-)

diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index c6d2c2bb..980737eb 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -434,6 +434,75 @@
 \socket_assign_plug:nn {tagsupport/math/content}{actual+source}  
 %    \end{macrocode}
 % \end{plugdecl}  
+% 
+% \begin{socketdecl}{tagsupport/math/struct/begin,
+%  tagsupport/math/struct/end}
+% For the main structure we use a socket too. 
+% This allow e.g. to create a special one for luamml
+% which setups additional objects. 
+% The begin socket can use the two variables 
+% \cs{g_@@_grabbed_env_tl} and \cs{g_@@_grabbed_math_tl}
+%    \begin{macrocode}
+\socket_new:nn {tagsupport/math/struct/begin}{0}
+\socket_new:nn {tagsupport/math/struct/end}{0}
+%    \end{macrocode}
+% \end{socketdecl}
+%
+% \begin{plugdecl}{default}
+% TODO: think about some naming convention ...
+%    \begin{macrocode}
+\socket_new_plug:nnn
+  {tagsupport/math/struct/begin}
+  {default}
+  {
+   \tag_struct_begin:n
+     {
+       tag=Formula,
+       AFinline-o  = \l_@@_mathcontent_AF_source_tl,
+       title-o     = \g_@@_grabbed_env_tl,
+       actualtext  = \l_@@_mathcontent_actual_tl,
+       alt         = \l_@@_mathcontent_alt_tl
+     }
+  }
+\socket_new_plug:nnn
+  {tagsupport/math/struct/end}
+  {default}
+  { \tag_struct_end: }
+  
+\socket_assign_plug:nn {tagsupport/math/struct/begin}{default}  
+\socket_assign_plug:nn {tagsupport/math/struct/end}{default}   
+%    \end{macrocode}  
+% \end{macrocode}   
+% 
+% \begin{socketdecl}{tagsupport/math/substruct/begin,
+%  tagsupport/math/substruct/end}
+%  This holds the code to handle subparts of the formula.
+%    \begin{macrocode}
+\socket_new:nn {tagsupport/math/substruct/begin}{0}
+\socket_new:nn {tagsupport/math/substruct/end}{0}
+%    \end{macrocode}
+% \end{socketdecl}
+% 
+% \begin{plugdecl}{default}
+%    \begin{macrocode}
+\socket_new_plug:nnn
+  {tagsupport/math/substruct/begin}
+  {default}
+  { \grabaformulapartandstart }
+\socket_new_plug:nnn
+  {tagsupport/math/substruct/end}
+  {default}
+  { 
+    \tagmcend
+    \if at subformulas
+      \tagstructend
+    \fi
+ } 
+\socket_assign_plug:nn {tagsupport/math/substruct/begin}{default}  
+\socket_assign_plug:nn {tagsupport/math/substruct/end}{default}   
+%    \end{macrocode}  
+% \end{macrocode}   
+
 % 
 % \begin{socketdecl}{tagsupport/math/inline/begin,
 %                    tagsupport/math/inline/end,
@@ -1042,16 +1111,9 @@
 %  \typeout{==>~math~begin}
 % needs different handling if we support nesting
   \socket_use:n{tagsupport/math/content}
-  \tag_struct_begin:n
-    {
-      tag=Formula,
-      AFinline-o  = \l_@@_mathcontent_AF_source_tl,
-      title-o     = \g_@@_grabbed_env_tl,
-      actualtext  = \l_@@_mathcontent_actual_tl,
-      alt         = \l_@@_mathcontent_alt_tl
-    }
+  \socket_use:n{tagsupport/math/struct/begin}
 % inner formula if multiple parts (not really implemented yet)
-  \grabaformulapartandstart
+  \socket_use:n{tagsupport/math/substruct/begin}
 % the above does:
 %    \tagstructbegin{tag=Formula}\tagmcbegin{}
 %  or just
@@ -1060,12 +1122,8 @@
 \def\@kernel at math@end {
 %  \typeout{==>~math~end}
 %  \ShowTagging{struct-stack}
-  \tagmcend
-  \if at subformulas
-    \tagstructend
-  \else
-  \fi
-  \tagstructend
+  \socket_use:n{tagsupport/math/substruct/end}
+  \socket_use:n{tagsupport/math/struct/end}
 %  \ShowTagging{struct-stack}
 }
 





More information about the latex3-commits mailing list.