[latex3-commits] [latex3/tagpdf] testtikzpicture: tag tikzpictures, WIP (3c68258)

github at latex-project.org github at latex-project.org
Sat Mar 23 18:06:16 CET 2024


Repository : https://github.com/latex3/tagpdf
On branch  : testtikzpicture
Link       : https://github.com/latex3/tagpdf/commit/3c68258784b6280b9dc9e503bac725b28d40bd4b

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

commit 3c68258784b6280b9dc9e503bac725b28d40bd4b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Mar 23 18:06:16 2024 +0100

    tag tikzpictures, WIP


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

3c68258784b6280b9dc9e503bac725b28d40bd4b
 doc/tagpdf.tex             | 16 ++++++++--------
 doc/tagpdfdocu-patches.sty | 16 +++++++++++++---
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/doc/tagpdf.tex b/doc/tagpdf.tex
index a08b4e6..7f146c3 100644
--- a/doc/tagpdf.tex
+++ b/doc/tagpdf.tex
@@ -722,11 +722,11 @@ To tag a \PDF{} three tasks must be  carried out:
 
 \minisec{Page stream with marked content}
 
-\tagpdfparaOff
-
-\tagstructbegin{tag=Figure,alt={Illustration of page stream with marked content},attribute=bbox}%
-\tagmcbegin{tag=Figure}%
-\begin{tikzpicture}[baseline=(a.north),node distance=2pt,remember picture]
+%\tagpdfparaOff
+%
+%\tagstructbegin{tag=Figure,alt={Illustration of page stream with marked content},attribute=bbox}%
+%\tagmcbegin{tag=Figure}%
+\begin{tikzpicture}[baseline=(a.north),node distance=2pt,remember picture,alt={Illustration of page stream with marked content}]
 \node(start){\ldots~\ldots~\ldots};
 \node[draw,base right = of start](a) {mc-chunk 1};
 \node[draw,base right = of a](b) {mc-chunk 2};
@@ -734,9 +734,9 @@ To tag a \PDF{} three tasks must be  carried out:
 \node[draw,base right = of c](d) {mc-chunk 3};
 \node[base right = of d] {\ldots~\ldots};
 \end{tikzpicture}
-\tagmcend\tagstructend
-
-\tagpdfparaOn
+%\tagmcend\tagstructend
+%
+%\tagpdfparaOn
 
 
 \minisec{Structure}
diff --git a/doc/tagpdfdocu-patches.sty b/doc/tagpdfdocu-patches.sty
index 17baec2..abea5e4 100644
--- a/doc/tagpdfdocu-patches.sty
+++ b/doc/tagpdfdocu-patches.sty
@@ -79,12 +79,22 @@
    \tag_mc_artifact_group_begin:n{notype}\tagpdfparaOff\marginnote{#1}\tag_mc_artifact_group_end:
  }
 
-\ExplSyntaxOff
+
 % ======== tikzpicture ==========
 % TODO this needs some investigation: it messes up the stack if one add paraOff
 
-\AddToHook{env/tikzpicture/begin}{}
-
+\AddToHook{env/tikzpicture/before}{%
+ \ifvmode
+  {
+   \socket_assign_plug:nn {tagsupport/para/begin}{plain}
+   \UseTaggingSocket{para/begin}
+  } 
+ \fi
+  \tag_mc_end_push:\tagstructbegin{tag=Figure,attribute=bbox}\tagmcbegin{}\tag_stop:n{tikzpicture}}
+\AddToHook{env/tikzpicture/after}{%
+ \tag_start:n{tikzpicture}\tagmcend\tagstructend\tag_mc_begin:n{}}
+\tikzset{alt/.code={\keys_set:nn { __tag / struct }{alt=#1}}}
+\ExplSyntaxOff
 %======== tcolorbox ========
 % We switch of paratagging at the begin and reenable it locally in before upper.
 % the before upper setting is dangerous as it can be overwritten by





More information about the latex3-commits mailing list.