Skip to content

Commit

Permalink
update tagpdf to 99c (#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer authored Jul 28, 2024
1 parent 22375e7 commit d9e7ebd
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 52 deletions.
9 changes: 5 additions & 4 deletions texmf/tex/latex/tagpdf/tagpdf-base.sty
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
\ProvidesExplPackage {tagpdf-base} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdf-base} {2024-06-20} {0.99c}
{part of tagpdf - provide base, no-op versions of the user commands }
\cs_new_protected:Npn \__tag_whatsits: {}
\AddToHook{begindocument}
{
\str_case:VnF \c_sys_backend_str
{
{ luatex } { \cs_new_protected:Npn \__tag_whatsits: {} }
{ dvisvgm } { \cs_new_protected:Npn \__tag_whatsits: {} }
{ luatex } { \cs_set_protected:Npn \__tag_whatsits: {} }
{ dvisvgm } { \cs_set_protected:Npn \__tag_whatsits: {} }
}
{
\cs_new_protected:Npn \__tag_whatsits: {\tex_special:D {} }
\cs_set_protected:Npn \__tag_whatsits: {\tex_special:D {} }
}
}
\cs_if_free:NT \pdf_object_new_indexed:nn
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-debug-generic.sty
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-generic.dtx
\ProvidesExplPackage {tagpdf-debug-generic} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdf-debug-generic} {2024-06-20} {0.99c}
{part of tagpdf - debugging code related to marking chunks - generic mode}
\cs_set_protected:Npn \tag_mc_begin:n #1 %#1 keyval
{
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-debug-lua.sty
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-luacode.dtx
\ProvidesExplPackage {tagpdf-debug-lua} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdf-debug-lua} {2024-06-20} {0.99c}
{part of tagpdf - debugging code related to marking chunks - lua mode}
\cs_set_protected:Npn \__tag_mc_handle_stash:n #1 %1 mcidnum
{
Expand Down
5 changes: 3 additions & 2 deletions texmf/tex/latex/tagpdf/tagpdf-debug.sty
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
\ProvidesExplPackage {tagpdf-debug} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdf-debug} {2024-06-20} {0.99c}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
\prop_gput:Nnn \g_msg_module_type_prop { tag / debug} {}
Expand Down Expand Up @@ -279,7 +279,7 @@
{ g__tag_struct_#1_prop }{#2}{#3}
\prop_gput:cnn { g__tag_struct_debug_#1_prop } {#2} {#3}
}
\cs_generate_variant:Nn \__tag_struct_prop_gput:nnn {nne,nee,nno}
\cs_generate_variant:Nn \__tag_struct_prop_gput:nnn {onn,nne,nee,nno}

\prop_new:c { g__tag_struct_debug_1_prop }
\seq_new:c { g__tag_struct_debug_kids_1_seq }
Expand Down Expand Up @@ -450,6 +450,7 @@
{ g__tag_struct_ \l__tag_struct_stack_parent_tmpa_tl _prop}
{S}
\l__tag_tmpa_tl
\quark_if_no_value:NT\l__tag_tmpa_tl{\tl_set:Nn \l__tag_tmpa_tl{UNKNOWN}}
\msg_warning:nneee
{ tag }
{role-parent-child}
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-luatex.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-backend.dtx
\ProvidesExplFile {tagpdf-luatex.def} {2024-04-12} {0.99b}
\ProvidesExplFile {tagpdf-luatex.def} {2024-06-20} {0.99c}
{tagpdf~driver~for~luatex}
{
\fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-mc-code-generic.sty
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-generic.dtx
\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdf-mc-code-generic} {2024-06-20} {0.99c}
{part of tagpdf - code related to marking chunks - generic mode}
\tl_new:N \l__tag_mc_ref_abspage_tl

Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-mc-code-lua.sty
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-mc-luacode.dtx
\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdf-mc-code-lua} {2024-06-20} {0.99c}
{tagpdf - mc code only for the luamode }
\hook_gput_code:nnn{begindocument}{tagpdf/mc}
{
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-ns-latex-book.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-04-12} {0.99b}
%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2024-06-20} {0.99c}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-ns-latex.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-04-12} {0.99b}
%% \ProvidesExplFile {tagpdf-ns-latex.def} {2024-06-20} {0.99c}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-ns-mathml.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-04-12} {0.99b}
%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2024-06-20} {0.99c}
abs,abs,mathml,
and,and,mathml,
annotation,annotation,mathml,
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-ns-pdf.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-04-12} {0.99b}
%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2024-06-20} {0.99c}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-ns-pdf2.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-04-12} {0.99b}
%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2024-06-20} {0.99c}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
StructTreeRoot,StructTreeRoot,pdf2,D,
Document,Document,pdf2,D,
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-parent-child-2.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-04-12} {0.99b}
%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2024-06-20} {0.99c}
,,,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,∅
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/tagpdf/tagpdf-parent-child.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf-data.dtx
%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-04-12} {0.99b}
%% \ProvidesExplFile {tagpdf-parent-child.csv} {2024-06-20} {0.99c}
,,,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,∅,∅
Expand Down
10 changes: 5 additions & 5 deletions texmf/tex/latex/tagpdf/tagpdf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

local ProvidesLuaModule = {
name = "tagpdf",
version = "0.99b", --TAGVERSION
date = "2024-04-12", --TAGDATE
version = "0.99c", --TAGVERSION
date = "2024-06-20", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
Expand Down Expand Up @@ -53,8 +53,8 @@ ltx.__tag.page will contain page data
ltx.__tag.tables contains also data from mc and struct (from older code). This needs cleaning up.
There are certainly dublettes, but I don't dare yet ...
ltx.__tag.func will contain (public) functions.
ltx.__tag.trace will contain tracing/loging functions.
local funktions starts with __
ltx.__tag.trace will contain tracing/logging functions.
local functions starts with __
functions meant for users will be in ltx.tag
functions
Expand All @@ -67,7 +67,7 @@ functions
ltx.__tag.func.store_mc_kid (mcnum,kid,page): stores the mc-kids of mcnum on page page
ltx.__tag.func.store_mc_in_page(mcnum,mcpagecnt,page): stores in the page table the number of mcnum on this page
ltx.__tag.func.store_struct_mcabs (structnum,mcnum): stores relations structnum<->mcnum (abs)
ltx.__tag.func.mc_insert_kids (mcnum): inserts the /K entries for mcnum by wandering throught the [kids] table
ltx.__tag.func.mc_insert_kids (mcnum): inserts the /K entries for mcnum by wandering through the [kids] table
ltx.__tag.func.mark_page_elements(box,mcpagecnt,mccntprev,mcopen,name,mctypeprev) : the main function
ltx.__tag.func.mark_shipout (): a wrapper around the core function which inserts the last EMC
ltx.__tag.func.fill_parent_tree_line (page): outputs the entries of the parenttree for this page
Expand Down
38 changes: 26 additions & 12 deletions texmf/tex/latex/tagpdf/tagpdf.sty
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: tagpdf.dtx
\ProvidesExplPackage {tagpdf} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdf} {2024-06-20} {0.99c}
{ A package to experiment with pdf tagging }

\bool_if:nF
Expand Down Expand Up @@ -925,6 +925,7 @@
{
\l__tag_tmpa_tl
}
\prop_gput:cnn { g__tag_struct_1_prop } {S}{ /StructTreeRoot }
}
\cs_new_protected:Npn \__tag_tree_write_structelements:
{
Expand Down Expand Up @@ -1547,19 +1548,31 @@
{
\hook_gput_code:nnn {begindocument}{tagpdf}
{
\cs_if_exist:NT \chapter
{
\prop_map_inline:cn{g__tag_role_NS_latex-book_prop}
{
\__tag_role_add_tag:ne {#1}{\use_i:nn #2\c_empty_tl\c_empty_tl}
}
}
\bool_lazy_and:nnT
{
\cs_if_exist_p:N \chapter
}
{
\cs_if_exist_p:N \c@chapter
}
{
\prop_map_inline:cn{g__tag_role_NS_latex-book_prop}
{
\__tag_role_add_tag:ne {#1}{\use_i:nn #2\c_empty_tl\c_empty_tl}
}
}
}
}
{
\hook_gput_code:nnn {begindocument}{tagpdf}
{
\cs_if_exist:NT \chapter
\bool_lazy_and:nnT
{
\cs_if_exist_p:N \chapter
}
{
\cs_if_exist_p:N \c@chapter
}
{
\prop_map_inline:cn{g__tag_role_NS_latex-book_prop}
{
Expand Down Expand Up @@ -1972,7 +1985,7 @@
T, %title, value in () or <>
Lang, %language
Alt, % value in () or <>
E, % abreviation
E, % abbreviation
ActualText,
AF, %pdf 2.0, array of dict, associated files
NS, %pdf 2.0, dict, namespace
Expand Down Expand Up @@ -2008,7 +2021,7 @@
\__tag_prop_gput:cnn
{ g__tag_struct_#1_prop }{#2}{#3}
}
\cs_generate_variant:Nn \__tag_struct_prop_gput:nnn {nne,nee,nno}
\cs_generate_variant:Nn \__tag_struct_prop_gput:nnn {onn,nne,nee,nno}

\tl_gset:Nn \g__tag_struct_stack_current_tl {1}
\cs_new:Npn \__tag_pdf_name_e:n #1{\pdf_name_from_unicode_e:n{#1}}
Expand Down Expand Up @@ -2239,7 +2252,7 @@
}
}

\cs_new_protected:Npn \__tag_struct_get_dict_content:nN #1 #2 %#1: stucture num
\cs_new_protected:Npn \__tag_struct_get_dict_content:nN #1 #2 %#1: structure num
{
\tl_clear:N #2
\prop_map_inline:cn { g__tag_struct_#1_prop }
Expand Down Expand Up @@ -2717,6 +2730,7 @@
{ g__tag_struct_ \l__tag_struct_stack_parent_tmpa_tl _prop}
{S}
\l__tag_tmpa_tl
\quark_if_no_value:NT\l__tag_tmpa_tl{\tl_set:Nn \l__tag_tmpa_tl{UNKNOWN}}
\msg_warning:nneee
{ tag }
{role-parent-child}
Expand Down
20 changes: 3 additions & 17 deletions texmf/tex/latex/tagpdf/tagpdfdocu-patches.sty
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
\ProvidesExplPackage {tagpdfdocu-patches} {2024-04-12} {0.99b}
\ProvidesExplPackage {tagpdfdocu-patches} {2024-06-20} {0.99c}
{patches/commands for the tagpdf documentation}
\RequirePackage{etoolbox,xpatch}

Expand Down Expand Up @@ -33,7 +33,7 @@
\else
\addpenalty\@secpenalty\addvspace{1.5ex}%
\fi
{\tagpdfsetup{paratag=H10}\parindent \z@
{\tagpdfsetup{para/maintag=P,para/tag=Strong}\parindent \z@
\setlength{\parfillskip}{\z@ plus 1fil}%
\raggedright\normalfont\bfseries\nobreak
\nobreak\interlinepenalty \@M #1\par\nobreak%
Expand Down Expand Up @@ -92,7 +92,7 @@
% the before upper setting is dangerous as it can be overwritten by
% users. So a more stable hook is needed.
% we force also a \par and add a div structure, to avoid clashes with the block
% tagging code. This needs revisting!
% tagging code. This needs revisiting!

\AddToHook{env/tcolorbox/before}{\par\tagstructbegin{tag=Div}}
\AddToHook{env/tcolorbox/begin}{\tagpdfparaOff \tcbset{before upper=\tagpdfparaOn}}
Expand Down Expand Up @@ -177,20 +177,6 @@
{bbox}{/O /Layout /BBox [0 0 100 100]}
}

% ======= maketitle

\renewcommand\maketitle{%
\tagstructbegin{tag=Title}
\begin{center}%
\let\thanks\footnote
\makeatletter
\huge \@title \par
\vskip .5em
\@author \par
\vskip 1em%
\@date \par
\end{center}%
\tagstructend}


\endinput

0 comments on commit d9e7ebd

Please sign in to comment.