Closed jfbu closed 8 months ago
Ah, hidden math (the leaders use math mode). Try this:
\ExplSyntaxOn
\makeatletter
\def\@dottedtocline@cfgpoint@leaders#1{%
\tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:}
\ExplSyntaxOff
I will add that to the toc-tagging code.
confirming your patch makes the warnings go away...
this also explains why in my real life example which was with etoc package I did not have those warnings, but I have other stuff I will report later on only for the record, but currently etoc has no special tagging support so this was not unexpected
Well with etoc activated like something like this in preamble
\usepackage{etoc}
\etoctoclines
\etocruledstyle{\color{blue}\normalfont\large\bfseries\contentsname }
there are no Warnings as \@dottedtocline
is not executed.
The problems I had encountered was when \href
had not been neutralized by the \def\href#1#2{[#2](#1)}
in the preamble. But these problems also show without etoc:
\DocumentMetadata{testphase={phase-III,math}}
\documentclass[a4paper]{article}
\ExplSyntaxOn
\makeatletter
\def\@dottedtocline@cfgpoint@leaders#1{%
\tag_mc_begin:n{artifact}\tag_stop:n{leaders}\nobreak#1\nobreak\tag_start:n{leaders}\tag_mc_end:}
\ExplSyntaxOff
\usepackage{color}
\usepackage{hyperref}
\hypersetup{
% linktoc=all,%
colorlinks=true,%
}
\usepackage{bookmark}
\def\mst{mst }
% \def\href#1#2{[#2](#1)}
\begin{document}
%\show\foo
\tableofcontents
%\show\foo
\section{What \mst does}
\subsection{Aim of this package and basic usage}
\subsection{Miscellanea}
\subsection{Examples}
\subsection{Main options}
\subsubsection{The {italic} option}
\subsubsection{The {defaultmathsizes} option}
\subsubsection{The {subdued} option}
\subsubsection{The {LGRgreek} option}
\subsection{More miscellanea}
\subsubsection{Derivative, minus, asterisk}
\subsubsection{load \mst always last}
\subsubsection{sans in math}
\subsubsection{using \mst with \href{https://ctan.org/pkg/beamer}{beamer}}
\subsubsection{avoid \texorpdfstring{\texttt{OT1}}{OT1} encoding}
\subsubsection{using \mst with \href{https://ctan.org/pkg/frenchmath}{frenchmath}}
\subsection{Math versions}
\subsection{Greek letters}
\subsubsection{The Greek-related options}
\subsubsection{Shape of Greek letters}
\subsubsection{New with {1.3x}: alphabets {mathgreekup} and
{mathgreekit}, control sequences to access directly upright or italic
Greek letters}
\subsection{Extra spaces around letters}
\subsection{Italic corrections}
\subsection{Extra glue after \texorpdfstring{{exists}}{\textbackslash
exists}, \texorpdfstring{{forall}}{\textbackslash forall}, and before the prime glyph}
\subsection{Extended scope of the math alphabets commands}
\subsection{Unicode engines}
\subsubsection{The unicodeminus option}
\subsubsection{Two examples}
\subsection{Compatibility issues}
\section{Package commands}
\subsection{Commands for regular usage}
\subsubsection{Preamble-only commands}
\subsubsection{Commands for body or math}
\subsection{Commands for expert usage}
\subsubsection{Expert commands usable everywhere}
\subsubsection{Expert commands which are preamble-only}
\subsubsection{Expert commands usable only outside of math mode}
\subsubsection{Expert commands usable only in math mode}
\section{Package options}
\subsection{Summary of main options}
\subsection{Complete list of options}
\section{Change log}
\end{document}
one gets
Package tagpdf Warning: Rule 'Link/' --> 'Link/pdf2' is not allowed (struct
(tagpdf) 62, /Link --> struct 64)
====>first-result=macro:->
====>first-tmpmathcontent=macro:->
====>formula has no subparts
====>first-result=macro:->
====>first-tmpmathcontent=macro:->
====>formula has no subparts
Package tagpdf Warning: Rule 'Link/' --> 'Link/pdf2' is not allowed (struct
(tagpdf) 71, /Link --> struct 73)
Package tagpdf Warning: Rule 'Link/' --> 'Link/pdf2' is not allowed (struct (tagpdf) 62, /Link --> struct 64)
well yes, link in link is not allowed. But it also doesn't make much sense to have an active url-link inside the toc-link. What should a click do in this case? Imho either disable links on the text in the toc, or use \texorpdfstring to avoid to get a link in the toc.
in mathastext.pdf
table of contents on page 2 (texdoc mathastext) the TOC uses hidelinks
and the embedded \href
linking to beamer or frenchmath on CTAN are not made distinctive visually (and anyhow are not functional) and if one clicks on "beamer" or "frenchmath" one ends up redirected (as expected) to the subsubsection title in mathastext.pdf. But from there the links are active: so the \href
are inserted not for TOC but for the sub-sub-section titles themselves.
Using \texorpdfstring
will only influence bookmark right?
Edit: workaround here is simply to use optional argument of \subsubsection
to avoid having links inside the TOC entries.
Using \texorpdfstring will only influence bookmark right?
Yes, sorry.
are not made distinctive visually
Well tagging is (beside others) also meant as support for blind people. It is therefore not enough to get only a visually pleasing result; the structure tree should be sane. This is a problem that will imho appear in various places, as there is lots of code around which use tricks that assume that only the visual output matters.
Well tagging is (beside others) also meant as support for blind people. It is therefore not enough to get only a visually pleasing result; the structure tree should be sane. This is a problem that will imho appear in various places, as there is lots of code around which use tricks that assume that only the visual output matters.
Yes. Sorry for my confusing langage. When I said "are not made distinctive visually" I meant to say this was anyhow quite desired and in this context the TOC used hidelinks
(although not relevant to nested situations probably). I have many voices in my brain and sometimes they all speak at the same time causing confused discourse.
Closing here as most of it is resolved. The "link-in-link" problem is tracked in https://github.com/latex3/tagging-project/issues/26
is a not quite MWE, but comes from real life. Many Warnings are raised of the type
test_tagging_hypertoc.log