summaryrefslogtreecommitdiff
path: root/macros/latex-dev/required/latex-lab/latex-lab-float.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/required/latex-lab/latex-lab-float.dtx')
-rw-r--r--macros/latex-dev/required/latex-lab/latex-lab-float.dtx60
1 files changed, 49 insertions, 11 deletions
diff --git a/macros/latex-dev/required/latex-lab/latex-lab-float.dtx b/macros/latex-dev/required/latex-lab/latex-lab-float.dtx
index 430b2aec96..3bd3483600 100644
--- a/macros/latex-dev/required/latex-lab/latex-lab-float.dtx
+++ b/macros/latex-dev/required/latex-lab/latex-lab-float.dtx
@@ -16,6 +16,8 @@
%
% for those people who are interested or want to report an issue.
%
+\def\ltlabfloatdate{2023-07-20}
+\def\ltlabfloatversion{0.81a}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
@@ -31,7 +33,7 @@
% \title{The \textsf{latex-lab-floats} package\\
% Tagging of floats }
% \author{\LaTeX{} Project\thanks{Initial implementation done by Ulrike Fischer}}
-% \date{v0.81 2023-06-07}
+% \date{v\ltlabfloatversion\ \ltlabfloatdate}
%
% \maketitle
%
@@ -128,17 +130,11 @@
% \begin{implementation}
% \section{Implementation}
% \begin{macrocode}
-\ProvidesExplPackage {latex-lab-testphase-float} {2023-04-28} {0.8}
+\ProvidesExplPackage {latex-lab-testphase-float} {\ltlabfloatdate} {\ltlabfloatversion}
{Code related to the tagging of floats}
% \end{macrocode}
% \subsection{Variables}
-% We rolemap to Aside, and float sections to Sect
-%
-% \begin{macrocode}
-\tagpdfsetup{add-new-tag=float/Aside}
-\tagpdfsetup{add-new-tag=figures/Sect}
-\tagpdfsetup{add-new-tag=tables/Sect}
-% \end{macrocode}
+% We rolemap to float to Aside, and float sections to Sect.
%
% \begin{variable}{
% \g_@@_float_sect_prop,
@@ -408,6 +404,32 @@
\fi
\fi
}
+% \end{macrocode}
+% and similar for double floats:
+% \begin{macrocode}
+\def\end@dblfloat{%
+ \if@twocolumn
+ \@endfloatbox
+ \@nameuse{@@_float_end:}%
+ \ifnum\@floatpenalty <\z@
+ \@largefloatcheck
+ \global\dp\@currbox1sp %
+ \@cons\@currlist\@currbox
+ \ifnum\@floatpenalty <-\@Mii
+ \penalty -\@Miv
+ \@tempdima\prevdepth
+ \vbox{}%
+ \prevdepth\@tempdima
+ \penalty\@floatpenalty
+ \else
+ \vadjust{\penalty -\@Miv \vbox{}\penalty\@floatpenalty}\@Esphack
+ \@nameuse{@@_float_start_par:} %restart P safe here??
+ \fi
+ \fi
+ \else
+ \end@float
+ \fi
+}%
\ExplSyntaxOn
% \end{macrocode}
%
@@ -417,6 +439,22 @@
% \begin{macrocode}
\def\hyper@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@refstepcounter\refstepcounter %as long it is not in the kernel
+\def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \@kernel@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
@@ -471,7 +509,7 @@
\tag_mc_end:
\tag_struct_end:
\tag_mc_begin:n{}
- #2\par
+ #2
\tag_mc_end:\hfil}%
\fi
\tag_struct_end: %caption
@@ -487,7 +525,7 @@
% \begin{macrocode}
%<*latex-lab>
\ProvidesFile{float-latex-lab-testphase.ltx}
- [2023-04-30 v0.8 code related to the tagging of floats]
+ [\ltlabfloatdate\space v\ltlabfloatversion\space latex-lab wrapper float]
\RequirePackage{latex-lab-testphase-float}
%</latex-lab>
% \end{macrocode}