texlive[65629] Master/texmf-dist: tagpdf (25jan23)
commits+karl at tug.org
commits+karl at tug.org
Wed Jan 25 21:45:01 CET 2023
Revision: 65629
http://tug.org/svn/texlive?view=revision&revision=65629
Author: karl
Date: 2023-01-25 21:45:01 +0100 (Wed, 25 Jan 2023)
Log Message:
-----------
tagpdf (25jan23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/tagpdf/README.md
trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf
trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty
trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty
Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tagpdf/README.md 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/README.md 2023-01-25 20:45:01 UTC (rev 65629)
@@ -1,6 +1,6 @@
#tagpdf — A package to create tagged pdf
-Packageversion: 0.98a
-Packagedate: 2022/12/22
+Packageversion: 0.98b
+Packagedate: 2023/01/24
Author: Ulrike Fischer
## License
Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf-code.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/doc/latex/tagpdf/tagpdf.tex 2023-01-25 20:45:01 UTC (rev 65629)
@@ -1,11 +1,22 @@
% !Mode:: "TeX:DE:UTF-8:Main"
\PassOptionsToPackage{check-declarations,enable-debug}{expl3}
-%\RequirePackage{pdfmanagement-testphase}
-\DocumentMetadata{pdfversion=2.0,lang=en-UK,testphase=phase-II,testphase=toc-tagging,testphase=sec-tagging,pdfstandard=a-2b}
+% Note on the compilation of the documentation:
+% The documentation uses for the tagging sometimes code
+% that is under development and/or not public yet.
+% To compile an *untagged* documentation, comment the line with
+% the testphase keys in the following \DocumentMetadata command.
+
+\DocumentMetadata
+ {
+ % comment the following line to compile an untagged documentation:
+ testphase=phase-II,testphase=toc-tagging,testphase=sec-tagging,
+ pdfversion=2.0,lang=en-UK,pdfstandard=a-2b
+ }
+
\makeatletter
-\def\UlrikeFischer at package@version{0.98a}
-\def\UlrikeFischer at package@date{2022-12-22}
+\def\UlrikeFischer at package@version{0.98b}
+\def\UlrikeFischer at package@date{2023-01-24}
\makeatother
\documentclass[DIV=12,parskip=half-,bibliography=totoc,a4paper]{article}
@@ -48,6 +59,10 @@
escapechar=*,
commentstyle=\color{green!50!black}\bfseries}
+% this allow to get real spaces in the code parts.
+% This should perhaps be combined in a new listings key
+\lstset{showspaces}
+\makeatletter \def\lst at visiblespace{\lst at ttfamily{\char32}{\char32}}\makeatother
\tagpdfsetup{
@@ -56,8 +71,7 @@
%show-spaces
}
-\usepackage[pdfdisplaydoctitle=true,%hyperfootnotes=false,
- ]{hyperref}
+\usepackage[pdfdisplaydoctitle=true]{hyperref}
\hypersetup{
pdftitle={The tagpdf package, v\csname UlrikeFischer at package@version\endcsname},
@@ -65,6 +79,8 @@
colorlinks}
\tcbuselibrary{documentation}
+%less space between docCommand
+\tcbset{nosep/.style={doc raster command={raster after skip=-10pt}}}
\definecolor{Definition}{rgb}{0,0.2,0.6}
\newcommand\PrintKeyName[1]{\textsf{#1}}
\newcommand\pkg[1]{\texttt{#1}}
@@ -433,8 +449,8 @@
\item a new option \texttt{paratag} allows to change the tag name used for the
automatically tagged paragraphs.
-\item the commands |\tag_start:|, |\tag_stop:n| and |\tag_start:n| allow
- to stop and start tagging for example in trial typesetting.
+\item the commands |\tag_start:|, |\tag_stop:|, |\tag_stop:n| and |\tag_start:n| allow
+ to stop and start tagging (for example in trial typesetting).
\item Small bug fixes.
\end{itemize}
@@ -461,7 +477,15 @@
\end{itemize}
+\subsection{Changes in version 0.98a}
+Small bug fixes in code and documentation.
+\subsection{Changes in version 0.98b}
+The main change is from now on every structure has an ID and an IDtree is
+added. The ID of a structure can be retrieved with |\tag_get:n|
+see~\ref{sec:retrieve}.
+
+
\subsection{Proof of concept: the tagging of the documentation itself}
Starting with version 0.6 the documentation itself has been tagged. The
@@ -975,7 +999,7 @@
place them. For strategies how to handle paragraphs that split over pages see
subsection~\ref{sec:splitpara}.
-\begin{docCommand}{tagmcbegin}{\marg{key-val-list}}\end{docCommand}
+\begin{docCommand}[nosep]{tagmcbegin}{\marg{key-val-list}}\end{docCommand}
\begin{docCommand}{tag_mc_begin:n}{\marg{key-val-list}}\end{docCommand}
@@ -1072,7 +1096,7 @@
\end{description}
-\begin{docCommand}{tagmcend}{}\end{docCommand}
+\begin{docCommand}[nosep]{tagmcend}{}\end{docCommand}
\begin{docCommand}{tag_mc:end}{}\end{docCommand}
These commands insert the end code of the marked content. They don't end a
@@ -1102,7 +1126,7 @@
%\end{tcolorbox}
-\begin{docCommand}{tagmcuse}{}\end{docCommand}
+\begin{docCommand}[nosep]{tagmcuse}{}\end{docCommand}
\begin{docCommand}{tag_mc_use:n}{}\end{docCommand}
@@ -1111,7 +1135,7 @@
once -- the command will warn you if you try to use it a second time.
-\begin{docCommand}{tag_mc_end_push:}{}\end{docCommand}
+\begin{docCommand}[nosep]{tag_mc_end_push:}{}\end{docCommand}
\begin{docCommand}{tag_mc_begin_pop:n}{\marg{key-val-list}}\end{docCommand}
If there is an open mc chunk,
@@ -1123,7 +1147,7 @@
-\begin{docCommand}{tagmcifinTF}{\marg{true code}\marg{false code}}\end{docCommand}
+\begin{docCommand}[nosep]{tagmcifinTF}{\marg{true code}\marg{false code}}\end{docCommand}
\begin{docCommand}{tag_mc_if_in:TF}{\marg{true code}\marg{false code}}\end{docCommand}
@@ -1133,10 +1157,14 @@
In \emph{lua mode} it tests if the mc-attribute is currently unset. You can't test the nesting level with it!
+\subsubsection{Retrieving data} \label{sec:retrieve}
+With more elaborate tagging the need arise to retrieve and store current data.
\begin{docCommand}{tag_get:n}{\marg{key word}}\end{docCommand}
-This command give back some variables. Currently the only working key words are \verb+mc_tag+, \verb+struct_tag+ and \verb+struct_num+. The last returns a number and works also if only \pkg{tagpdf-base} has been loaded, but then doesn't give the same output: if \pkg{tagpdf} is loaded and tagging is active, \verb+struct_num+ gives the number of currently
+This (expandable) command give back some variables. Currently the working key words are \verb+mc_tag+, \verb+struct_tag+,
+\verb+struct_id+ and \verb+struct_num+. The ID is a string and returned including parentheses.
+\verb+struct_num+ returns a number and works also if only \pkg{tagpdf-base} has been loaded, but then doesn't give the same output: if \pkg{tagpdf} is loaded and tagging is active, \verb+struct_num+ gives the number of currently
active structure, so it reverts to the parent number if a structure is closed. If only \pkg{tagpdf-base} is loaded
nesting of structure is not tracked and so the command gives back the number of the last structure that has been created.
@@ -1230,11 +1258,11 @@
\tagstructbegin{tag=Figure,alt={Illustration of link annotation structure},attribute=bbox}\tagmcbegin{tag=Figure}
\ExplSyntaxOn
-\tag_stop_group_begin:
+\tag_stop:
\ExplSyntaxOff
\input{link-figure-input}
\ExplSyntaxOn
-\tag_stop_group_end:
+\tag_start:
\ExplSyntaxOff
\tagmcend\tagstructend
@@ -1408,7 +1436,7 @@
\subsubsection{Automatic tagging of paragraphs}\label{sec:paratagging}
-\begin{docCommand}{tagpdfparaOn}{}\end{docCommand}
+\begin{docCommand}[nosep]{tagpdfparaOn}{}\end{docCommand}
\begin{docCommand}{tagpdfparaOff}{}\end{docCommand}
Another feature that emerged from the \LaTeX{} tagged PDF project are hooks at the begin and end of paragraphs.
@@ -1491,7 +1519,7 @@
The following commands can be used to define the tree structure:
-\begin{docCommand}{tagstructbegin}{\marg{key-val-list}}\end{docCommand}
+\begin{docCommand}[nosep]{tagstructbegin}{\marg{key-val-list}}\end{docCommand}
\begin{docCommand}{tag_struct_begin:n}{\marg{key-val-list}}\end{docCommand}
These commands start a new structure. They don't start a group. They set all their values globally.
@@ -1629,12 +1657,12 @@
This key sets the |/E| key, the expanded form of an abbreviation or an acronym (I couldn't think of a better name, so I sticked to E).
\end{description}
-\begin{docCommand}{tagstructend}{}\end{docCommand}
+\begin{docCommand}[nosep]{tagstructend}{}\end{docCommand}
\begin{docCommand}{tag_struct_end:}{}\end{docCommand}
These commands end a structure. They don't end a group and it doesn't matter if they are in another group as the starting commands.
-\begin{docCommand}{tagstructuse}{\marg{label}}\end{docCommand}
+\begin{docCommand}[nosep]{tagstructuse}{\marg{label}}\end{docCommand}
\begin{docCommand}{tag_struct_use:n}{\marg{label}}\end{docCommand}
@@ -1769,23 +1797,55 @@
\end{document}
\end{lstlisting}
+\subsection{Interrupting the tagging}
-\subsection{Lazy and automatic tagging}\label{sec:lazy}
+Experience showed that it must be possible to interrupt tagging in some places.
+For example various packages do trial typesetting to measure text and this shouldn't create
+structures. There are therefore a number of commands for various use cases\footnote{it is
+quite possible that some of the commands will disappear again if we realize that they are not fitting!}
-A number of features of \PDF{} readers need a fully tagged \PDF{}. As an example screen readers tend to ignore alternative text (see section~\ref{sec:alt}) if the \PDF{} is not fully tagged. Also reflowing a \PDF{} only works for me (even if real space chars are in the \PDF{}) if the \PDF{} is fully tagged.
+\begin{docCommand}[nosep]{tag_stop:}{}\end{docCommand}
+\begin{docCommand}[nosep]{tag_start:}{}\end{docCommand}
+\begin{docCommand}[nosep]{tag_stop_group_begin:}{}\end{docCommand}
+\begin{docCommand}{tag_start_group_end:}{}\end{docCommand}
-This means that even if you don't care about a proper structure you should try to add at least some minimal tagging. With pdflatex this is not easy due to the page break problem. But with lualatex you can use an \texttt{Document} structure and inside it rather large mc-chunks. This minimizes the needed work.
+This commands stop and start tagging in the current group
+by switching \emph{local} booleans.
+The grouping commands also open and close a group.
-One could ask if in lua mode the code couldn't try to mark up unmarked parts e.g. as P-type chunks, like it marks them up as artifacts currently. Sadly this is not so easy, as it is quite difficult to reliably identify the structure and the place in the kids array where such chunks belongs too. I also don't think that it is really needed. It is not so difficult to define user macros which e.g. opens a structure and start an mc-chunk or which close an open mc-chunk before issuing the next \verb+\tagmcbegin+.
+\begin{docCommand}[nosep]{tag_stop:n}{\marg{label}}\end{docCommand}
+\begin{docCommand}{tag_start:n}{\marg{label}}\end{docCommand}
+This commands stop and start tagging in the current group
+by switching \emph{local} booleans, but |\tag_start:n|
+only restarts if the corresponding |tag_stop:n| actually
+stopped something. This is meant for a situation like the following,
+where you don't want that the inner |\tag_start:n| restarts tagging.
+\begin{lstlisting}
+\tag_stop:n{outer}
+ ...
+ \tag_stop:n{inner}
+ ...
+ \tag_start:n{inner}
+ ...
+\tag_start:n{outer}
+\end{lstlisting}
+
+\subsection{Lazy and automatic tagging}\label{sec:lazy}
+
+A number of features of \PDF{} readers need a fully tagged \PDF{}. As an example screen readers tend to ignore alternative text (see section~\ref{sec:alt}) if the \PDF{} is not fully tagged. Also reflowing a \PDF{} only works for me (even if real space chars are in the \PDF{}) if the \PDF{} is fully tagged (recent versions of the adobe reader manage to
+reflow also not tagged \PDF{} but it is very slow).
+
+This means that even if you don't care about a proper structure you should try to add at least some minimal tagging. With the now available automatic tagging of paragraphs all that is needed, is to use |testphase=phase-II| in |\DocumentMetadata|. With lualatex this can work quite OK if you don't have unbalanced paragraphs in your document (pdflatex is more fragile).
+
+
\subsection{Adding tagging to commands}
-
As mentioned above the mc-markers should not be nested. Basically you write:
@@ -1796,11 +1856,9 @@
\end{lstlisting}
-This is quite workable as long as you mark everything manually. But how to write commands, e.g for a tabular or a graphic, that do tagging automatically without breaking the flow and the structure?
+This is quite workable as long as you mark everything manually. But when defining commands you have to ensure that they correctly push and pop the mc-chunks where needed.
-
-
\section{Alternative text, ActualText and text-to-speech software}\label{sec:alt}
@@ -2133,7 +2191,7 @@
-\printbibliography
+\printbibliography[heading=bibintoc]
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-backend.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2022-12-22} {0.98a}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-01-24} {0.98b}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -158,8 +158,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.98a", --TAGVERSION
- date = "2022-12-22", --TAGDATE
+ version = "0.98b", --TAGVERSION
+ date = "2023-01-24", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-checks.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -63,7 +63,7 @@
% This is a generic command to retrieve data for the current structure or
% mc-chunk. Currently
% the only sensible values for the argument \meta{keyword}
-% are |mc_tag| and |struct_tag| and |struct_num|.
+% are |mc_tag|, |struct_tag|, |struct_id| and |struct_num|.
% \end{function}
%
% \section{Description of log messages}
@@ -295,7 +295,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-checks-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-data.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% This files contains a various data files which are read in
@@ -60,7 +60,7 @@
% It lists the new tag, the rolemap and the namespace of the rolemap.
% \begin{macrocode}
%<*ns-latex>
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-01-24} {0.98b}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
@@ -86,7 +86,7 @@
% It is bound to change
% \begin{macrocode}
%<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-01-24} {0.98b}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
@@ -102,7 +102,7 @@
% It is bound to change a lot!
% \begin{macrocode}
%<*ns-latex-inline>
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-01-24} {0.98b}
%% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
chapter, Span, pdf2,
section, Span, pdf2,
@@ -116,7 +116,7 @@
% \section{The pdf namespace data}
% \begin{macrocode}
%<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-01-24} {0.98b}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
@@ -184,7 +184,7 @@
% \section{The pdf 2.0 namespace data}
% \begin{macrocode}
%<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-01-24} {0.98b}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
Document,Document,pdf2,D,
Part,Part,pdf2,G,
@@ -240,7 +240,7 @@
% \section{The mathml namespace data}
% \begin{macrocode}
%<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-01-24} {0.98b}
% {mathml}{http://www.w3.org/1998/Math/MathML}{}
abs,,,
and,,,
@@ -475,7 +475,7 @@
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-01-24} {0.98b}
,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC
Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅
@@ -530,7 +530,7 @@
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child-2>
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-01-24} {0.98b}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-generic.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-01-24} {0.98b}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-01-24} {0.98b}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-luacode.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{implementation}
% The code is splitted into three parts: code shared by all engines,
@@ -86,7 +86,7 @@
% \begin{macrocode}
%<@@=tag>
%<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-01-24} {0.98b}
{tagpdf - mc code only for the luamode }
%</luamode>
% \end{macrocode}
@@ -165,7 +165,7 @@
=
{\lua_now:e
{
- tex.print(tex.getattribute(luatexbase.attributes.g__tag_mc_type_attr))
+ tex.print(\int_use:N \c_document_cctab,tex.getattribute(luatexbase.attributes.g__tag_mc_type_attr))
}
}
{ \prg_return_false: }
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-mc-shared.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -174,7 +174,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-01-24} {0.98b}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-roles.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -90,7 +90,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-roles-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-space.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \begin{function}{interwordspace (setup-key)}
@@ -64,7 +64,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-space-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-struct.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -242,7 +242,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-struct-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -507,6 +507,24 @@
% \end{macrocode}
% \end{variable}
%
+% \subsection{Adding the /ID key}
+% Every structure gets automatically an ID which is currently
+% simply calculated from the structure number.
+% \begin{macro}{\@@_struct_get_id:n}
+% \begin{macrocode}
+\cs_new:Npn \@@_struct_get_id:n #1 %#1=struct num
+ {
+ (
+ ID.
+ \prg_replicate:nn
+ { \int_abs:n{\g_@@_tree_id_pad_int - \tl_count:e { \int_to_arabic:n { #1 } }} }
+ { 0 }
+ \int_to_arabic:n { #1 }
+ )
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Filling in the tag info}
% \begin{macro}{\@@_struct_set_tag_info:nnn }
@@ -808,7 +826,8 @@
{ @@/struct/#1 }
{dict}
{
- \l_@@_tmpa_tl
+ \l_@@_tmpa_tl\c_space_tl
+ /ID~\@@_struct_get_id:n{#1}
}
}
{
@@ -884,7 +903,7 @@
%
% \begin{macro}{\@@_get_data_struct_tag:}
% this command allows \cs{tag_get:n} to get the current
-% structure tag with the keyword |struct_tag|. We will need to handle nesting
+% structure tag with the keyword |struct_tag|.
% \begin{macrocode}
\cs_new:Npn \@@_get_data_struct_tag:
{
@@ -894,6 +913,17 @@
\prop_item:cn {g_@@_struct_\g_@@_struct_stack_current_tl _prop}{S}
}
}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_get_data_struct_id:}
+% this command allows \cs{tag_get:n} to get the current
+% structure id with the keyword |struct_id|.
+% \begin{macrocode}
+\cs_new:Npn \@@_get_data_struct_id:
+ {
+ \@@_struct_get_id:n {\g_@@_struct_stack_current_tl}
+ }
%</package>
% \end{macrocode}
% \end{macro}
@@ -1480,7 +1510,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-attr-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-tree.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-tree-code} {2023-01-24} {0.98b}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
@@ -119,6 +119,73 @@
}
% \end{macrocode}
%
+% \subsection{Writing the IDtree}
+%
+% The ID are currently quite simple: every structure has an ID build from
+% the prefix ID together with the structure number padded with enough zeros to
+% that we get directly an lexical order. We ship them out in bundles
+% At first a seq to hold the references for the kids
+% \begin{variable}{\g_@@_tree_id_pad_int}
+% \begin{macrocode}
+\int_new:N\g_@@_tree_id_pad_int
+% \end{macrocode}
+% \end{variable}
+% Now we get the needed padding
+% \begin{macrocode}
+\cs_generate_variant:Nn \tl_count:n {e}
+\hook_gput_code:nnn{begindocument}{tagpdf}
+ {
+ \int_gset:Nn\g_@@_tree_id_pad_int
+ {\tl_count:e { \@@_ref_value_lastpage:nn{tagstruct}{1000}}+1}
+ }
+
+% \end{macrocode}
+% This is the main code to write the tree it basically splits the
+% existing structure numbers in chunks of length 50
+% TODO consider is 50 is a good length.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_tree_write_idtree:
+ {
+ \tl_clear:N \l_@@_tmpa_tl
+ \tl_clear:N \l_@@_tmpb_tl
+ \int_zero:N \l_@@_tmpa_int
+ \int_step_inline:nn {\c at g_@@_struct_abs_int}
+ {
+ \int_incr:N\l_@@_tmpa_int
+ \tl_put_right:Nx \l_@@_tmpa_tl
+ {
+ \@@_struct_get_id:n{##1}~\pdf_object_ref:n{@@/struct/##1}~
+ }
+ \int_compare:nNnF {\l_@@_tmpa_int}<{50} %
+ {
+ \pdf_object_unnamed_write:nx {dict}
+ { /Limits~[\@@_struct_get_id:n{##1-\l_@@_tmpa_int+1}~\@@_struct_get_id:n{##1}]
+ /Names~[\l_@@_tmpa_tl]
+ }
+ \tl_put_right:Nx\l_@@_tmpb_tl {\pdf_object_ref_last:\c_space_tl}
+ \int_zero:N \l_@@_tmpa_int
+ \tl_clear:N \l_@@_tmpa_tl
+ }
+ }
+ \tl_if_empty:NF \l_@@_tmpa_tl
+ {
+ \pdf_object_unnamed_write:nx {dict}
+ {
+ /Limits~
+ [\@@_struct_get_id:n{\c at g_@@_struct_abs_int-\l_@@_tmpa_int+1}~
+ \@@_struct_get_id:n{\c at g_@@_struct_abs_int}]
+ /Names~[\l_@@_tmpa_tl]
+ }
+ \tl_put_right:Nx\l_@@_tmpb_tl {\pdf_object_ref_last:}
+ }
+ \pdf_object_unnamed_write:nx {dict}{/Kids~[\l_@@_tmpb_tl]}
+ \@@_prop_gput:cnx
+ { g_@@_struct_0_prop }
+ { IDTree }
+ { \pdf_object_ref_last: }
+ }
+% \end{macrocode}
+%
% \subsection{Writing structure elements}
% The following commands are needed to write out the structure.
% \begin{macro}{\@@_tree_write_structtreeroot:}
@@ -135,8 +202,15 @@
\@@_prop_gput:cnx
{ g_@@_struct_0_prop }
{ RoleMap }
- { \pdf_object_ref:n { @@/tree/rolemap } }
- \@@_struct_write_obj:n { 0 }
+ { \pdf_object_ref:n { @@/tree/rolemap } }
+ \@@_struct_fill_kid_key:n { 0 }
+ \@@_struct_get_dict_content:nN { 0 } \l_@@_tmpa_tl
+ \pdf_object_write:nnx
+ { @@/struct/0 }
+ {dict}
+ {
+ \l_@@_tmpa_tl
+ }
}
}
% \end{macrocode}
@@ -149,7 +223,14 @@
{ g_@@_struct_0_prop }
{ ParentTree }
{ \pdf_object_ref:n { @@/tree/parenttree } }
- \@@_struct_write_obj:n { 0 }
+ \@@_struct_fill_kid_key:n { 0 }
+ \@@_struct_get_dict_content:nN { 0 } \l_@@_tmpa_tl
+ \pdf_object_write:nnx
+ { @@/struct/0 }
+ {dict}
+ {
+ \l_@@_tmpa_tl
+ }
}
}
% \end{macrocode}
@@ -459,6 +540,7 @@
\hook_use:n {tagpdf/finish/before}
\@@_tree_final_checks:
\@@_tree_write_parenttree:
+ \@@_tree_write_idtree:
\@@_tree_write_rolemap:
\@@_tree_write_classmap:
\@@_tree_write_namespaces:
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf-user.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98a, released 2022-12-22}
+% \date{Version 0.98b, released 2023-01-24}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -246,7 +246,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-user} {2023-01-24} {0.98b}
{tagpdf - user commands}
%</header>
% \end{macrocode}
@@ -639,6 +639,7 @@
% \begin{macrocode}
\AddToHook{begindocument/before}
{
+ \@ifundefined{@mult at ptagging@hook}{\RequirePackage{output-patches-tmp-ltx}}{} %
\bool_if:NF \g_@@_mode_lua_bool
{
\cs_if_exist:NT \@kernel at before@footins
Modified: trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/source/latex/tagpdf/tagpdf.dtx 2023-01-25 20:45:01 UTC (rev 65629)
@@ -34,7 +34,7 @@
% \end{function}
%
% \begin{function}{ \tag_stop_group_begin:, \tag_stop_group_end:,
-% \tag_stop:, \tag_start:, \tag_stop:n, \tag_start:n }
+% \tag_stop:, \tag_start: }
% We need commands to stop tagging in some places.
% There simply switches the two local booleans. The grouping commands
% can be used to group the effect.
@@ -92,7 +92,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf} {2023-01-24} {0.98b}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -118,7 +118,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-debug} {2023-01-24} {0.98b}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -159,7 +159,7 @@
% \end{macrocode}
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-base} {2023-01-24} {0.98b}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
@@ -197,6 +197,7 @@
{
{abspage} { \int_use:N \g_shipout_readonly_int}
{tagmcabs}{ \int_use:N \c at g_@@_MCID_abs_int }
+ {tagstruct}{\int_use:N \c at g_@@_struct_abs_int }
}
}
}
@@ -518,8 +519,8 @@
%<*base>
\cs_new_protected:Npn \tag_stop:{}
\cs_new_protected:Npn \tag_start:{}
-\cs_new_protected:Npn \tag_stop:n{}
-\cs_new_protected:Npn \tag_start:n{}
+\cs_new_protected:Npn \tag_stop:n #1 {}
+\cs_new_protected:Npn \tag_start:n #1 {}
%</base>
% \end{macrocode}
% \end{macro}
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-base.sty 2023-01-25 20:45:01 UTC (rev 65629)
@@ -24,7 +24,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-base} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-base} {2023-01-24} {0.98b}
{part of tagpdf - provide base, no-op versions of the user commands }
\AddToHook{begindocument}
{
@@ -40,8 +40,8 @@
\cs_new_protected:Npn \tag_stop:{}
\cs_new_protected:Npn \tag_start:{}
-\cs_new_protected:Npn \tag_stop:n{}
-\cs_new_protected:Npn \tag_start:n{}
+\cs_new_protected:Npn \tag_stop:n #1 {}
+\cs_new_protected:Npn \tag_start:n #1 {}
%% File: tagpdf-mc-generic.dtx
\cs_new_protected:Npn \tag_mc_begin:n #1 { \__tag_whatsits: }
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug-generic.sty 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-debug-generic} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-01-24} {0.98b}
{part of tagpdf - debugging code related to marking chunks - generic mode}
\cs_set_protected:Npn \tag_mc_begin:n #1 %#1 keyval
{
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-debug.sty 2023-01-25 20:45:01 UTC (rev 65629)
@@ -26,7 +26,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf-debug} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-debug} {2023-01-24} {0.98b}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
\prop_gput:Nnn \g_msg_module_type_prop { tag / debug} {}
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-backend.dtx
-\ProvidesExplFile {tagpdf-luatex.def} {2022-12-22} {0.98a}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-01-24} {0.98b}
{tagpdf~driver~for~luatex}
{
\fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-generic.sty 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-generic.dtx
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-01-24} {0.98b}
{part of tagpdf - code related to marking chunks - generic mode}
\__tag_prop_new:N \g__tag_MCID_byabspage_prop
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-lua.sty 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-luacode.dtx
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-01-24} {0.98b}
{tagpdf - mc code only for the luamode }
\hook_gput_code:nnn{begindocument}{tagpdf/mc}
{
@@ -80,7 +80,7 @@
=
{\lua_now:e
{
- tex.print(tex.getattribute(luatexbase.attributes.g__tag_mc_type_attr))
+ tex.print(\int_use:N \c_document_cctab,tex.getattribute(luatexbase.attributes.g__tag_mc_type_attr))
}
}
{ \prg_return_false: }
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-book.def 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-01-24} {0.98b}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex-inline.def 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-01-24} {0.98b}
%% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
chapter, Span, pdf2,
section, Span, pdf2,
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-latex.def 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-01-24} {0.98b}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-mathml.def 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-01-24} {0.98b}
abs,,,
and,,,
annotation,,,
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf.def 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-01-24} {0.98b}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-ns-pdf2.def 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-01-24} {0.98b}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
Document,Document,pdf2,D,
Part,Part,pdf2,G,
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child-2.csv 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-01-24} {0.98b}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf-parent-child.csv 2023-01-25 20:45:01 UTC (rev 65629)
@@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2022-12-22} {0.98a}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-01-24} {0.98b}
,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC
Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.lua 2023-01-25 20:45:01 UTC (rev 65629)
@@ -24,8 +24,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.98a", --TAGVERSION
- date = "2022-12-22", --TAGDATE
+ version = "0.98b", --TAGVERSION
+ date = "2023-01-24", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdf.sty 2023-01-25 20:45:01 UTC (rev 65629)
@@ -28,7 +28,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
-\ProvidesExplPackage {tagpdf} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdf} {2023-01-24} {0.98b}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -70,6 +70,7 @@
{
{abspage} { \int_use:N \g_shipout_readonly_int}
{tagmcabs}{ \int_use:N \c at g__tag_MCID_abs_int }
+ {tagstruct}{\int_use:N \c at g__tag_struct_abs_int }
}
}
}
@@ -744,6 +745,54 @@
{ \pdf_object_ref:n { __tag/struct/0 } }
}
}
+\int_new:N\g__tag_tree_id_pad_int
+\cs_generate_variant:Nn \tl_count:n {e}
+\hook_gput_code:nnn{begindocument}{tagpdf}
+ {
+ \int_gset:Nn\g__tag_tree_id_pad_int
+ {\tl_count:e { \__tag_ref_value_lastpage:nn{tagstruct}{1000}}+1}
+ }
+
+\cs_new_protected:Npn \__tag_tree_write_idtree:
+ {
+ \tl_clear:N \l__tag_tmpa_tl
+ \tl_clear:N \l__tag_tmpb_tl
+ \int_zero:N \l__tag_tmpa_int
+ \int_step_inline:nn {\c at g__tag_struct_abs_int}
+ {
+ \int_incr:N\l__tag_tmpa_int
+ \tl_put_right:Nx \l__tag_tmpa_tl
+ {
+ \__tag_struct_get_id:n{##1}~\pdf_object_ref:n{__tag/struct/##1}~
+ }
+ \int_compare:nNnF {\l__tag_tmpa_int}<{50} %
+ {
+ \pdf_object_unnamed_write:nx {dict}
+ { /Limits~[\__tag_struct_get_id:n{##1-\l__tag_tmpa_int+1}~\__tag_struct_get_id:n{##1}]
+ /Names~[\l__tag_tmpa_tl]
+ }
+ \tl_put_right:Nx\l__tag_tmpb_tl {\pdf_object_ref_last:\c_space_tl}
+ \int_zero:N \l__tag_tmpa_int
+ \tl_clear:N \l__tag_tmpa_tl
+ }
+ }
+ \tl_if_empty:NF \l__tag_tmpa_tl
+ {
+ \pdf_object_unnamed_write:nx {dict}
+ {
+ /Limits~
+ [\__tag_struct_get_id:n{\c at g__tag_struct_abs_int-\l__tag_tmpa_int+1}~
+ \__tag_struct_get_id:n{\c at g__tag_struct_abs_int}]
+ /Names~[\l__tag_tmpa_tl]
+ }
+ \tl_put_right:Nx\l__tag_tmpb_tl {\pdf_object_ref_last:}
+ }
+ \pdf_object_unnamed_write:nx {dict}{/Kids~[\l__tag_tmpb_tl]}
+ \__tag_prop_gput:cnx
+ { g__tag_struct_0_prop }
+ { IDTree }
+ { \pdf_object_ref_last: }
+ }
\pdf_version_compare:NnTF < {2.0}
{
\cs_new_protected:Npn \__tag_tree_write_structtreeroot:
@@ -756,7 +805,14 @@
{ g__tag_struct_0_prop }
{ RoleMap }
{ \pdf_object_ref:n { __tag/tree/rolemap } }
- \__tag_struct_write_obj:n { 0 }
+ \__tag_struct_fill_kid_key:n { 0 }
+ \__tag_struct_get_dict_content:nN { 0 } \l__tag_tmpa_tl
+ \pdf_object_write:nnx
+ { __tag/struct/0 }
+ {dict}
+ {
+ \l__tag_tmpa_tl
+ }
}
}
{
@@ -766,7 +822,14 @@
{ g__tag_struct_0_prop }
{ ParentTree }
{ \pdf_object_ref:n { __tag/tree/parenttree } }
- \__tag_struct_write_obj:n { 0 }
+ \__tag_struct_fill_kid_key:n { 0 }
+ \__tag_struct_get_dict_content:nN { 0 } \l__tag_tmpa_tl
+ \pdf_object_write:nnx
+ { __tag/struct/0 }
+ {dict}
+ {
+ \l__tag_tmpa_tl
+ }
}
}
\cs_new_protected:Npn \__tag_tree_write_structelements:
@@ -966,6 +1029,7 @@
\hook_use:n {tagpdf/finish/before}
\__tag_tree_final_checks:
\__tag_tree_write_parenttree:
+ \__tag_tree_write_idtree:
\__tag_tree_write_rolemap:
\__tag_tree_write_classmap:
\__tag_tree_write_namespaces:
@@ -1832,6 +1896,16 @@
{ g__tag_struct_0_prop }
{ Namespaces }
{ \pdf_object_ref:n { __tag/tree/namespaces } }
+\cs_new:Npn \__tag_struct_get_id:n #1 %#1=struct num
+ {
+ (
+ ID.
+ \prg_replicate:nn
+ { \int_abs:n{\g__tag_tree_id_pad_int - \tl_count:e { \int_to_arabic:n { #1 } }} }
+ { 0 }
+ \int_to_arabic:n { #1 }
+ )
+ }
\pdf_version_compare:NnTF < {2.0}
{
@@ -2042,7 +2116,8 @@
{ __tag/struct/#1 }
{dict}
{
- \l__tag_tmpa_tl
+ \l__tag_tmpa_tl\c_space_tl
+ /ID~\__tag_struct_get_id:n{#1}
}
}
{
@@ -2095,6 +2170,10 @@
\prop_item:cn {g__tag_struct_\g__tag_struct_stack_current_tl _prop}{S}
}
}
+\cs_new:Npn \__tag_get_data_struct_id:
+ {
+ \__tag_struct_get_id:n {\g__tag_struct_stack_current_tl}
+ }
\keys_define:nn { __tag / struct }
{
label .tl_set:N = \l__tag_struct_key_label_tl,
@@ -2927,6 +3006,7 @@
}
\AddToHook{begindocument/before}
{
+ \@ifundefined{@mult at ptagging@hook}{\RequirePackage{output-patches-tmp-ltx}}{} %
\bool_if:NF \g__tag_mode_lua_bool
{
\cs_if_exist:NT \@kernel at before@footins
Modified: trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty 2023-01-25 20:44:19 UTC (rev 65628)
+++ trunk/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty 2023-01-25 20:45:01 UTC (rev 65629)
@@ -1,24 +1,28 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2022-12-22} {0.98a}
+\ProvidesExplPackage {tagpdfdocu-patches} {2023-01-24} {0.98b}
{patches/commands for the tagpdf documentation}
\RequirePackage{etoolbox,xpatch}
+% latex-lab experiments
+\providecommand\tagtool[1]{}
%vLogos
\ExplSyntaxOn
\DeclareRobustCommand\TeX{
+ \leavevmode
\tag_mc_end_push:
\tag_struct_begin:n{tag=Span,alt=TeX,actualtext=TeX}
\tagmcbegin{}
- T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@
+ T\kern-.1667em\lower.5ex\hbox{E}\kern-.05emX\@ %changed from -.125em
\tagmcend
\tag_struct_end:
\tag_mc_begin_pop:n{}}
-\DeclareRobustCommand{\LaTeX}{L\kern-.36em%
- {
+\DeclareRobustCommand{\LaTeX}{
+ \leavevmode
\tag_mc_end_push:
\tag_struct_begin:n{tag=Span,alt=LaTeX,actualtext=LaTeX}
\tagmcbegin{}
+ L\kern-.25em % %changed from -0.36em
\sbox\z@ T%
\vbox to\ht\z@{\hbox{\check at mathfonts
\fontsize\sf at size\z@
@@ -25,9 +29,8 @@
\math at fontsfalse\selectfont
A}%
\vss}%
- }%
- \kern-.15em%
- T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@
+ \kern-.1em % %changed from 0.15em
+ T\kern-.1667em\lower.5ex\hbox{E}\kern-.05emX\@ %changed from -0.125
\tagmcend
\tag_struct_end:
\tag_mc_begin_pop:n{}
@@ -39,6 +42,13 @@
\AddToHook{cmd/textbf/after}
{\tag_mc_end:\tag_struct_end:\tag_mc_begin_pop:n{}}
+
+% emph
+\AddToHook{cmd/emph/before}
+ {\leavevmode\tag_mc_end_push:\tag_struct_begin:n{tag=Em}\tagmcbegin{}}
+
+\AddToHook{cmd/emph/after}
+ {\tag_mc_end:\tag_struct_end:\tag_mc_begin_pop:n{}}
\newcommand\minisec[1]{%
More information about the tex-live-commits
mailing list.