diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty | 195 |
1 files changed, 114 insertions, 81 deletions
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty index d810bef9f1b..2032895ec2a 100644 --- a/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty +++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdfdocu-patches.sty @@ -1,7 +1,7 @@ \RequirePackage{expl3}[2018/06/14] %\RequirePackage[enable-debug]{expl3}[2018/06/14] \RequirePackage{xpatch} -\ProvidesExplPackage {tagpdfdocu-patches} {2019/07/02} {0.61} +\ProvidesExplPackage {tagpdfdocu-patches} {2019/10/15} {0.70} {patches/commands for the tagpdf documentation} % to do : marginnote, perhaps the description macros ... @@ -30,20 +30,20 @@ \NewDocumentCommand\TagP{t{^}} { - \uftag_mc_if_in:T { \uftag_mc_end: } + \tag_mc_if_in:T { \tag_mc_end: } \IfBooleanF{#1} { - \uftag_struct_end: + \tag_struct_end: } - \uftag_struct_begin:n{tag=P} - \uftag_mc_begin:n{tag=P} + \tag_struct_begin:n{tag=P} + \tag_mc_begin:n{tag=P} } % close a mc and one structure \NewDocumentCommand\TagPend{} { - \uftag_mc_if_in:T { \uftag_mc_end: } - \uftag_struct_end: + \tag_mc_if_in:T { \tag_mc_end: } + \tag_struct_end: } @@ -58,15 +58,15 @@ %Marking the toc entries %around the whole entry so only structure: -\newcommand\tagscrtocentry[1]{\uftag_struct_begin:n{tag=TOCI}#1\uftag_struct_end:} +\newcommand\tagscrtocentry[1]{\tag_struct_begin:n{tag=TOCI}#1\tag_struct_end:} %leaf so structure and mc: \newcommand\tagscrtocpagenumber[1]{% - \uftag_struct_begin:n{tag=Reference}% - \uftag_mc_begin:n{tag=Reference}% + \tag_struct_begin:n{tag=Reference}% + \tag_mc_begin:n{tag=Reference}% #1% - \uftag_mc_end: - \uftag_struct_end:} + \tag_mc_end: + \tag_struct_end:} \DeclareTOCStyleEntry[ @@ -85,9 +85,9 @@ \renewcommand{\addtocentrydefault}[3]{% - \ifstr{#3}{}{} + \Ifstr{#3}{}{} {%\ - \ifstr{#2}{} + \Ifstr{#2}{} {% \addcontentsline{toc}{#1} {% @@ -118,7 +118,7 @@ \renewcommand*{\TOCLineLeaderFill}[1][.]{ \leaders\hbox{$\m@th - \mkern \@dotsep mu\hbox{\uftag_mc_begin:n{artifact}#1\uftag_mc_end:}\mkern \@dotsep + \mkern \@dotsep mu\hbox{\tag_mc_begin:n{artifact}#1\tag_mc_end:}\mkern \@dotsep mu$}\hfill } @@ -142,34 +142,34 @@ \tagstructbegin{tag=\prop_item:Nn\g_tag_section_level_prop{#1}} \tl_if_empty:nF{#3} { - \uftag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} + \tag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} #3 - \uftag_mc_end: + \tag_mc_end: } } - {\uftag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} + {\tag_mc_begin:n {tag=\prop_item:Nn\g_tag_section_level_prop{#1}} #4 - \uftag_mc_end:\tagstructend}% + \tag_mc_end:\tagstructend}% } %minisec is simply P, H6 doesn't work .... -\cs_new:Nn \__uftag_docu_tag_minisec:n +\cs_new:Nn \__tag_docu_tag_minisec:n { - \uftag_struct_begin:n {tag=P} - \uftag_mc_begin:n{tag=P} + \tag_struct_begin:n {tag=P} + \tag_mc_begin:n{tag=P} #1 - \uftag_mc_end: - \uftag_struct_end: + \tag_mc_end: + \tag_struct_end: } -\addtokomafont{minisec}{\__uftag_docu_tag_minisec:n} +\addtokomafont{minisec}{\__tag_docu_tag_minisec:n} -\AfterTOCHead{\uftag_struct_begin:n{tag=TOC}} -\AfterStartingTOC{\uftag_struct_end:} %end TOC +\AfterTOCHead{\tag_struct_begin:n{tag=TOC}} +\AfterStartingTOC{\tag_struct_end:} %end TOC %% list -\newcommand\uftag@enit@format@preset[1]{% +\newcommand\tag@enit@format@preset[1]{% \tagstructbegin{tag=LI}% \tagstructbegin{tag=Lbl}% \tagmcbegin{tag=Lbl}% @@ -190,7 +190,7 @@ } \ExplSyntaxOff -\xpatchcmd\enit@preset{\@firstofone}{\uftag@enit@format@preset}{}{\fail} +\xpatchcmd\enit@preset{\@firstofone}{\tag@enit@format@preset}{}{\fail} \ExplSyntaxOn \setlist{ before*=\tagstructbegin{tag=L}, @@ -209,62 +209,95 @@ %%% attention, to get the order right, it is necessary currently to start a new %%% mc after a link! I'm not sure if this can/group be included in the hooks %%% grouping is a bit tricky ... -\cs_if_exist:NT\hook_put_left:nnn -{ - \hook_put_left:nnn - { pdf } - { link_begin_url } - { - \uftag_struct_begin:n{tag=Link} - \uftag_mc_begin:n{tag=Link} - } -\hook_put:nnnn - { pdf } - { link_begin_url_attr } - { /StructParent } - { \int_use:N\c@g__uftag_parenttree_obj_int } - -\hook_put_right:nnn - { pdf } - { link_end_url } - { - \__uftag_struct_finish_link: - \uftag_mc_end: - \uftag_struct_end: - } +%\cs_if_exist:NT\hook_put_left:nnn +%{ +% \hook_put_left:nnn +% { pdf } +% { annot/Link/URI_begin } +% { +% \tag_struct_begin:n{tag=Link} +% \tag_mc_begin:n{tag=Link} +% } + +\cs_generate_variant:Nn \pdfannot_dict_put:nnn {nnx} +\hook_gput_code:nnn + {pdfannot/link/URI/before} + {tagpdf} + { + \tag_struct_begin:n{tag=Link} + \tag_mc_begin:n{tag=Link} + \pdfannot_dict_put:nnx + {link/URI} + { StructParent } + { \int_use:N\c@g__tag_parenttree_obj_int } + } + +%\hook_put_right:nnn +% { pdf } +% { annot/Link/URI_end } +% { +% \__tag_struct_finish_link: +% \tag_mc_end: +% \tag_struct_end: +% } +\hook_gput_code:nnn + {pdfannot/link/URI/after} + {tagpdf} + { + \__tag_struct_finish_link: + \tag_mc_end: + \tag_struct_end: + } + +%\hook_put_left:nnn +% { pdf } +% { annot/Link/GoTo_begin } +% { +% \tag_struct_begin:n{tag=Link} +% \tag_mc_begin:n{tag=Link} +% } + +\hook_gput_code:nnn + {pdfannot/link/GoTo/before} + {tagpdf} + { + \tag_struct_begin:n{tag=Link} + \tag_mc_begin:n{tag=Link} + \pdfannot_dict_put:nnx + {link/GoTo} + { StructParent } + { \int_use:N\c@g__tag_parenttree_obj_int } + } + -\hook_put_left:nnn - { pdf } - { link_begin_link } - { - \uftag_struct_begin:n{tag=Link} - \uftag_mc_begin:n{tag=Link} - } -\hook_put:nnnn - { pdf } - { link_begin_link_attr } - { /StructParent } - { \int_use:N\c@g__uftag_parenttree_obj_int } -\hook_put_right:nnn - { pdf } - { link_end_link } - { - \__uftag_struct_finish_link: - \uftag_mc_end: - \uftag_struct_end: - } + +%\hook_put_right:nnn +% { pdf } +% { annot/link/GoTo_end } +% { +% \__tag_struct_finish_link: +% \tag_mc_end: +% \tag_struct_end: +% } + +\hook_gput_code:nnn + {pdfannot/link/GoTo/after} + {tagpdf} + { + \__tag_struct_finish_link: + \tag_mc_end: + \tag_struct_end: + } % "alternative descriptions " for PAX3. How to get better text here?? -\hook_put:nnnn - { pdf } - { link_begin_url_attr } - { /Contents } +\pdfannot_dict_put:nnx + {link/URI} + { Contents } { (url) } -\hook_put:nnnn - { pdf } - { link_begin_link_attr } - { /Contents } +\pdfannot_dict_put:nnx + {link/GoTo} + { Contents } { (ref) } - } + \endinput |