\documentclass{article}
\usepackage{hyperref}
\title{The luatagging package}
\author{Marcel Krüger}
\date{\today}
\NewDocumentCommand \pkg {m} {\texttt{#1}}
\begin{document}
\maketitle
\renewcommand\abstractname{Disclaimer}
\begin{abstract}
This package is a development experiment to make tagged Lua\LaTeX{} documents faster.
Currently it only works with \LaTeX{} dev formats and can silently break the tagging structure of your documents.
When using this, carefully verify the generated PDF to ensure correct results.

For practical generation of tagged PDFs in Lua\LaTeX, instead refer to \url{https://latex3.github.io/tagging-project/}.
\end{abstract}
\section{Introduction}
In order to make PDF files generated by \LaTeX{} more accessible to all users it is important to add tagging structures to them.
As part of the \LaTeX{} teams tagging project a lot of progress has been made to enable the generation of tagged documents, but adding these additional structures often significantly increases the compile times.

This package contains experimental an reimplementation of parts of \pkg{tagpdf}'s backend which try to reduce these compile time overheads when compiling with Lua\LaTeX{}.

\section{Usage}
In order to try \pkg{luatagging}, first set up tagging without \pkg{luatagging} following the instructions in \url{https://latex3.github.io/tagging-project/}. Ensure that the selected PDF standard uses PDF 2.0, for example by selecting \texttt{ua-2}.
A document which can be used with \pkg{luatagging} should typically start with something like
\begin{verbatim}
\DocumentMetadata {
  pdfstandard = ua-2,
  tagging = on
}
\end{verbatim}

Then \pkg{luatagging} can be loaded by adding \verb+\RequirePackage{luatagging}+ \emph{before} \verb|\DocumentMetadata|.
No changes to the main part of the document should be needed.

\section{Restrictions and known issues}
Some features supported by \pkg{tagpdf} are currently not supported when \pkg{luatagging} is loaded.
The most important restrictions are
\begin{description}
  \item[Only PDF 2.0] Generating tagged PDF 1.7 documents is currently not supported since namespace support is always active. Configuring PDF 1.7 will generate a document which contains invalid role mapping for this format and therefore not valid tagging.
  \item[Tagging always active] Disabling tagging while still loading \pkg{luatagging} by setting \texttt{tagging=off} in \verb|\DocumentMetadata| is not supported. The goal of \pkg{luatagging} is to make tagging fast enough that there is never a reason to disable it.
  \item[Small differences in generated structure] The structure tree generated by \pkg{tagpdf} and \pkg{luatagging} are not identical. The most common differences are that \pkg{tagpdf} generated IDs for structure elements which are omitted in \pkg{luatagging} and in some cases \pkg{tagpdf} injects empty marked content structures which get omitted y \pkg{luatagging}. Usually these differences should not have practical effects, but they do show up when comparing generated files.

    Also insertion of space characters differs in edge-cases.
\end{description}
To find additional known issues or to report additional not yet known issues, refer to the issue tracker under \url{https://todo.sr.ht/~zauguin/luatagging}.
\end{document}
