[latex3-commits] [latex3/tagpdf] multiplestruct: handle also MC in duplicate structures (f2e4979)
github at latex-project.org
github at latex-project.org
Sun Jan 14 00:17:43 CET 2024
Repository : https://github.com/latex3/tagpdf
On branch : multiplestruct
Link : https://github.com/latex3/tagpdf/commit/f2e4979c301fb2b83bd592cf7935d81058b2c8da
>---------------------------------------------------------------
commit f2e4979c301fb2b83bd592cf7935d81058b2c8da
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun Jan 14 00:17:43 2024 +0100
handle also MC in duplicate structures
>---------------------------------------------------------------
f2e4979c301fb2b83bd592cf7935d81058b2c8da
CHANGELOG.md | 4 +
config-3run.lua | 3 +
tagpdf-checks.dtx | 8 +
tagpdf-mc-generic.dtx | 20 +-
tagpdf-mc-luacode.dtx | 46 +-
tagpdf-struct.dtx | 87 ++--
testfiles-3run/test-multiple-link.luatex.tpf | 512 ++++++++++++++++++++++
testfiles-3run/test-multiple-link.pvt | 15 +
testfiles-3run/test-multiple-link.tpf | 614 +++++++++++++++++++++++++++
9 files changed, 1239 insertions(+), 70 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e2f89a..0fb40f4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ this project uses date-based 'snapshot' version identifiers.
### Fixed
- do not use null with luatex if there is no Kid.
+ - do not produce duplicated OBJR objects if a link is
+ typeset more than once (e.g. in a \text}
+ - do not error if structures are created again e.g. in a \text, instead ignore
+ the duplicate.
## [2023-12-18]
Version 0.98r
diff --git a/config-3run.lua b/config-3run.lua
new file mode 100644
index 0000000..96fddc9
--- /dev/null
+++ b/config-3run.lua
@@ -0,0 +1,3 @@
+testfiledir = "testfiles-3run"
+checkruns = 3
+forcecheckruns=true
diff --git a/tagpdf-checks.dtx b/tagpdf-checks.dtx
index 1f5d29b..6dc692f 100644
--- a/tagpdf-checks.dtx
+++ b/tagpdf-checks.dtx
@@ -1124,6 +1124,14 @@
level:~\int_eval:n{#1+1}~==>~#1\tl_if_empty:nF{#2}{,~label:~#2}~[\msg_line_context:]
}
% \end{macrocode}
+% This is issued if a structure is ignore as duplicate
+% \begin{macrocode}
+\msg_new:nnn { tag / debug } {struct-duplicate}
+ {
+ Structure~#1~already~exists.~Duplicate~ignored.~[\msg_line_context:]
+ }
+% \end{macrocode}
+%
% \begin{macrocode}
%</debug>
% \end{macrocode}
diff --git a/tagpdf-mc-generic.dtx b/tagpdf-mc-generic.dtx
index 510cd0e..c59b4b0 100644
--- a/tagpdf-mc-generic.dtx
+++ b/tagpdf-mc-generic.dtx
@@ -644,13 +644,19 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_mc_handle_stash:n #1 %1 mcidnum
{
- \@@_check_mc_used:n {#1}
- \@@_struct_kid_mc_gput_right:nn
- { \g_@@_struct_stack_current_tl }
- {#1}
- \prop_gput:Nee \g_@@_mc_parenttree_prop
- {#1}
- { \g_@@_struct_stack_current_tl }
+ \prop_get:NVNF
+ \g_@@_struct_duplicate_prop
+ \g_@@_struct_stack_current_tl
+ \l_@@_tmpa_tl
+ {
+ \@@_check_mc_used:n {#1}
+ \@@_struct_kid_mc_gput_right:nn
+ { \g_@@_struct_stack_current_tl }
+ {#1}
+ \prop_gput:Nee \g_@@_mc_parenttree_prop
+ {#1}
+ { \g_@@_struct_stack_current_tl }
+ }
}
\cs_generate_variant:Nn \@@_mc_handle_stash:n { e }
% \end{macrocode}
diff --git a/tagpdf-mc-luacode.dtx b/tagpdf-mc-luacode.dtx
index c387249..93cc629 100644
--- a/tagpdf-mc-luacode.dtx
+++ b/tagpdf-mc-luacode.dtx
@@ -271,29 +271,35 @@
%<debug>\cs_set_protected:Npn \@@_mc_handle_stash:n #1 %1 mcidnum
{
\@@_check_mc_used:n { #1 }
- \seq_gput_right:cn % Don't fill a lua table due to the command in the item,
- % so use the kernel command
- { g_@@_struct_kids_\g_@@_struct_stack_current_tl _seq }
+ \prop_get:NVNF
+ \g_@@_struct_duplicate_prop
+ \g_@@_struct_stack_current_tl
+ \l_@@_tmpa_tl
{
- \@@_mc_insert_mcid_kids:n {#1}%
- }
-%<debug> \seq_gput_right:cn % Don't fill a lua table due to the command in the item,
+ \seq_gput_right:cn % Don't fill a lua table due to the command in the item,
+ % so use the kernel command
+ { g_@@_struct_kids_\g_@@_struct_stack_current_tl _seq }
+ {
+ \@@_mc_insert_mcid_kids:n {#1}%
+ }
+%<debug> \seq_gput_right:cn % Don't fill a lua table due to the command in the item,
%<debug> % so use the kernel command
-%<debug> { g_@@_struct_debug_kids_\g_@@_struct_stack_current_tl _seq }
-%<debug> {
-%<debug> MC~#1%
-%<debug> }
- \lua_now:e
- {
- ltx.@@.func.store_struct_mcabs
- (
- \g_@@_struct_stack_current_tl,#1
- )
+%<debug> { g_@@_struct_debug_kids_\g_@@_struct_stack_current_tl _seq }
+%<debug> {
+%<debug> MC~#1%
+%<debug> }
+ \lua_now:e
+ {
+ ltx.@@.func.store_struct_mcabs
+ (
+ \g_@@_struct_stack_current_tl,#1
+ )
+ }
+ \prop_gput:Nee
+ \g_@@_mc_parenttree_prop
+ { #1 }
+ { \g_@@_struct_stack_current_tl }
}
- \prop_gput:Nee
- \g_@@_mc_parenttree_prop
- { #1 }
- { \g_@@_struct_stack_current_tl }
}
%</luamode|debug>
%<*luamode>
diff --git a/tagpdf-struct.dtx b/tagpdf-struct.dtx
index 8ec364b..b47d85f 100644
--- a/tagpdf-struct.dtx
+++ b/tagpdf-struct.dtx
@@ -776,27 +776,22 @@
%<package> %#3 page object reference
%<debug>\cs_set_protected:Npn\@@_struct_kid_OBJR_gput_right:nnn #1 #2 #3
{
- \prop_get:NnNF
- \g_@@_struct_duplicate_prop
- {#1}
- \l_@@_tmpa_tl
- {
- \pdf_object_unnamed_write:nn
- { dict }
- {
- /Type/OBJR/Obj~#2/Pg~#3
- }
- \@@_seq_gput_right:ce
- { g_@@_struct_kids_#1_seq }
- {
- \pdf_object_ref_last:
- }
-%<debug> \seq_gput_right:ce
-%<debug> { g_@@_struct_debug_kids_#1_seq }
-%<debug> {
-%<debug> OBJR~reference
-%<debug> }
+ \pdf_object_unnamed_write:nn
+ { dict }
+ {
+ /Type/OBJR/Obj~#2/Pg~#3
}
+ \@@_seq_gput_right:ce
+ { g_@@_struct_kids_#1_seq }
+ {
+ \pdf_object_ref_last:
+ }
+%<debug> \seq_gput_right:ce
+%<debug> { g_@@_struct_debug_kids_#1_seq }
+%<debug> {
+%<debug> OBJR~reference
+%<debug> }
+
}
%</package|debug>
%<*package>
@@ -1044,30 +1039,36 @@
{
\msg_error:nn { tag } { struct-faulty-nesting }
}
- %put the obj number of the annot in the kid entry, this also creates
- %the OBJR object
- \@@_property_record:nn {@tag at objr@page@#2 }{ tagabspage }
- \@@_struct_kid_OBJR_gput_right:eee
- {
- \l_@@_struct_stack_parent_tmpa_tl
- }
- {
- #1 %
- }
- {
- \pdf_pageobject_ref:n { \@@_property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
- }
- % add the parent obj number to the parent tree:
- \exp_args:Nne
- \@@_parenttree_add_objr:nn
- {
- #2
- }
+ \prop_get:NVNF
+ \g_@@_struct_duplicate_prop
+ \l_@@_struct_stack_parent_tmpa_tl
+ \l_@@_tmpa_tl
{
- \pdf_object_ref:e { @@/struct/\l_@@_struct_stack_parent_tmpa_tl }
+ %put the obj number of the annot in the kid entry, this also creates
+ %the OBJR object
+ \@@_property_record:nn {@tag at objr@page@#2 }{ tagabspage }
+ \@@_struct_kid_OBJR_gput_right:eee
+ {
+ \l_@@_struct_stack_parent_tmpa_tl
+ }
+ {
+ #1 %
+ }
+ {
+ \pdf_pageobject_ref:n { \@@_property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
+ }
+ % add the parent obj number to the parent tree:
+ \exp_args:Nne
+ \@@_parenttree_add_objr:nn
+ {
+ #2
+ }
+ {
+ \pdf_object_ref:e { @@/struct/\l_@@_struct_stack_parent_tmpa_tl }
+ }
+ % increase the int:
+ \stepcounter{ g_@@_parenttree_obj_int }
}
- % increase the int:
- \stepcounter{ g_@@_parenttree_obj_int }
}
}
% \end{macrocode}
@@ -1458,7 +1459,7 @@
\g_@@_struct_duplicate_prop
{\int_use:N \c at g_@@_struct_abs_int}
{true}
- \typeout{Structure~\the\c at g_@@_struct_abs_int~already~exists} %TODO message
+%<debug> \msg_info:nne{tag / debug}{struct-duplicate}{\int_use:N\c at g_@@_struct_abs_int}
}
\bool_if:NF \l_@@_struct_exist_bool
{
diff --git a/testfiles-3run/test-multiple-link.luatex.tpf b/testfiles-3run/test-multiple-link.luatex.tpf
new file mode 100644
index 0000000..98b2f47
--- /dev/null
+++ b/testfiles-3run/test-multiple-link.luatex.tpf
@@ -0,0 +1,512 @@
+%PDF-1.5
+%ÌÕÁÔÅØÐÄÆ
+17 0 obj
+<< /Type/OBJR/Obj 16 0 R/Pg 9 0 R >>
+endobj
+22 0 obj
+<< /Length 637 >>
+stream
+/opacity1 gs
+/Artifact BMC
+EMC
+/text<</MCID 0>> BDC
+BT
+/F19 9.96264 Tf
+1 0 0 1 287.845 645.28 Tm [(a)]TJ
+/F16 9.96264 Tf
+1 0 0 1 295.879 645.28 Tm [(=)]TJ
+/F19 9.96264 Tf
+1 0 0 1 306.395 645.28 Tm [(b)]TJ
+/F15 9.96264 Tf
+1 0 0 1 310.67 645.28 Tm [<0055>]TJ
+ET
+EMC
+/Link<</MCID 1>> BDC
+BT
+/F15 9.96264 Tf
+1 0 0 1 314.546 645.28 Tm [<0052>]TJ
+ET
+EMC
+/text<</MCID 2>> BDC
+BT
+/F15 9.96264 Tf
+1 0 0 1 319.527 645.28 Tm [<0056>]TJ
+ET
+EMC
+/text<</MCID 3>> BDC
+BT
+/F15 9.96264 Tf
+1 0 0 1 464.747 645.28 Tm [<005500520056>]TJ
+ET
+EMC
+/Artifact BMC
+EMC
+/Artifact BMC
+BT
+/F15 9.96264 Tf
+1 0 0 1 303.133 89.365 Tm [<0052>]TJ
+ET
+EMC
+/Artifact BMC
+EMC
+endstream
+endobj
+9 0 obj
+<< /Type /Page /Contents 22 0 R /Resources 21 0 R /MediaBox [ 0 0 612 792 ] /StructParents 0/Tabs /S /Parent 32 0 R /Annots 33 0 R >>
+endobj
+33 0 obj
+[ 16 0 R ]
+endobj
+16 0 obj
+<< /Type /Annot /Subtype /Link /Contents (ref) /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 1 /Rect [ 313.55 641.793 320.523 653.748 ]/A << /S /GoTo /D (equation.1) /SD 28 0 R >> >>
+endobj
+23 0 obj
+<< /D [ 9 0 R /XYZ 132.768 705.06 null ] >>
+endobj
+24 0 obj
+[ 10 0 R /XYZ 132.768 705.06 null ]
+endobj
+25 0 obj
+<< /D [ 9 0 R /XYZ 133.768 667.198 null ] >>
+endobj
+26 0 obj
+[ 10 0 R /XYZ 133.768 667.198 null ]
+endobj
+27 0 obj
+<< /D [ 9 0 R /XYZ 287.845 657.235 null ] >>
+endobj
+28 0 obj
+[ 14 0 R /XYZ 287.845 657.235 null ]
+endobj
+21 0 obj
+<< /ExtGState 1 0 R /Font << /F19 29 0 R /F16 30 0 R /F15 31 0 R >> /ProcSet [ /PDF /Text ] >>
+endobj
+1 0 obj
+<< /opacity1 <</ca 1/CA 1>> >>
+endobj
+34 0 obj
+<< /Marked true >>
+endobj
+6 0 obj
+<< /Nums [0 [ 14 0 R 15 0 R 14 0 R 14 0 R]
+1 15 0 R
+] >>
+endobj
+35 0 obj
+<< /Limits [(ID.01) (ID.06)]/Names [(ID.01) 10 0 R (ID.02) 11 0 R (ID.03) 12 0 R (ID.04) 13 0 R (ID.05) 14 0 R (ID.06) 15 0 R ] >>
+endobj
+36 0 obj
+<< /Kids [35 0 R] >>
+endobj
+7 0 obj
+<< /Artifact /NonStruct /DocumentFragment /Art /Aside /Note /H7 /H6 /H8 /H6 /H9 /H6 /H10 /H6 /Title /P /FENote /Note /Sub /Span /Em /Span /Strong /Span /title /P /part /P /section /H1 /subsection /H2 /subsubsection /H3 /paragraph /H4 /subparagraph /H5 /list /L /itemize /L /enumerate /L /description /L /quote /BlockQuote /quotation /BlockQuote /verbatim /P /item /LI /itemlabel /Lbl /itembody /LBody /footnote /Note /footnotemark /Lbl /footnotelabel /Lbl /text-unit /Part /text /P /theorem-like /Sect /codeline /Span /float /Note /figures /Sect /tables /Sect >>
+endobj
+37 0 obj
+<< /justify <</O/Layout/TextAlign/Justify>> >>
+endobj
+10 0 obj
+<< /Type /StructElem /S /Document /P 5 0 R /K 13 0 R /ID (ID.01) >>
+endobj
+11 0 obj
+<< /Type /StructElem /S /Artifact /P 5 0 R /ID (ID.02) >>
+endobj
+12 0 obj
+<< /Type /StructElem /S /Artifact /P 5 0 R /ID (ID.03) >>
+endobj
+13 0 obj
+<< /Type /StructElem /S /text-unit /P 10 0 R /K 14 0 R /ID (ID.04) >>
+endobj
+14 0 obj
+<< /Type /StructElem /S /text /P 13 0 R /K [<</Type /MCR /Pg 9 0 R /MCID 0>> 15 0 R <</Type /MCR /Pg 9 0 R /MCID 2>> <</Type /MCR /Pg 9 0 R /MCID 3>> ] /C /justify /ID (ID.05) >>
+endobj
+15 0 obj
+<< /Type /StructElem /S /Link /P 14 0 R /K [<</Type /MCR /Pg 9 0 R /MCID 1>> 17 0 R] /ID (ID.06) >>
+endobj
+5 0 obj
+<< /Type /StructTreeRoot /K 10 0 R /IDTree 36 0 R /ParentTree 6 0 R /RoleMap 7 0 R /ClassMap 37 0 R >>
+endobj
+38 0 obj
+[ 82 [ 500 ] 85 [ 389 389 ] ]
+endobj
+40 0 obj
+<< /Length 11 >>
+[BINARY STREAM]
+endobj
+41 0 obj
+<< /Subtype /CIDFontType0C /Length 756 >>
+[BINARY STREAM]
+endobj
+39 0 obj
+<< /Type /FontDescriptor /FontName /EWXHAQ+LMRoman10-Regular /Flags 4 /FontBBox [ -430 -290 1417 1127 ] /Ascent 1127 /CapHeight 683 /Descent -290 /ItalicAngle 0 /StemV 93 /XHeight 431 /FontFile3 41 0 R /CIDSet 40 0 R >>
+endobj
+42 0 obj
+<< /Length 720 >>
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-EWXHAQ-LMRoman10-Regular-0)
+%%Title: (TeX-EWXHAQ-LMRoman10-Regular-0 TeX EWXHAQ-LMRoman10-Regular 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (EWXHAQ-LMRoman10-Regular)
+/Supplement 0
+>> def
+/CMapName /TeX-Identity-EWXHAQ-LMRoman10-Regular def
+/CMapType 2 def
+1 begincodespacerange
+<0000> <FFFF>
+endcodespacerange
+0 beginbfrange
+endbfrange
+3 beginbfchar
+<0052> <0031>
+<0055> <0028>
+<0056> <0029>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+31 0 obj
+<< /Type /Font /Subtype /Type0 /Encoding /Identity-H /BaseFont /EWXHAQ+LMRoman10-Regular /DescendantFonts [ 43 0 R ] /ToUnicode 42 0 R >>
+endobj
+43 0 obj
+<< /Type /Font /Subtype /CIDFontType0 /BaseFont /EWXHAQ+LMRoman10-Regular /FontDescriptor 39 0 R /W 38 0 R /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> >>
+endobj
+44 0 obj
+[777.8 ]
+endobj
+45 0 obj
+[528.6 429.2 ]
+endobj
+47 0 obj
+<< /Length1 1429 /Length2 6264 /Length3 0 /Length 7693 >>
+[BINARY STREAM]
+endobj
+46 0 obj
+<< /Type /FontDescriptor /FontName /IEHANU+CMMI10 /Flags 4 /FontBBox [ -32 -250 1048 750 ] /Ascent 694 /CapHeight 683 /Descent -194 /ItalicAngle -14 /StemV 72 /XHeight 431 /CharSet( /a /b) /FontFile 47 0 R >>
+endobj
+49 0 obj
+<< /Length1 1389 /Length2 5906 /Length3 0 /Length 7295 >>
+[BINARY STREAM]
+endobj
+48 0 obj
+<< /Type /FontDescriptor /FontName /JHYTSG+CMR10 /Flags 4 /FontBBox [ -40 -250 1009 750 ] /Ascent 694 /CapHeight 683 /Descent -194 /ItalicAngle 0 /StemV 69 /XHeight 431 /CharSet( /equal) /FontFile 49 0 R >>
+endobj
+50 0 obj
+<< /Length 1525 >>
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-cmmi10-builtin-0)
+%%Title: (TeX-cmmi10-builtin-0 TeX cmmi10-builtin 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (cmmi10-builtin)
+/Supplement 0
+>> def
+/CMapName /TeX-cmmi10-builtin-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+18 beginbfrange
+<07> <08> <03A5>
+<0B> <0E> <03B1>
+<10> <15> <03B6>
+<17> <18> <03BD>
+<19> <1A> <03C0>
+<1B> <21> <03C3>
+<28> <29> <21BC>
+<2A> <2B> <21C0>
+<30> <39> <0030>
+<41> <5A> <0041>
+<5B> <5D> <266D>
+<61> <7A> <0061>
+<A8> <A9> <03A5>
+<AE> <B1> <03B1>
+<B3> <B8> <03B6>
+<BA> <BB> <03BD>
+<BC> <BD> <03C0>
+<BE> <C3> <03C3>
+endbfrange
+50 beginbfchar
+<00> <0393>
+<01> <2206>
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<09> <03A8>
+<0A> <2126>
+<0F> <03F5>
+<16> <00B5>
+<22> <03B5>
+<23> <03D1>
+<24> <03D6>
+<25> <03F1>
+<26> <03C2>
+<27> <03D5>
+<2C> <21AA>
+<2D> <21A9>
+<2E> <25B7>
+<2F> <25C1>
+<3A> <002E>
+<3B> <002C>
+<3C> <003C>
+<3D> <002F>
+<3E> <003E>
+<3F> <22C6>
+<40> <2202>
+<5E> <2323>
+<5F> <2322>
+<60> <2113>
+<7B> <0131>
+<7C> <0237>
+<7D> <2118>
+<7E> <20D7>
+<7F> <2040>
+<80> <03C8>
+<A0> <0020>
+<A1> <0393>
+<A2> <2206>
+<A3> <0398>
+<A4> <039B>
+<A5> <039E>
+<A6> <03A0>
+<A7> <03A3>
+<AA> <03A8>
+<AD> <2126>
+<B2> <03F5>
+<B9> <00B5>
+<C4> <2040>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+29 0 obj
+<< /Type /Font /Subtype /Type1 /BaseFont /IEHANU+CMMI10 /FontDescriptor 46 0 R /FirstChar 97 /LastChar 98 /Widths 45 0 R /ToUnicode 50 0 R >>
+endobj
+51 0 obj
+<< /Length 1724 >>
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-cmr10-builtin-0)
+%%Title: (TeX-cmr10-builtin-0 TeX cmr10-builtin 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (cmr10-builtin)
+/Supplement 0
+>> def
+/CMapName /TeX-cmr10-builtin-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+7 beginbfrange
+<07> <08> <03A5>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+<A8> <A9> <03A5>
+endbfrange
+78 beginbfchar
+<00> <0393>
+<01> <2206>
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<09> <03A8>
+<0A> <2126>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5D> <005D>
+<5E> <02C6>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <02DC>
+<7F> <00A8>
+<A0> <0020>
+<A1> <0393>
+<A2> <2206>
+<A3> <0398>
+<A4> <039B>
+<A5> <039E>
+<A6> <03A0>
+<A7> <03A3>
+<AA> <03A8>
+<AB> <00AD>
+<AC> <00A0>
+<AD> <2126>
+<AE> <00660066>
+<AF> <00660069>
+<B0> <0066006C>
+<B1> <006600660069>
+<B2> <00660066006C>
+<B3> <0131>
+<B4> <0237>
+<B5> <0060>
+<B6> <00B4>
+<B7> <02C7>
+<B8> <02D8>
+<B9> <00AF>
+<BA> <02DA>
+<BB> <00B8>
+<BC> <00DF>
+<BD> <00E6>
+<BE> <0153>
+<BF> <00F8>
+<C0> <00C6>
+<C1> <0152>
+<C2> <00D8>
+<C4> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+30 0 obj
+<< /Type /Font /Subtype /Type1 /BaseFont /JHYTSG+CMR10 /FontDescriptor 48 0 R /FirstChar 61 /LastChar 61 /Widths 44 0 R /ToUnicode 51 0 R >>
+endobj
+32 0 obj
+<< /Type /Pages /Count 1 /Kids [ 9 0 R ] >>
+endobj
+52 0 obj
+<< /Names [ (Doc-Start) 25 0 R (equation.1) 27 0 R (page.1) 23 0 R ] /Limits [ (Doc-Start) (page.1) ] >>
+endobj
+53 0 obj
+<< /Dests 52 0 R >>
+endobj
+54 0 obj
+<< /Type /Catalog /Pages 32 0 R /Names 53 0 R /MarkInfo 34 0 R/Lang (en-US)/PageMode /UseOutlines/OpenAction [9 0 R /Fit]/PageLabels <</Nums[0<</S/D>>]>>/StructTreeRoot 5 0 R >>
+endobj
+55 0 obj
+<< /Producer (LuaTeX)/Producer (luahbtex-1.17.0)/Creator <FEFF004C006100540065005800200077006900740068002000680079007000650072007200650066> /Trapped /False >>
+endobj
+xref
+0 56
+0000000002 65535 f
+0000001615 00000 n
+0000000003 00000 f
+0000000004 00000 f
+0000000008 00000 f
+0000003237 00000 n
+0000001698 00000 n
+0000001955 00000 n
+0000000018 00000 f
+0000000770 00000 n
+0000002597 00000 n
+0000002682 00000 n
+0000002757 00000 n
+0000002832 00000 n
+0000002919 00000 n
+0000003119 00000 n
+0000000946 00000 n
+0000000020 00000 n
+0000000019 00000 f
+0000000020 00000 f
+0000000000 00000 f
+0000001504 00000 n
+0000000073 00000 n
+0000001164 00000 n
+0000001224 00000 n
+0000001276 00000 n
+0000001337 00000 n
+0000001390 00000 n
+0000001451 00000 n
+0000022958 00000 n
+0000024900 00000 n
+0000005329 00000 n
+0000025057 00000 n
+0000000919 00000 n
+0000001662 00000 n
+0000001771 00000 n
+0000001918 00000 n
+0000002534 00000 n
+0000003356 00000 n
+0000004313 00000 n
+0000003402 00000 n
+0000003473 00000 n
+0000004549 00000 n
+0000005483 00000 n
+0000005683 00000 n
+0000005708 00000 n
+0000013531 00000 n
+0000005739 00000 n
+0000021150 00000 n
+0000013756 00000 n
+0000021373 00000 n
+0000023116 00000 n
+0000025118 00000 n
+0000025239 00000 n
+0000025275 00000 n
+0000025469 00000 n
+trailer
+<< /Size 56 /Root 54 0 R /Info 55 0 R >>
+startxref
+25644
+%%EOF
diff --git a/testfiles-3run/test-multiple-link.pvt b/testfiles-3run/test-multiple-link.pvt
new file mode 100644
index 0000000..e4f815d
--- /dev/null
+++ b/testfiles-3run/test-multiple-link.pvt
@@ -0,0 +1,15 @@
+\input{regression-test}
+\DocumentMetadata{
+ testphase={phase-III},
+ xmp=false,
+}
+\documentclass[]{article}
+\usepackage{amsmath}
+\usepackage{hyperref}
+\usepackage{tagpdf-debug}
+\begin{document}
+\START
+\begin{equation}\label{eq:C}
+a=b \text{\eqref{eq:C}}
+\end{equation}
+\end{document}
diff --git a/testfiles-3run/test-multiple-link.tpf b/testfiles-3run/test-multiple-link.tpf
new file mode 100644
index 0000000..932845f
--- /dev/null
+++ b/testfiles-3run/test-multiple-link.tpf
@@ -0,0 +1,614 @@
+%PDF-1.5
+%ÐÔÅØ
+17 0 obj
+<< /Type/OBJR/Obj 16 0 R/Pg 9 0 R >>
+endobj
+22 0 obj
+<<
+/Length 486
+>>
+stream
+/opacity1 gs
+/Artifact BMC
+EMC
+/text <</MCID 0 >> BDC
+BT
+/F31 9.9626 Tf 287.846 645.28 Td [(a)]TJ/F28 9.9626 Tf 8.034 0 Td [(=)]TJ/F31 9.9626 Tf 10.516 0 Td [(b)]TJ/F28 9.9626 Tf 4.275 0 Td [(\050)]TJ
+ET
+EMC
+/Link <</MCID 1 >> BDC
+BT
+/F28 9.9626 Tf 314.546 645.28 Td [(1)]TJ
+ET
+EMC
+/text <</MCID 2 >> BDC
+BT
+/F28 9.9626 Tf 319.527 645.28 Td [(\051)]TJ/F40 9.9626 Tf( )Tj/F28 9.9626 Tf 145.222 0 Td [(\0501\051)]TJ
+ET
+EMC
+/Artifact BMC
+BT
+/F28 9.9626 Tf 303.133 89.365 Td [(1)]TJ
+ET
+EMC
+endstream
+endobj
+9 0 obj
+<<
+/Type /Page
+/Contents 22 0 R
+/Resources 21 0 R
+/MediaBox [0 0 612 792]
+/Tabs /S /StructParents 0
+/Parent 32 0 R
+/Annots [ 16 0 R ]
+>>
+endobj
+16 0 obj
+<<
+/Type /Annot
+/Subtype /Link
+/Contents (ref) /Border [0 0 1] /H /I /C [0.701176 0.4 0.414118] /StructParent 1
+/Rect [313.55 641.793 320.523 653.748]
+/A << /S /GoTo /D (equation.1) /SD 28 0 R >>
+>>
+endobj
+23 0 obj
+<<
+/D [9 0 R /XYZ 132.768 705.06 null]
+>>
+endobj
+24 0 obj
+[10 0 R /XYZ 132.768 705.06 null]
+endobj
+25 0 obj
+<<
+/D [9 0 R /XYZ 133.768 667.198 null]
+>>
+endobj
+26 0 obj
+[10 0 R /XYZ 133.768 667.198 null]
+endobj
+27 0 obj
+<<
+/D [9 0 R /XYZ 287.846 657.235 null]
+>>
+endobj
+28 0 obj
+[14 0 R /XYZ 287.846 657.235 null]
+endobj
+21 0 obj
+<<
+/ExtGState 1 0 R
+/Font << /F31 29 0 R /F28 30 0 R /F40 31 0 R >>
+/ProcSet [ /PDF /Text ]
+>>
+endobj
+1 0 obj
+<< /opacity1 <</ca 1/CA 1>> >>
+endobj
+33 0 obj
+<< /Marked true >>
+endobj
+6 0 obj
+<< /Nums [0 [ 14 0 R 15 0 R 14 0 R ]
+1 15 0 R
+] >>
+endobj
+34 0 obj
+<< /Limits [(ID.01) (ID.06)]/Names [(ID.01) 10 0 R (ID.02) 11 0 R (ID.03) 12 0 R (ID.04) 13 0 R (ID.05) 14 0 R (ID.06) 15 0 R ] >>
+endobj
+35 0 obj
+<< /Kids [34 0 R] >>
+endobj
+7 0 obj
+<< /Artifact /NonStruct /DocumentFragment /Art /Aside /Note /H7 /H6 /H8 /H6 /H9 /H6 /H10 /H6 /Title /P /FENote /Note /Sub /Span /Em /Span /Strong /Span /title /P /part /P /section /H1 /subsection /H2 /subsubsection /H3 /paragraph /H4 /subparagraph /H5 /list /L /itemize /L /enumerate /L /description /L /quote /BlockQuote /quotation /BlockQuote /verbatim /P /item /LI /itemlabel /Lbl /itembody /LBody /footnote /Note /footnotemark /Lbl /footnotelabel /Lbl /text-unit /Part /text /P /theorem-like /Sect /codeline /Span /float /Note /figures /Sect /tables /Sect >>
+endobj
+36 0 obj
+<< /justify <</O/Layout/TextAlign/Justify>> >>
+endobj
+10 0 obj
+<< /Type /StructElem /S /Document /P 5 0 R /K 13 0 R /ID (ID.01) >>
+endobj
+11 0 obj
+<< /Type /StructElem /S /Artifact /P 5 0 R /ID (ID.02) >>
+endobj
+12 0 obj
+<< /Type /StructElem /S /Artifact /P 5 0 R /ID (ID.03) >>
+endobj
+13 0 obj
+<< /Type /StructElem /S /text-unit /P 10 0 R /K 14 0 R /ID (ID.04) >>
+endobj
+14 0 obj
+<< /Type /StructElem /S /text /P 13 0 R /K [<</Type /MCR /Pg 9 0 R/MCID 0>> 15 0 R <</Type /MCR /Pg 9 0 R/MCID 2>> <</Type /MCR /Pg 9 0 R/MCID 1>> <</Type /MCR /Pg 9 0 R/MCID 1>> <</Type /MCR /Pg 9 0 R/MCID 1>>] /C /justify /ID (ID.05) >>
+endobj
+15 0 obj
+<< /Type /StructElem /S /Link /P 14 0 R /K [<</Type /MCR /Pg 9 0 R/MCID 1>> 17 0 R] /ID (ID.06) >>
+endobj
+5 0 obj
+<< /Type /StructTreeRoot /K 10 0 R /IDTree 35 0 R /ParentTree 6 0 R /RoleMap 7 0 R /ClassMap 36 0 R >>
+endobj
+37 0 obj
+[334.2]
+endobj
+38 0 obj
+[388.9 388.9 500 777.8 277.8 333.3 277.8 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8]
+endobj
+39 0 obj
+[528.6 429.2]
+endobj
+40 0 obj
+<<
+/Length1 1407
+/Length2 6264
+/Length3 0
+/Length 7671
+>>
+[BINARY STREAM]
+endobj
+41 0 obj
+<<
+/Type /FontDescriptor
+/FontName /IEHANU+CMMI10
+/Flags 4
+/FontBBox [-32 -250 1048 750]
+/Ascent 694
+/CapHeight 683
+/Descent -194
+/ItalicAngle -14
+/StemV 72
+/XHeight 431
+/CharSet (/a/b)
+/FontFile 40 0 R
+>>
+endobj
+42 0 obj
+<<
+/Length1 1428
+/Length2 6295
+/Length3 0
+/Length 7723
+>>
+[BINARY STREAM]
+endobj
+43 0 obj
+<<
+/Type /FontDescriptor
+/FontName /RZZDNX+CMR10
+/Flags 4
+/FontBBox [-40 -250 1009 750]
+/Ascent 694
+/CapHeight 683
+/Descent -194
+/ItalicAngle 0
+/StemV 69
+/XHeight 431
+/CharSet (/equal/one/parenleft/parenright)
+/FontFile 42 0 R
+>>
+endobj
+44 0 obj
+<<
+/Length1 1144
+/Length2 1422
+/Length3 0
+/Length 2566
+>>
+[BINARY STREAM]
+endobj
+45 0 obj
+<<
+/Type /FontDescriptor
+/FontName /MUQHVU+PdfTeX-Space
+/Flags 4
+/FontBBox [0 -290 333 1127]
+/Ascent 0
+/CapHeight 0
+/Descent 0
+/ItalicAngle 0
+/StemV 0
+/XHeight 500
+/CharSet (/space)
+/FontFile 44 0 R
+>>
+endobj
+46 0 obj
+<<
+/Length 1583
+>>
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-cmmi10-builtin-0)
+%%Title: (TeX-cmmi10-builtin-0 TeX cmmi10-builtin 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (cmmi10-builtin)
+/Supplement 0
+>> def
+/CMapName /TeX-cmmi10-builtin-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+20 beginbfrange
+<07> <08> <03A5>
+<0B> <0E> <03B1>
+<10> <15> <03B6>
+<17> <18> <03BD>
+<19> <1A> <03C0>
+<1B> <1D> <03C3>
+<1F> <21> <03C7>
+<28> <29> <21BC>
+<2A> <2B> <21C0>
+<30> <39> <0030>
+<41> <5A> <0041>
+<5B> <5D> <266D>
+<61> <7A> <0061>
+<A8> <A9> <03A5>
+<AE> <B1> <03B1>
+<B3> <B8> <03B6>
+<BA> <BB> <03BD>
+<BC> <BD> <03C0>
+<BE> <C0> <03C3>
+<C2> <C3> <03C7>
+endbfrange
+52 beginbfchar
+<00> <0393>
+<01> <2206>
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<09> <03A8>
+<0A> <2126>
+<0F> <03F5>
+<16> <00B5>
+<1E> <03D5>
+<22> <03B5>
+<23> <03D1>
+<24> <03D6>
+<25> <03F1>
+<26> <03C2>
+<27> <03C6>
+<2C> <21AA>
+<2D> <21A9>
+<2E> <25B7>
+<2F> <25C1>
+<3A> <002E>
+<3B> <002C>
+<3C> <003C>
+<3D> <002F>
+<3E> <003E>
+<3F> <22C6>
+<40> <2202>
+<5E> <2323>
+<5F> <2322>
+<60> <2113>
+<7B> <0131>
+<7C> <0237>
+<7D> <2118>
+<7E> <20D7>
+<7F> <2040>
+<80> <03C8>
+<A0> <0020>
+<A1> <0393>
+<A2> <2206>
+<A3> <0398>
+<A4> <039B>
+<A5> <039E>
+<A6> <03A0>
+<A7> <03A3>
+<AA> <03A8>
+<AD> <2126>
+<B2> <03F5>
+<B9> <00B5>
+<C1> <03D5>
+<C4> <2040>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+29 0 obj
+<<
+/Type /Font
+/Subtype /Type1
+/BaseFont /IEHANU+CMMI10
+/FontDescriptor 41 0 R
+/FirstChar 97
+/LastChar 98
+/Widths 39 0 R
+/ToUnicode 46 0 R
+>>
+endobj
+47 0 obj
+<<
+/Length 1724
+>>
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-cmr10-builtin-0)
+%%Title: (TeX-cmr10-builtin-0 TeX cmr10-builtin 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (cmr10-builtin)
+/Supplement 0
+>> def
+/CMapName /TeX-cmr10-builtin-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+7 beginbfrange
+<07> <08> <03A5>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+<A8> <A9> <03A5>
+endbfrange
+78 beginbfchar
+<00> <0393>
+<01> <2206>
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<09> <03A8>
+<0A> <2126>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5D> <005D>
+<5E> <02C6>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <02DC>
+<7F> <00A8>
+<A0> <0020>
+<A1> <0393>
+<A2> <2206>
+<A3> <0398>
+<A4> <039B>
+<A5> <039E>
+<A6> <03A0>
+<A7> <03A3>
+<AA> <03A8>
+<AB> <00AD>
+<AC> <00A0>
+<AD> <2126>
+<AE> <00660066>
+<AF> <00660069>
+<B0> <0066006C>
+<B1> <006600660069>
+<B2> <00660066006C>
+<B3> <0131>
+<B4> <0237>
+<B5> <0060>
+<B6> <00B4>
+<B7> <02C7>
+<B8> <02D8>
+<B9> <00AF>
+<BA> <02DA>
+<BB> <00B8>
+<BC> <00DF>
+<BD> <00E6>
+<BE> <0153>
+<BF> <00F8>
+<C0> <00C6>
+<C1> <0152>
+<C2> <00D8>
+<C4> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+30 0 obj
+<<
+/Type /Font
+/Subtype /Type1
+/BaseFont /RZZDNX+CMR10
+/FontDescriptor 43 0 R
+/FirstChar 40
+/LastChar 61
+/Widths 38 0 R
+/ToUnicode 47 0 R
+>>
+endobj
+48 0 obj
+<<
+/Length 654
+>>
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-pdftexspace-builtin-0)
+%%Title: (TeX-pdftexspace-builtin-0 TeX pdftexspace-builtin 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (pdftexspace-builtin)
+/Supplement 0
+>> def
+/CMapName /TeX-pdftexspace-builtin-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <FF>
+endcodespacerange
+0 beginbfrange
+endbfrange
+1 beginbfchar
+<20> <0020>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+31 0 obj
+<<
+/Type /Font
+/Subtype /Type1
+/BaseFont /MUQHVU+PdfTeX-Space
+/FontDescriptor 45 0 R
+/FirstChar 32
+/LastChar 32
+/Widths 37 0 R
+/ToUnicode 48 0 R
+>>
+endobj
+32 0 obj
+<<
+/Type /Pages
+/Count 1
+/Kids [9 0 R]
+>>
+endobj
+49 0 obj
+<<
+/Names [(Doc-Start) 25 0 R (equation.1) 27 0 R (page.1) 23 0 R]
+/Limits [(Doc-Start) (page.1)]
+>>
+endobj
+50 0 obj
+<<
+/Dests 49 0 R
+>>
+endobj
+51 0 obj
+<<
+/Type /Catalog
+/Pages 32 0 R
+/Names 50 0 R
+/MarkInfo 33 0 R/Lang (en-US)/PageMode /UseOutlines/OpenAction [9 0 R /Fit]/PageLabels <</Nums[0<</S/D>>]>>/StructTreeRoot 5 0 R
+>>
+endobj
+52 0 obj
+<<
+/Producer (pdfTeX)/Producer (pdftex-1.40.25)/Creator <FEFF004C006100540065005800200077006900740068002000680079007000650072007200650066>
+/Trapped /False
+>>
+endobj
+xref
+0 53
+0000000002 65535 f
+0000001422 00000 n
+0000000003 00000 f
+0000000004 00000 f
+0000000008 00000 f
+0000003091 00000 n
+0000001505 00000 n
+0000001755 00000 n
+0000000018 00000 f
+0000000613 00000 n
+0000002397 00000 n
+0000002482 00000 n
+0000002557 00000 n
+0000002632 00000 n
+0000002719 00000 n
+0000002975 00000 n
+0000000766 00000 n
+0000000015 00000 n
+0000000019 00000 f
+0000000020 00000 f
+0000000000 00000 f
+0000001310 00000 n
+0000000068 00000 n
+0000000982 00000 n
+0000001040 00000 n
+0000001090 00000 n
+0000001149 00000 n
+0000001200 00000 n
+0000001259 00000 n
+0000023972 00000 n
+0000025913 00000 n
+0000026783 00000 n
+0000026947 00000 n
+0000001469 00000 n
+0000001571 00000 n
+0000001718 00000 n
+0000002334 00000 n
+0000003210 00000 n
+0000003234 00000 n
+0000003360 00000 n
+0000003390 00000 n
+0000011159 00000 n
+0000011381 00000 n
+0000019202 00000 n
+0000019448 00000 n
+0000022112 00000 n
+0000022330 00000 n
+0000024130 00000 n
+0000026070 00000 n
+0000027005 00000 n
+0000027122 00000 n
+0000027158 00000 n
+0000027352 00000 n
+trailer
+<< /Size 53
+/Root 51 0 R
+/Info 52 0 R
+ >>
+startxref
+27526
+%%EOF
More information about the latex3-commits
mailing list.