Skip to content

Provide conditional to test if document is tagged #729

Open
@gusbrs

Description

@gusbrs

I'd like to suggest the provision of a conditional to test whether "the document is supposed to be tagged and the tagging infrastructure (currently provided by tagpdf) is expected to be available". Let's say \tag_if_enabled:TF.

I'm aware, of course, of \tag_if_active:TF, but it falls short for a couple of reasons:

  • The kernel does provide a dummy definition for it, but only at begindocument, so a package cannot count on its existence in the preamble.
  • \tag_if_active:TF tests if tagging is "currently active", depending on \l__tag_active_struct_bool and \l__tag_active_mc_bool which may be toggled by \tag_stop:/\tag_start: and friends. Which is different from "the document is supposed to be tagged".

As use case for motivation, my attempts to add tagging support to postnotes included a number of tasks which must be globally performed as long as the document is intended to be tagged, regardless of current state of "activation" of tagging (of \l__tag_active_struct_bool and \l__tag_active_mc_bool, that is). These are basically a number of cross-references and passing information around from the mark to the note (and back). But these must be available at all times. Suppose someone stops tagging at the place the mark is placed but then turns it on again when the note is supposed to be printed. If the cross-reference is not there, there's no hope the latter will work. (True, in this case, things will likely go wrong for other reasons, but I hope you get what I mean). However, there's also no reason to set these things if the document is not supposed to be tagged at all.

I'm currently testing for:

\bool_lazy_and:nnT
  { \cs_if_exist_p:N \tag_if_active_p: }
  { \tag_if_active_p: }

And expecting no one has any reason to call \tag_stop: in the preamble. But it feels weird...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions