[latex3-commits] [latex3/latex2e] lab-review-02: avoid anchor in caption (122b3be4)

github at latex-project.org github at latex-project.org
Sun Jun 25 17:33:01 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : lab-review-02
Link       : https://github.com/latex3/latex2e/commit/122b3be4627262c8d03312534e95543c953c13fd

>---------------------------------------------------------------

commit 122b3be4627262c8d03312534e95543c953c13fd
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sun Jun 25 17:33:01 2023 +0200

    avoid anchor in caption


>---------------------------------------------------------------

122b3be4627262c8d03312534e95543c953c13fd
 required/latex-lab/latex-lab-float.dtx | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/required/latex-lab/latex-lab-float.dtx b/required/latex-lab/latex-lab-float.dtx
index 8e456540..d49f5963 100644
--- a/required/latex-lab/latex-lab-float.dtx
+++ b/required/latex-lab/latex-lab-float.dtx
@@ -443,6 +443,22 @@
 %    \begin{macrocode}
 \def\hyper at nopatch@caption{}
 %    \end{macrocode}
+%
+% With hyperref that means that the \cs{refstepcounter} now can affect spacing so we
+% change that to the kernel refstepcounter:
+%    \begin{macrocode}
+\let\@kernel at refstepcounter\refstepcounter %as long it is not in the kernel
+\def\caption{%
+   \ifx\@captype\@undefined
+     \@latex at error{\noexpand\caption outside float}\@ehd
+     \expandafter\@gobble
+   \else
+     \@kernel at refstepcounter\@captype
+     \expandafter\@firstofone
+   \fi
+   {\@dblarg{\@caption\@captype}}%
+}
+%    \end{macrocode}
 % As we will use the structure number in the target, we need to provide a
 % theH-representation. (Once the kernel will create
 % theH-representation generally this will be provided automatically, as tagpdf uses
@@ -497,7 +513,7 @@
           \tag_mc_end:
          \tag_struct_end:
          \tag_mc_begin:n{}  
-          #2\par
+          #2
          \tag_mc_end:\hfil}%
        \fi
        \tag_struct_end: %caption





More information about the latex3-commits mailing list.