[latex3-commits] [latex3/latex2e] latex-lab/uf-review-05: display sockets (f1de1bad)

github at latex-project.org github at latex-project.org
Wed Nov 29 17:13:41 CET 2023


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

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

commit f1de1bada776a378a11465ad5e3c209638c17245
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Nov 29 17:13:41 2023 +0100

    display sockets


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

f1de1bada776a378a11465ad5e3c209638c17245
 required/latex-lab/latex-lab-math.dtx | 87 ++++++++++++++++++++++-------------
 1 file changed, 54 insertions(+), 33 deletions(-)

diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index 633d1dba..9736ea71 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -227,6 +227,8 @@
 %       \end{itemize}
 %   \end{itemize} 
 %    
+%  \subsection{Display math}
+%    
 %    
 %   
 % \section{Known current bugs, etc.}
@@ -464,6 +466,26 @@
 %    \end{macrocode}
 % \end{variable}
 % 
+% \subsection{Tagging tools}
+% The following commands implement small tagging code chunks. 
+% This should probably be collected and moved into tagpdf later.
+% \begin{macro}{\__tag_tool_close_P:}
+% This closes a P/text-chunk, both the MC and the structure and
+% increases the counter manually.
+%    \begin{macrocode}
+\cs_new_protected:Npn \__tag_tool_close_P: 
+  {
+    \tag_if_active:T
+     {
+       \tag_mc_end: %end P-chunk, should perhaps be \tag_mc_end_push: ...
+         \__tag_gincr_para_end_int:
+         \__tag_check_para_end_show:nn{red}{} %debug: show para
+         \tag_struct_end:
+     }
+  }
+%    \end{macrocode}
+% \end{macro}
+% 
 % \subsection{Sockets}
 % \subsubsection{Main inline math sockets}
 % 
@@ -508,6 +530,9 @@
   {  
     \socket_use:n{tagsupport/math/content}
     \socket_use:n{tagsupport/math/struct/begin}
+%    \end{macrocode}
+% TODO: does inline math need subformula handling?
+%    \begin{macrocode}
     % inner formula if multiple parts (not really implemented yet)
     \socket_use:n{tagsupport/math/substruct/begin}
     #1
@@ -548,11 +573,12 @@
 \socket_new_plug:nnn
   {tagsupport/math/display/begin}
   {default}
-  { \@kernel at close@P }
+  { \__tag_tool_close_P:  }
 \socket_new_plug:nnn
   {tagsupport/math/display/end}
   {default}
-  {}  
+  {
+  }  
 %    \end{macrocode}
 % \end{plugdecl}
 
@@ -570,6 +596,8 @@
   {tagsupport/math/display/formula/end}
   {default}
   {  
+    \socket_use:n{tagsupport/math/substruct/end}
+    \socket_use:n{tagsupport/math/struct/end}
   }  
 %    \end{macrocode}
 % \end{plugdecl}
@@ -853,28 +881,22 @@
       }
   }
 %    \end{macrocode}
-% To allow to use the code without tagging we guard. But probably tagpdf should
-% provide some tools for such manual para-ends.
+% 
+% The end code is added through a \cs{aftergroup} so we
+% store it inside a command.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@kernel at close@P {
-   \tag_if_active:T
-    {
-     \tag_mc_end: %end P-chunk, should perhaps be \tag_mc_end_push: ...
-        \__tag_gincr_para_end_int:
-        \__tag_check_para_end_show:nn{red}{} %debug: show para
-        \tag_struct_end:
-    }
-}
-
-\cs_new_protected:Npn \@@_tag_dollardollar_display_end: {
-%  \typeout{== tag dollarldollar display end}
-%  \ShowTagging{struct-stack}
- % \tagpdfparaOff
-  \para_raw_end:
-  \tagpdfparaOn
-  \l_@@_tmpa_skip \lastskip
-  \@kernel at math@end
-  \penalty \postdisplaypenalty
+\cs_new_protected:Npn \@@_tag_dollardollar_display_end: 
+  {
+    %  \typeout{== tag dollarldollar display end}
+    %  \ShowTagging{struct-stack}
+    \para_raw_end:
+%    \end{macrocode}
+% TODO why is that needed? where is para-tagging disabled?
+%    \begin{macrocode}
+    \tagpdfparaOn
+    \l_@@_tmpa_skip \lastskip
+    \socket_use:n{tagsupport/math/display/formula/end}    
+    \penalty \postdisplaypenalty
 %    \end{macrocode}
 % This reinserts the below display skips. It must be doubled to
 % get the right amount:
@@ -1111,8 +1133,7 @@
        }
        {
 %         \typeout{==>A3}
-         \@kernel at close@P
-%         \tagmcend                      % needs correction!
+         \__tag_tool_close_P: 
        }
   \@kernel at math@begin
   \tagpdfparaOff
@@ -1123,7 +1144,7 @@
 %  \typeout{==>MC2}\ShowTagging{mc-current}
   \para_raw_end:
   \tagpdfparaOn
-  \@kernel at math@end
+  \socket_use:n{tagsupport/math/display/formula/end}
 %  \typeout{==>MC3}\ShowTagging{mc-current}
   \@endpetrue
 }
@@ -1277,13 +1298,13 @@
 %  or just
 % \tagmcbegin{}
 }
-\def\@kernel at math@end {
-%  \typeout{==>~math~end}
-%  \ShowTagging{struct-stack}
-  \socket_use:n{tagsupport/math/substruct/end}
-  \socket_use:n{tagsupport/math/struct/end}
-%  \ShowTagging{struct-stack}
-}
+%\def\@kernel at math@end {
+%%  \typeout{==>~math~end}
+%%  \ShowTagging{struct-stack}
+%  \socket_use:n{tagsupport/math/substruct/end}
+%  \socket_use:n{tagsupport/math/struct/end}
+%%  \ShowTagging{struct-stack}
+%}
 
 \exp_args:No \tex_everymath:D
   {





More information about the latex3-commits mailing list.