diff options
Diffstat (limited to 'Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx | 90 |
1 files changed, 75 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx index 2389906c5ac..a3d044ab87d 100644 --- a/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx +++ b/Master/texmf-dist/source/latex-dev/latex-lab/latex-lab-footnotes.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % %% File: latex-lab-footnotes.dtx -% Copyright (C) 2022-2023 The LaTeX Project +% Copyright (C) 2022-2024 The LaTeX Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -17,8 +17,8 @@ % % for those people who are interested or want to report an issue. % -\def\ltlabfootnotedate{2023-09-04} -\def\ltlabfootnoteversion{0.8c} +\def\ltlabfootnotedate{2024-03-12} +\def\ltlabfootnoteversion{0.8d} %<*driver> \documentclass{l3doc} @@ -454,6 +454,14 @@ % option. % \end{itemize} % +% \subsection{Debugging sockets and hooks} +% +% For some rudimentary debugging we currently have \cs{DebugFNotesOn} +% (and \cs{DebugFNotesOff}). At the moment \cs{DebugFNotesOn} only +% shows the current settings for hooks and sockets related to the +% footnote code and then +% automatically turns itself off again. +% % % \section{Tagging and hyperlinking support} % @@ -978,13 +986,22 @@ % \end{hookdecl} % % \subsection{Debugging code} -% the debugging code is just temporary +% The debugging code is just temporary % -% For now we have debugging turned on by default % \begin{macrocode} \bool_new:N \g_fnote_debug_bool -\bool_gset_true:N \g_fnote_debug_bool % \end{macrocode} + +% \begin{macro}{\DebugFNotesOn,\DebugFNotesOff} +% +% \begin{macrocode} +\cs_new_protected:Npn \DebugFNotesOn { \bool_gset_true:N \g_fnote_debug_bool } +\cs_new_protected:Npn \DebugFNotesOff { \bool_gset_false:N \g_fnote_debug_bool } +% \end{macrocode} +% \end{macro} +% +% +% % We log the hooks in the footnote mark command, but only once % \begin{macrocode} \cs_new_protected:Npn \@@_debug_footnotemark: @@ -1485,10 +1502,18 @@ \tl_if_in:NnTF \l_@@_patch_tl { \hb@xt@ } { \cs_set_eq:NN \@@_tmp:w \@@_patch_hb@xt@:w } { - \tl_if_in:NnTF \l_@@_patch_tl { \@makefnmark } - { \cs_set_eq:NN \@@_tmp:w \@@_patch_@makefnmark:w } - { \ERROR - \cs_set_eq:NN \@@_tmp:w \exp_stop_f: } +% \end{macrocode} +% Some styles/classes use \verb=\makebox[...][...]= instead of \cs{hb@xt@} +% so try to patch those too. +% \begin{macrocode} + \tl_if_in:NnTF \l_@@_patch_tl { \makebox } + { \cs_set_eq:NN \@@_tmp:w \@@_patch_makebox:w } + { + \tl_if_in:NnTF \l_@@_patch_tl { \@makefnmark } + { \cs_set_eq:NN \@@_tmp:w \@@_patch_@makefnmark:w } + { \ERROR + \cs_set_eq:NN \@@_tmp:w \exp_stop_f: } + } } } \tl_set:Nf \l_@@_patch_tl @@ -1512,6 +1537,17 @@ % \begin{macrocode} \cs_new:Npn \@@_patch_hb@xt@:w #1 \hb@xt@ #2 # { \exp_stop_f: #1 \@makefntext@processX { \hb@xt@ #2 } } +% \end{macrocode} +% +% \begin{macrocode} +\cs_new:Npn \@@_patch_makebox:w #1 \makebox #2 # + { \exp_stop_f: #1 \@makefntext@processX { \makebox #2 } } +% \end{macrocode} +% +% If the definition contains neither \cs{hbox}, \cs{hb@xt@} nor \cs{makebox}, +% we see if it contains \cs{@makefnmark} and if so put the socket +% before that. +% \begin{macrocode} \cs_new:Npn \@@_patch_@makefnmark:w #1 \@makefnmark { \exp_stop_f: #1 \@makefntext@processX { \use:n } { \@makefnmark } } % \end{macrocode} @@ -1539,7 +1575,12 @@ \cs_set_eq:NN \@makefntext \fnote_makefntext:n } { - \@@_patch: +% \end{macrocode} +% If \cs{@makefntext} contains the definition from \pkg{footmisc} +% we do nothing, otherwise we try to patch. +% \begin{macrocode} + \cs_if_eq:NNF \@makefntext \footmisc@hang@makefntext + { \@@_patch: } } } @@ -2421,8 +2462,9 @@ \else \ifFN@hangfoot - \long\def\@makefntext#1{% + \long\def\footmisc@hang@makefntext#1{% \bgroup + \SuspendTagging{footmisc}% \setbox\@tempboxa\hbox{% \ifdim\footnotemargin>\z@ \hb@xt@\footnotemargin{\@makefnmark\hss}% @@ -2437,14 +2479,33 @@ \parshape \@ne \leftmargin \linewidth \footnotesize \@setpar{{\@@par}}% + \ResumeTagging{footmisc}% \leavevmode - \llap{\box\@tempboxa}% +% \end{macrocode} +% Typesetting the mark twice means that one can't have any material +% inside that gets unhappy in that case. Tha shouldn't be a +% problem, but perhaps we have to come up with a more elaborate +% solution in the end. +% \begin{macrocode} + \UseSocket{tagsupport/fntext/mark}% + {\llap{% + \ifdim\footnotemargin>\z@ + \hb@xt@\footnotemargin{\@makefnmark\hss}% + \else + \@makefnmark + \fi + }}% \parskip\hangfootparskip\relax \parindent\hangfootparindent\relax \footnotelayout#1% \par \egroup } +% \end{macrocode} +% Defined in a roundabout way so that we can test for it when +% patching classes that are not updated. +% \begin{macrocode} + \let \@makefntext \footmisc@hang@makefntext \else @@ -2723,9 +2784,8 @@ \@footnotemark } % \end{macrocode} -% TEMP PATCHES FOR TESTING +% % \begin{macrocode} - \endinput %</footmisc> % \end{macrocode} |