[latex3-commits] [latex3/latex2e] latex-lab/uf-review-05: move text content to socket (9eea726a)
github at latex-project.org
github at latex-project.org
Tue Nov 21 16:25:04 CET 2023
Repository : https://github.com/latex3/latex2e
On branch : latex-lab/uf-review-05
Link : https://github.com/latex3/latex2e/commit/9eea726a96cd3ffe1222d960361893ab1758191e
>---------------------------------------------------------------
commit 9eea726a96cd3ffe1222d960361893ab1758191e
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Tue Nov 21 16:25:04 2023 +0100
move text content to socket
>---------------------------------------------------------------
9eea726a96cd3ffe1222d960361893ab1758191e
required/latex-lab/latex-lab-math.dtx | 67 ++++++++++++++++++++++++++++-------
1 file changed, 54 insertions(+), 13 deletions(-)
diff --git a/required/latex-lab/latex-lab-math.dtx b/required/latex-lab/latex-lab-math.dtx
index a21c7670..2e1f5e18 100644
--- a/required/latex-lab/latex-lab-math.dtx
+++ b/required/latex-lab/latex-lab-math.dtx
@@ -383,8 +383,58 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\l_@@_mathcontent_alt_tl,
+% \l_@@_mathcontent_actual_tl,
+% \l_@@_mathcontent_AF_tl}
+% Temporary variables to hold math content that should
+% be used in actual or alt text and stored as AF.
+% \begin{macrocode}
+\tl_new:N \l_@@_mathcontent_alt_tl
+\tl_new:N \l_@@_mathcontent_actual_tl
+\tl_new:N \l_@@_mathcontent_AF_source_tl
+\tl_new:N \l_@@_mathcontent_AF_mathml_tl
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Sockets}
%
+% \begin{socketdecl}{tagsupport/math/content}
+% The math content is stored in associated files and used for
+% actual and alternative text. As the exact text is still
+% unclear we use a socket to be able to test variants.
+% The socket should set all four tl vars above, if needed
+% to identical values. It can use the two variables
+% \cs{g_@@_grabbed_env_tl} and \cs{g_@@_grabbed_math_tl}
+% \begin{macrocode}
+\socket_new:nn {tagsupport/math/content}{0}
+% \end{macrocode}
+% \end{socketdecl}
+%
+% \begin{plugdecl}{actual+source}
+% TODO: think about some naming convention ...
+% \begin{macrocode}
+\socket_new_plug:nnn
+ {tagsupport/math/content}
+ {actual+source}
+ {
+ \tl_set:Ne\l_@@_mathcontent_actual_tl
+ {
+ LaTeX~ formula~ starts~
+ \exp_not:N\begin{\g_@@_grabbed_env_tl}
+ \c_space_tl
+ \exp_not:V\g_@@_grabbed_math_tl
+ \c_space_tl
+ \exp_not:N\end{\g_@@_grabbed_env_tl}
+ \c_space_tl LaTeX~ formula~ ends~
+ }
+ \tl_set_eq:NN \l_@@_mathcontent_AF_source_tl \l_@@_mathcontent_actual_tl
+ \tl_set:Nn \l_@@_mathcontent_AF_mathml_tl {}
+ \tl_set:Nn \l_@@_mathcontent_AF_alt_tl {}
+ }
+\socket_assign_plug:nn {tagsupport/math/content}{actual+source}
+% \end{macrocode}
+% \end{plugdecl}
+%
% \begin{socketdecl}{tagsupport/math/inline/begin,
% tagsupport/math/inline/end,
% tagsupport/math/inline/formula/begin,
@@ -991,21 +1041,12 @@
\def\@kernel at math@begin {
% \typeout{==>~math~begin}
% needs different handling if we support nesting
- \tl_gset:Ne\tmpmathcontent
- {
- LaTeX~ formula~ starts~
- \exp_not:N\begin{\g_@@_grabbed_env_tl}
- \space
- \exp_not:V\g_@@_grabbed_math_tl
- \space
- \exp_not:N\end{\g_@@_grabbed_env_tl}
- \space LaTeX~ formula~ ends~
- }
+ \socket_use:n{tagsupport/math/content}
\tagstructbegin{tag=Formula,
- AFinline-o=\tmpmathcontent,
+ AFinline-o=\l_@@_mathcontent_AF_source_tl,
title-o=\g_@@_grabbed_env_tl,
- actualtext=\tmpmathcontent
-% alt=\tmpmathcontent
+ actualtext=\l_@@_mathcontent_actual_tl,
+ alt=\l_@@_mathcontent_alt_tl
}
% inner formula if multiple parts (not really implemented yet)
\grabaformulapartandstart
More information about the latex3-commits
mailing list.