latex3 / tagging-project

Issues related to the tagging project
https://latex3.github.io/tagging-project/
LaTeX Project Public License v1.3c
23 stars 5 forks source link

TOC has no hyperrefs – tikzpicture not side by side possible #88

Open gnuusers opened 1 week ago

gnuusers commented 1 week ago

Hello,

at first, thank you so much for your work. We are currently writing a document for the Gesellschaft für Informatik (GI) that should be completely accessible. And it is so good, that this tagging project s so far…

But I have two issues. Working with luatex and the latest texlive sources.

First: The toc somehow does not get clickable links. Why is that?

Second: I have a bit more complex tcolorbox or in fact two side-by-side. With the hack of tagpdfdocu-patch I can get it unterneath each other with correct tagging. Side by side the tagging is fine, but there will be an additional PathPathPathPath tag that will confuse. How can I prevent that?

\DocumentMetadata{
  lang        = de,
  pdfversion  = 2.0,
  pdfstandard = ua-2,
  pdfstandard = a-4f, 
  testphase   = 
   {phase-III,
    title,
    table
    firstaid},
  uncompress,
}
\tagpdfsetup{%  
    activate/all,
    tabsorder=structure,
}
\documentclass[%
    a4paper,
    toc=flat,
    fontsize=10pt,
    parskip=half,
]{scrartcl}
\usepackage{scrlayer-scrpage}

\usepackage[%
]{hyperref}

\usepackage[dvipsnames,svgnames]{xcolor}

\definecolor{giBlue}{RGB}{14,32,80}
\definecolor{giYellow}{RGB}{255,230,0}
\definecolor{giLightYellow}{RGB}{255,242,204}
\definecolor{giGray}{RGB}{74,74,74}

\colorlet{seccolor}{giBlue}
\colorlet{subseccolor}{giBlue}
\colorlet{concolor}{giBlue}

\providecommand\Title{Bildungsstandards Informatik für die Sekundarstufe I}
\providecommand\Datum{2025}
\providecommand\Author{Gesellschaft für Informatik}

\title{\Title}
\author{\Author}

\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\tcbuselibrary{skins}
\tcbuselibrary{raster}
\tcbuselibrary{many}

\AddToHook{env/tikzpicture/begin}{}

\AddToHook{env/tcolorbox/begin}{\tagpdfparaOff \tcbset{before upper=\tagpdfparaOn}}

\newcommand{\prozessInhaltsBox}[3][4mm]{%
    \par\medskip\vspace{1pt}\vspace{#1}\noindent
    \begin{tcolorbox}[%
                               width=\textwidth/2-4mm,
                               colback=white,
                               colframe=giBlue!0!giYellow,
                               arc=0mm,
                title={Titel 1},
                               fonttitle=\color{black},
                enhanced jigsaw,
                grow sidewards by=2mm,
                borderline={4mm}{-4mm}{giGray!5!white},
                sharp corners=all,
                borderline={0.5pt}{0pt}{giYellow},
                nobeforeafter,
                before=\tagstructbegin{tag=Div},
                after=\tagstructend,
                equal height group=grp1,
            ]
        \begin{itemize}[left=\parindent+2mm,itemsep=\parskip]% WOLF
            \raggedright
            #2
        \end{itemize}
        \end{tcolorbox}\hspace{8mm}%
        \begin{tcolorbox}[%
                              width=\textwidth/2-4mm,
                              colback=white,
                              colframe=giBlue!0!giYellow,
                              arc=0mm,
                  title={Titel 2},
                                fonttitle=\color{black},
                enhanced jigsaw,
                grow sidewards by=2mm,
                borderline={4mm}{-4mm}{giGray!5!white},
                sharp corners=all,
                borderline={0.5pt}{0pt}{giYellow},
                nobeforeafter,
                before=\tagstructbegin{tag=Div},
                after=\tagstructend,
                equal height group=grp1,
      ]
        \begin{itemize}[left=\parindent+2mm,itemsep=\parskip]
            \raggedright
            #3
        \end{itemize}
    \end{tcolorbox}
}

\begin{document}
\pagestyle{scrheadings}
\lehead[scrheadings]{\textsc{\Title} (\Datum)}
\lohead[scrheadings]{\textsc{\Title} (\Datum)}
\cehead{test}
\rehead{}

%\tagtool{sec-add-grouping=false}
\tableofcontents
%\tagtool{sec-add-grouping}

\clearpage
 \section{Überschrift}
        \subsection{Unterüberschrift}

        Text…

\prozessInhaltsBox{
    \item[MI]{Items}
}{
    \item[ID]{Auch mal längere Items}
}

\end{document}
u-fischer commented 1 week ago

Ah, scrartcl. Well yes, that class overwrites most of the settings again.

gnuusers commented 1 week ago

Is there a possible fix?

FrankMittelbach commented 1 week ago

Is there a possible fix?

for the moment only to use a class that is supported already. I'm fairly sure scartcl will follow eventually but for now it isn't.

u-fischer commented 1 week ago

Regarding the second issue (side remark: if you have two issues, please split them also into two issues, that makes it easier to track solutions):

tcolorbox is naturally quite complicated as there are lots of box operations and drawings etc going on. It inherits in some parts tagging from the minipage/parbox tagging and also from the paragraph tagging: this can be sometimes good, and sometimes be a problem. In your example it is actually probably the best to do nothing and use the automatic tagging. That looks quite ok. And additional structure around each box would be nice, but this requires more thinking.

I added also some code to suppress the tagging of the skins. I will suggest to the tcolorbox maintainer to add that by default.

\DocumentMetadata{
  lang        = de,
  pdfversion  = 2.0,
  pdfstandard = ua-2,
  pdfstandard = a-4f, 
  testphase   = 
   {phase-III,
    title,
    table
    firstaid},
  uncompress,
}

\tagpdfsetup{tabsorder=structure}

\documentclass[]{article}

\usepackage[]{hyperref}

\usepackage[dvipsnames,svgnames]{xcolor}

\definecolor{giBlue}{RGB}{14,32,80}
\definecolor{giYellow}{RGB}{255,230,0}
\definecolor{giLightYellow}{RGB}{255,242,204}
\definecolor{giGray}{RGB}{74,74,74}

\usepackage[many]{tcolorbox}

\ExplSyntaxOn\makeatletter
\NewSocket{tagsupport/tcb/drawing/begin}{0}
\NewSocket{tagsupport/tcb/drawing/end}{0}
\NewSocketPlug{tagsupport/tcb/drawing/begin}{suspend}
 {\tag_mc_end_push:\tag_mc_begin:n{artifact}}
\NewSocketPlug{tagsupport/tcb/drawing/end}{resume}
 {\tag_mc_end:\tag_mc_begin_pop:n{}}
\AssignSocketPlug{tagsupport/tcb/drawing/begin}{suspend} 
\AssignSocketPlug{tagsupport/tcb/drawing/end}{resume}

% should be done in tcolorbox.sty directly:
\AddToHook{cmd/tcb@drawing@env@begin/before}
  {\UseTaggingSocket{tcb/drawing/begin}\SuspendTagging{tcb/drawing}}
\AddToHook{cmd/tcb@drawing@env@end/after}
  {\ResumeTagging{tcb/drawing}\UseTaggingSocket{tcb/drawing/end}}
\ExplSyntaxOff
\makeatother

\newcommand{\prozessInhaltsBox}[3][4mm]{%
    \par\medskip\vspace{1pt}\vspace{#1}\noindent
    \begin{tcolorbox}[%
                               width=\textwidth/2-4mm,
                               colback=white,
                               colframe=giBlue!0!giYellow,
                               arc=0mm,
                title={Titel 1},
                               fonttitle=\color{black},
                enhanced jigsaw,
                grow sidewards by=2mm,
                borderline={4mm}{-4mm}{giGray!5!white},
                sharp corners=all,
                borderline={0.5pt}{0pt}{giYellow},
                nobeforeafter,
                equal height group=grp1,
            ] 
        \begin{itemize}% removed optional argument to be able to test without tagging!
            #2
        \end{itemize}
        \end{tcolorbox}%
        \hspace{8mm}%
        \begin{tcolorbox}[%
                              width=\textwidth/2-4mm,
                              colback=white,
                              colframe=giBlue!0!giYellow,
                              arc=0mm,
                title={Titel 2},
                                fonttitle=\color{black},
                enhanced jigsaw,
                grow sidewards by=2mm,
                borderline={4mm}{-4mm}{giGray!5!white},
                sharp corners=all,
                borderline={0.5pt}{0pt}{giYellow},
                nobeforeafter,
                equal height group=grp1,
      ]
        \begin{itemize}
            #3
        \end{itemize}
    \end{tcolorbox}
    \par
}

\begin{document}

\prozessInhaltsBox{
    \item[MI]{Items}
}{
    \item[ID]{Auch mal längere Items}
}

\end{document}
gnuusers commented 1 week ago

Thank you so much. And yes. Two different problems should be two issues. I was not thinking right ;-)