[latex3-commits] [latex3/latex2e] UF-latex-lab-structelem-fakemath: switch to tagging socket WIP (c66f46707)

github at latex-project.org github at latex-project.org
Tue Nov 19 20:23:21 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : UF-latex-lab-structelem-fakemath
Link       : https://github.com/latex3/latex2e/commit/c66f46707614e5674ccfe5155e4bb1fe0890a7f7

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

commit c66f46707614e5674ccfe5155e4bb1fe0890a7f7
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Tue Nov 19 20:23:21 2024 +0100

    switch to tagging socket WIP


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

c66f46707614e5674ccfe5155e4bb1fe0890a7f7
 required/latex-lab/changes.txt        |  2 +
 required/latex-lab/latex-lab-math.dtx | 76 +++++++++++------------------------
 2 files changed, 26 insertions(+), 52 deletions(-)

diff --git a/required/latex-lab/changes.txt b/required/latex-lab/changes.txt
index 62d696fb3..997c756dc 100644
--- a/required/latex-lab/changes.txt
+++ b/required/latex-lab/changes.txt
@@ -1,6 +1,8 @@
 2024-11-19 Ulrike Fischer <Ulrike.Fischer at latex-project.org>
 	* latex-lab-math.dtx: changed handling of math/mathml/structelem to better handle
 	fakemath (tagging/764)
+	* latex-lab-math.dtx: made all main math sockets to tagging sockets and 
+	assign the plugs directly.
 
 2024-11-18 Joseph Wright <Joseph.Wright at latex-project.org>
 	* latex-lab-math.dtx: Use "@@" for a couple of internals
diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index 9521540eb..3d645a8ad 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -205,11 +205,8 @@
 %  The actual tagging is in done through the sockets
 %   \begin{itemize}
 %    \item |tagsupport/math/inline/formula/begin|
-%     This socket takes the math as argument and its code
+%     This socket takes the math as second argument and its code
 %     should output it for typesetting.
-%     It is not \emph{used} as a tagging socket as the math argument should
-%     not be lost without tagging, so without tagging the
-%     socket uses the identity plug.
 %     The |default| plug of the socket calls these three internal sockets
 %     for the tagging support:
 %      \begin{itemize}
@@ -1438,10 +1435,12 @@
 %   The formula sockets are despite their naming not symmetric:
 %   the begin socket is issued after the math has started, while
 %   the end socket is after the math!
+%   \changes{v0.6j}{2024-11-19}{change the socket to two argument so that it can
+%   be used as tagging socket}
 %    \begin{macrocode}
 \socket_new:nn {tagsupport/math/inline/begin}{0}
 \socket_new:nn {tagsupport/math/inline/end}{0}
-\socket_new:nn {tagsupport/math/inline/formula/begin}{1} %
+\socket_new:nn {tagsupport/math/inline/formula/begin}{2} %
 \socket_new:nn {tagsupport/math/inline/formula/end}{0}
 %    \end{macrocode}
 %\end{socketdecl}
@@ -1469,6 +1468,7 @@
 %    \end{macrocode}
 % \changes{v0.6g}{2024-10-02}{disable paratagging, issue \#711}
 % \changes{v0.6j}{2024-11-19}{activate structelem locally issue \#764}
+% \changes{v0.6j}{2024-11-19}{change to two arguments}
 %    \begin{macrocode}
   { \tagpdfparaOff
     \@@_luamml_structelem:
@@ -1479,7 +1479,7 @@
 %    \begin{macrocode}
     % inner formula if multiple parts (not really implemented yet)
     \tag_socket_use:n{math/substruct/begin}
-    #1
+    #2
     \tag_socket_use:n{math/end}
   }
 \socket_new_plug:nnn
@@ -1508,13 +1508,11 @@
 %   The formula sockets are despite their naming not symmetric:
 %   the begin socket is issued after the math has started, while
 %   the end socket is after the math!
-%   The socket |tagsupport/math/display/formula/begin| should similar to
-%   the inline version not be used as tagging socket so that the argument, the math,
-%   is not lost.
+%   \changes{v0.6j}{2024-11-19}{change argument number of formula/begin socket}
 %    \begin{macrocode}
 \socket_new:nn {tagsupport/math/display/begin}{0}
 \socket_new:nn {tagsupport/math/display/end}{0}
-\socket_new:nn {tagsupport/math/display/formula/begin}{1} %
+\socket_new:nn {tagsupport/math/display/formula/begin}{2} %
 \socket_new:nn {tagsupport/math/display/formula/end}{0}
 %    \end{macrocode}
 %\end{socketdecl}
@@ -1544,7 +1542,7 @@
     \tag_socket_use:n{math/content}
     \tag_socket_use:n{math/struct/begin}
     \tag_socket_use:n{math/substruct/begin}
-    #1
+    #2
     \tag_socket_use:n{math/end}
   }
 \socket_new_plug:nnn
@@ -1851,48 +1849,21 @@
 \socket_new:nn {tagsupport/math/end}{0}
 %    \end{macrocode}
 % \end{socketdecl}
-
 %
-%  \begin{macro}{\__tag_math_disable:}
-%  Similar to the table code we collect the plugs that should be
-%  assigned to do nothing if we don't want tagging
-%    \begin{macrocode}
-\cs_new_protected:Npn \__tag_math_disable:
-  {
-    \socket_assign_plug:nn {tagsupport/math/inline/begin}{noop}
-    \socket_assign_plug:nn {tagsupport/math/inline/end}{noop}
-    \socket_assign_plug:nn {tagsupport/math/inline/formula/begin}{identity}
-    \socket_assign_plug:nn {tagsupport/math/inline/formula/end}{noop}
-    \socket_assign_plug:nn {tagsupport/math/display/begin}{noop}
-    \socket_assign_plug:nn {tagsupport/math/display/end}{noop}
-    \socket_assign_plug:nn {tagsupport/math/display/formula/begin}{identity}
-    \socket_assign_plug:nn {tagsupport/math/display/formula/end}{noop}
-  }
-%    \end{macrocode}
-% \end{macro}
 %
-%  \begin{macro}{\__tag_math_enable:}
-%  Similar to the table code we collect the default plugs that should be
-%  assigned if we want tagging
+%  \changes{v0.6j}{2024-11-19}{removed enable/disable command and assign tagging sockets directly}
 %    \begin{macrocode}
-\cs_new_protected:Npn \__tag_math_enable:
-  {
-    \socket_assign_plug:nn {tagsupport/math/inline/begin}{MC}
-    \socket_assign_plug:nn {tagsupport/math/inline/end}{MC}
-    \socket_assign_plug:nn {tagsupport/math/inline/formula/begin}{default}
-    \socket_assign_plug:nn {tagsupport/math/inline/formula/end}{default}
-    \socket_assign_plug:nn {tagsupport/math/display/begin}{default}
-    \socket_assign_plug:nn {tagsupport/math/display/end}{default}
-    \socket_assign_plug:nn {tagsupport/math/display/formula/begin}{default}
-    \socket_assign_plug:nn {tagsupport/math/display/formula/end}{default}
-  }
-%    \end{macrocode}
-% \end{macro}
-% At begin document we can activate:
-%    \begin{macrocode}
-\AtBeginDocument{\tag_if_active:T{\__tag_math_enable: }}
+\socket_assign_plug:nn {tagsupport/math/inline/begin}{MC}
+\socket_assign_plug:nn {tagsupport/math/inline/end}{MC}
+\socket_assign_plug:nn {tagsupport/math/inline/formula/begin}{default}
+\socket_assign_plug:nn {tagsupport/math/inline/formula/end}{default}
+\socket_assign_plug:nn {tagsupport/math/display/begin}{default}
+\socket_assign_plug:nn {tagsupport/math/display/end}{default}
+\socket_assign_plug:nn {tagsupport/math/display/formula/begin}{default}
+\socket_assign_plug:nn {tagsupport/math/display/formula/end}{default}
 %    \end{macrocode}
 %
+%
 % \subsection{Interface commands}
 %
 % \begin{macro}
@@ -1971,8 +1942,9 @@
 %    \end{macrocode}
 % We do no use a tagging socket here, so that the argument (the
 % math) is not lost, tagging-project issue 661.
+% \changes{v0.6j}{2024-11-19}{change socket to tagging socket}
 %    \begin{macrocode}
-            \socket_use:nn {tagsupport/math/inline/formula/begin}{#1}
+            \tag_socket_use:nnn {math/inline/formula/begin}{}{#1}
             $ % $
             \tag_socket_use:n  {math/inline/formula/end}
             \tag_socket_use:n  {math/inline/end} % restart P-MC
@@ -2001,7 +1973,7 @@
       {
         \@@_process:nn { equation* } {#1}
         \tag_socket_use:n {math/display/begin}
-        \socket_use:nn{tagsupport/math/display/formula/begin}{#1}
+        \tag_socket_use:nn{math/display/formula/begin}{}{#1}
       }
     $$
   }
@@ -2418,7 +2390,7 @@
 %         \typeout{==>A3}
          \__tag_tool_close_P:
        }
-  \socket_use:nn{tagsupport/math/display/formula/begin}{}
+  \tag_socket_use:nn{math/display/formula/begin}{}{}
   \tagpdfparaOff
 %  \typeout{==>MC1}\ShowTagging{mc-current}
 }
@@ -2427,7 +2399,7 @@
 %  \typeout{==>MC2}\ShowTagging{mc-current}
   \para_raw_end:
   \tagpdfparaOn
-  \socket_use:n{tagsupport/math/display/formula/end}
+  \tag_socket_use:n{tagsupport/math/display/formula/end}
 %  \typeout{==>MC3}\ShowTagging{mc-current}
   \@endpetrue
 }





More information about the latex3-commits mailing list.