[latex3-commits] [git/LaTeX3-latex3-latex2e] cleanup-footnote-lab: assume no-op tagpdf commands (b5c98280)
Ulrike Fischer
fischer at troubleshooting-tex.de
Thu May 12 20:20:45 CEST 2022
Repository : https://github.com/latex3/latex2e
On branch : cleanup-footnote-lab
Link : https://github.com/latex3/latex2e/commit/b5c982805bf41d9ba14379b393cacf70fbfd4db8
>---------------------------------------------------------------
commit b5c982805bf41d9ba14379b393cacf70fbfd4db8
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Thu May 12 20:20:45 2022 +0200
assume no-op tagpdf commands
>---------------------------------------------------------------
b5c982805bf41d9ba14379b393cacf70fbfd4db8
required/latex-lab/latex-lab-footnotes.dtx | 130 +++++++++++++----------------
1 file changed, 58 insertions(+), 72 deletions(-)
diff --git a/required/latex-lab/latex-lab-footnotes.dtx b/required/latex-lab/latex-lab-footnotes.dtx
index 14e86188..399eaf8f 100644
--- a/required/latex-lab/latex-lab-footnotes.dtx
+++ b/required/latex-lab/latex-lab-footnotes.dtx
@@ -535,7 +535,7 @@
% \end{macrocode}
% If a footnote mark is placed by its own then it should finish by
% executing \hook{fnmark/end}, resetting the space factor, and
-% finishing with \hook{fnmark/after}. However, inf a complete
+% finishing with \hook{fnmark/after}. However, in a complete
% footnote these actions have to happen only after we have handled
% the footnote text (e.g., by placing it into an \cs{insert}. In
% such a situation \cs{_@@_footmark_finish:} below does nothing
@@ -782,7 +782,7 @@
% classes then replace it with \cs{fnote_makefntext:n}, otherwise
% try to patch the definition.
%
-% Here is the the definition the way it is in
+% Here is the definition the way it is in
% \texttt{classes.dtx}. Notice that (for saving space) there is no
% space after \texttt{em} to terminate the assignment. We need to
% mimic that, otherwise a test would return false even if the
@@ -1017,30 +1017,24 @@
\AddToHook{fnmark/begin}{\stepcounter{absfootnote}} % too simple (fails with opt args)
-
-% this is rubbish and should be handled better:
-
-\cs_new_protected:Npn \tag_if_loaded:TF { \cs_if_exist:NTF \tag_struct_begin:n }
-
-
-
-\cs_new_protected:Npn \tag at FEMark #1 {
- \tag_if_loaded:TF
- {
- \tag_mc_end_push:
- \exp_args:Nx
- \tag_struct_begin:n{tag=Lbl,ref=fn.\the\c at absfootnote}
- \tag_mc_begin:n{tag=Lbl}
- \IfPackageLoadedTF{hyperref}{ \hyper at linkstart
- {link}{fn.\the\c at absfootnote} }{}
- #1
- \IfPackageLoadedTF{hyperref}{ \hyper at linkend }{}
- \tag_mc_end:
- \tag_struct_end:
- \tag_mc_begin_pop:n{}
- }
- { #1 }
-}
+%this is the command for the mark in the text
+%the test for hyperlink support should be simplyfied.
+%Perhaps some dummy commands would be better.
+%The ref key must be improved. using absfootnote is too simple minded.
+\cs_new_protected:Npn \tag at FEMark #1
+ {
+ \tag_mc_end_push:
+ \exp_args:Nx
+ \tag_struct_begin:n{tag=Lbl,ref=fn.\the\c at absfootnote}
+ \tag_mc_begin:n{tag=Lbl}
+ \IfPackageLoadedTF{hyperref}{ \hyper at linkstart
+ {link}{fn.\the\c at absfootnote} }{}
+ #1
+ \IfPackageLoadedTF{hyperref}{ \hyper at linkend }{}
+ \tag_mc_end:
+ \tag_struct_end:
+ \tag_mc_begin_pop:n{}
+ }
% to be done next round around:
%
@@ -1052,61 +1046,53 @@
\cs_set_eq:NN \@kernel at process@makefnmark \tag at FEMark
-
% kernel hook for tagging (2 args)
-\cs_set:Npn \@kernel at process@footnotetext #1#2 {
- \tag_if_loaded:TF
- {
- \tag_mc_end_push:
- \tag_struct_begin:n { tag=FENote,label=fn.\the\c at absfootnote }
+% this sets the structure around the whole text
+\cs_set:Npn \@kernel at process@footnotetext #1#2
+ {
+ \tag_mc_end_push:
+ \tag_struct_begin:n { tag=FENote,label=fn.\the\c at absfootnote }
#1 {#2}
- \tag_struct_end:
- \tag_mc_begin_pop:n{}
- }
- { #1 {#2} }
-}
-
+ \tag_struct_end:
+ \tag_mc_begin_pop:n{}
+ }
-\cs_set:Npn \@makefntext at cfgpoint #1 {
- \noindent
- \cs_if_exist:NT \tag_struct_begin:n { \tag_mc_end_push: }
- \tag at FELbl { #1 }
-}
-
-\cs_set:Npn \@makefntext at cfgpointii #1 {
- \tag at FENote { #1 }
- \cs_if_exist:NT \tag_struct_begin:n { \tag_mc_begin_pop:n{} }
-}
-
+\cs_set:Npn \@makefntext at cfgpoint #1
+ {
+ \noindent
+ \tag_mc_end_push:
+ \tag at FELbl { #1 }
+ }
+\cs_set:Npn \@makefntext at cfgpointii #1
+ {
+ \tag at FENote { #1 }
+ \tag_mc_begin_pop:n{}
+ }
-\cs_new_protected:Npn \tag at FELbl #1 {
- \tag_if_loaded:TF
- {
- % target should perhaps be raised ...
- \IfPackageLoadedTF{hyperref}{ \hypertarget{fn.\the\c at absfootnote}{} }{}
- %\tag_struct_begin:n { tag=FENote,label=fn.\the\c at absfootnote } %alternativ location for structure
- \tag_struct_begin:n { tag=Lbl }
- \tag_mc_begin:n { tag=Lbl }
- #1
- \tag_mc_end:
- \tag_struct_end:
- }
- { #1 }
-}
-\cs_new_protected:Npn \tag at FENote #1 {
- \tag_if_loaded:TF
- {
- \tag_mc_begin:n{tag=FENote}
- #1
+% this is the command for the label.
+\cs_new_protected:Npn \tag at FELbl #1
+ {
+ % target should use \MakeLinkTarget when it exists
+ \IfPackageLoadedTF{hyperref}{ \hypertarget{fn.\the\c at absfootnote}{} }{}
+ %\tag_struct_begin:n { tag=FENote,label=fn.\the\c at absfootnote } %alternativ location for structure
+ \tag_struct_begin:n { tag=Lbl }
+ \tag_mc_begin:n { tag=Lbl }
+ #1
\tag_mc_end:
- %\tag_struct_end: %alternative location for structure end but ends inside a P
- }
- { #1 }
-}
+ \tag_struct_end:
+ }
+
+\cs_new_protected:Npn \tag at FENote #1
+ {
+ \tag_mc_begin:n{tag=FENote}
+ #1
+ \tag_mc_end:
+ %\tag_struct_end: %alternative location for structure end but ends inside a P
+ }
%-------------------------------------
More information about the latex3-commits
mailing list.