latex3 / tagging-project

Issues related to the tagging project
LaTeX Project Public License v1.3c
21 stars 3 forks source link

Is there a way to (locally) turn-off all socket plugs activated as a result from \footnote command and marked as coming from tagsupport? #59

Open jfbu opened 5 months ago

jfbu commented 5 months ago

I had to do this:

\AssignSocketPlug{tagsupport/fnmark}{identity}%
\AssignSocketPlug{tagsupport/fntext/begin}{noop}%
\AssignSocketPlug{tagsupport/fntext/end}{noop}%
\AssignSocketPlug{tagsupport/fntext/text}{identity}%
\AssignSocketPlug{tagsupport/fntext/mark}{identity}%

at this jfbu/etoc commit. Is there a shortcut?

Relates jfbu/etoc#19

u-fischer commented 5 months ago

Is there a shortcut?

Not really. I mean I could define a \tagpdfsetup key similar to the one for table tagging. But disabling tagging of footnotes is imho not really something that a normal user should need and in a package disabling sockets directly is faster.

Generally it looks a bit dangerous to disable the sockets. I mean if you compile e.g. this with lualatex you will loose part of the text as it is suddenly marked as artifact:

\DocumentMetadata{uncompress,testphase=phase-III}
\documentclass[]{article}
\usepackage{lipsum}
\textheight=3cm
\begin{document}
\AssignSocketPlug{tagsupport/fnmark}{identity}%
\AssignSocketPlug{tagsupport/fntext/begin}{noop}%
\AssignSocketPlug{tagsupport/fntext/end}{noop}%
\AssignSocketPlug{tagsupport/fntext/text}{identity}%
\AssignSocketPlug{tagsupport/fntext/mark}{identity}%

Hello,\footnote{abc} Welt \lipsum[1]

\end{document}
jfbu commented 5 months ago

Thanks I was on the road and forgot to add earlier that although I am quite interested in my original formulation to which you replied (thanks) I saw later that I had raised an XY problem.

The real question is at same time different than this one, more general in a way although still specific: is it possible to disable (locally) all tagging support except for specific one, in my case the \@starttoc and \contentsline hooks. cf jfbu/etoc/etoctagging.md.

FrankMittelbach commented 3 months ago

This seems to turn more in a discussion than an issue. Anyway, I think it requires a clear use case. There is one for disabling all tagging, i.e., when doing trial typesetting except for the last run.

But the intention to turn of "all tagging except ..." is something that I don't think works, if you have to deal with basically arbitrary input. So my expectation is that you may have to define different actions to sockets for toc handling if you provide more complicated toc handling, but leave tagging of data within the toc lines to normal tag processing.

jfbu commented 2 weeks ago

But the intention to turn of "all tagging except ..." is something that I don't think works, if you have to deal with basically arbitrary input.

During first half of January 2024 I spent some time examining what was at stake regarding tagging versus etoc package. Etoc means that user can use arbitrary LaTeX constructs to render how title (aka name in etoc lingua), "number" (which may not be a number because LaTeX has already applied \the... transformation), and page number are used. These various elements can be rendered using arbitrary methods, for example one could draw a 2D perspective of a 3D rendering of the TOC which would be some hierarchical graph for example. My concluions then was that the sole possibility was for all tagging to be turned off except for the sole tagging which is specific to the linear agencement of traditional TOCs which the PDF tagging specs enforce, where the only structure added is a hierarchical structure (which by the way had always been a feature of etoc so initially I was optimistic). Turns out the tags (attow I have forgotten those arbitrary human-made specs something like TOC and TOC-line whatever) are hostile to hosting any sub-tags. As the whole point of the tagging project is to add tagging to all vanilla LaTeX structures, basically anything beyond basics with etoc is doomed to fail. The sole escape appears to be that etoc has a way to deactivate entirely all tagging for the duration of its business of TOC-typesetting except for the sole TOC-related one.

u-fischer commented 2 weeks ago

well you do not want to stop all tagging. E.g. if you have link inside the TOCI-entry you would still want a Link structure around it. What you want is that different tags are used to get something that is allowed inside a TOCI. And that is quite possible. If you look e.g. at the table tagging (in latex-lab-table) you can see that with \tagpdfsetup{table/tagging=presentation} all table tags are switched and no TH, TR, TD are used anymore. Another option (in PDF 2.0) would be to switch to another namespace with different role mapping.

But to understand what tag set is really sensible inside a TOCI real world examples are needed. I would suggest that you ignore at first all the "Parent-Child" warnings and then one can look and test which remapping makes sense.

jfbu commented 1 week ago

@u-fischer Thanks. I described mid-January there (see the items having heading But ultimately the following can not be avoided) what was the current situation of etoc regarding tagging.