[latex3-commits] [latex3/latex2e] UF-latex-lab-tikz: start tikz support WIP (004e95f0)
github at latex-project.org
github at latex-project.org
Thu Oct 10 17:04:36 CEST 2024
Repository : https://github.com/latex3/latex2e
On branch : UF-latex-lab-tikz
Link : https://github.com/latex3/latex2e/commit/004e95f0d01bbcc6ff129a1a44d7b7c43c6c3837
>---------------------------------------------------------------
commit 004e95f0d01bbcc6ff129a1a44d7b7c43c6c3837
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Thu Oct 10 17:04:36 2024 +0200
start tikz support WIP
>---------------------------------------------------------------
004e95f0d01bbcc6ff129a1a44d7b7c43c6c3837
required/latex-lab/latex-lab-tikz.dtx | 51 +++++++++++++++++++++--------------
required/latex-lab/latex-lab.ins | 5 ++++
2 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/required/latex-lab/latex-lab-tikz.dtx b/required/latex-lab/latex-lab-tikz.dtx
index f67d550d..12322658 100644
--- a/required/latex-lab/latex-lab-tikz.dtx
+++ b/required/latex-lab/latex-lab-tikz.dtx
@@ -89,6 +89,7 @@
% \tikzname\ processes the keys too late to allow to do this in the optional argument.
%
%
+%
% \section{Implementation}
% \begin{macrocode}
%<*package>
@@ -96,7 +97,7 @@
% \end{macrocode}
% \begin{macrocode}
\ProvidesExplPackage {latex-lab-testphase-tikz} {\ltlabtikzdate} {\ltlabtikzversion}
- {Code related to the tagging of \tikzname\ pictures}
+ {Code related to the tagging of tikz pictures}
% \end{macrocode}
%
% \subsection{Sockets}
@@ -224,33 +225,43 @@
% \end{macrocode}
% \end{plugdecl}
%
-% We hook into two pgf commands to add the tagging code
-% TODO: check if that is safe and ask for an interface.
-% If the text should be tagged we resume tagging.
-% \begin{macrocode}
-\def\pgfsys at begin@text
- {
- \bool_if:NT\l__tag_tikzpicture_usetext_bool
- {\ResumeTagging{\tikzpicture}}
- \UseTaggingSocket{tikzpicture/textbegin}
- }
-\def\pgfsys at end@text
- {
- \UseTaggingSocket{tikzpicture/textend}
- \bool_if:NT\l__tag_tikzpicture_usetext_bool
- {\SuspendTagging{\tikzpicture} }
- }
-% \end{macrocode}
-%
% \begin{plugdecl}{default (tagsupport/tikzpicture/alt)}
% This setups the alt key.
% \begin{macrocode}
\NewSocketPlug{tagsupport/tikzpicture/alt}{default}
{ \keys_set:nn { __tag / struct }{alt=#1} }
\AssignSocketPlug{tagsupport/tikzpicture/alt}{default}
-\tikzset{alt/.code={\UseTaggingSocket{tikzpicture/alt}{#1}}}
% \end{macrocode}
% \end{plugdecl}
+%
+% \subsection{Hooking into \tikzname}
+% \begin{macrocode}
+\AddToHook{package/tikz/after}
+ {
+% \end{macrocode}
+% at first we add an alt key.
+% \begin{macrocode}
+ \tikzset{alt/.code={\UseTaggingSocket{tikzpicture/alt}{#1}}}
+% \end{macrocode}
+% We hook into two pgf commands to add the tagging code
+% TODO: check if that is safe and ask for an interface.
+% If the text should be tagged we resume tagging.
+% \begin{macrocode}
+ \def\pgfsys at begin@text
+ {
+ \bool_if:NT\l__tag_tikzpicture_usetext_bool
+ {\ResumeTagging{\tikzpicture}}
+ \UseTaggingSocket{tikzpicture/textbegin}
+ }
+ \def\pgfsys at end@text
+ {
+ \UseTaggingSocket{tikzpicture/textend}
+ \bool_if:NT\l__tag_tikzpicture_usetext_bool
+ {\SuspendTagging{\tikzpicture} }
+ }
+ }
+
+% \end{macrocode}
% \begin{macrocode}
%</package>
% \end{macrocode}
diff --git a/required/latex-lab/latex-lab.ins b/required/latex-lab/latex-lab.ins
index 7071ed6e..7b7565ca 100644
--- a/required/latex-lab/latex-lab.ins
+++ b/required/latex-lab/latex-lab.ins
@@ -165,6 +165,11 @@ where one can also log issues in case there are any.
\generate{\file{marginpar-latex-lab-testphase.ltx}{\from{latex-lab-marginpar.dtx}{latex-lab}}}
\generate{\file{latex-lab-testphase-marginpar.sty}{\from{latex-lab-marginpar.dtx}{package}}}
+%tikz support
+\generate{\file{tikz-latex-lab-testphase.ltx}{\from{latex-lab-tikz.dtx}{latex-lab}}}
+\generate{\file{latex-lab-testphase-tikz.sty}{\from{latex-lab-tikz.dtx}{package}}}
+
+
% stop docstrip adding \endinput
\preamble
\endpreamble
More information about the latex3-commits
mailing list.