Skip to content

Commit

Permalink
Latex lab/tagging #12, #58 and by now #62 (#1291)
Browse files Browse the repository at this point in the history
* support for hang option of footmisc

* typo and missing test update (probably more to show up)

* updating more tests

* update date/version and changes.txt

* attempt to patch a few more styles/classes (that contain \makebox rather than \hb@xt@)

* mumble

* tag note label if hang option is used (this is missing a test!)

* try again with tagging temp disabled
  • Loading branch information
FrankMittelbach committed Mar 12, 2024
1 parent fef972e commit 8c3d97a
Show file tree
Hide file tree
Showing 53 changed files with 357 additions and 1,407 deletions.
72 changes: 44 additions & 28 deletions required/latex-lab/changes.txt
@@ -1,71 +1,87 @@
2024-02-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-03-11 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* latex-lab-footnotes.dtx (subsection{Debugging sockets and hooks}):
Added \DebugFNotesOn (and \DebugFNotesOff) not doing much for
now. Default is now to have debugging turned off (gh/58).

(subsubsection{Making documents use the new \cs{@makefntext}}):
Before attempting to patch old classes or packages check if the new
definition of \@makefntext is the one that was suppliedd by footmisc for
the hang option. (gh/12)

(subsubsection{Making documents use the new \cs{@makefntext}}):
Some classes/styles use \makebox rather than \hb@xt@, so try to patch
them too. Of course, none of this is very robust. By the end of the
day well need updating to the new standard solution.

2024-02-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx: left align description labels.

2024-02-07 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-07 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: change value layout to presentation (as in ARIA).

2024-02-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: add keys to suppress AF-files locally

2024-02-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-09 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-title.dtx: force DisplayDocTitle if UA-standard is detected

2024-02-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-testphase.dtx: add marginpar tagging to phase-III

2024-02-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx, latex-lab-table.dtx: adapt tagpdfsetup keys

2024-02-07 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-07 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: change key names from table-tagging to table/tagging

2024-02-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-float.dtx: fix caption outside float error

2024-02-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-02-05 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-toc-kernel-changes.dtx: fix spurious space, tagging-project#50

2024-01-29 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-29 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx: disable mathgrabbing in begindocument hook.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-firstaid.dtx: add support for \authors from amsart.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-title.dtx: make \@title and \@author robust to avoid errors
if they are not set.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: add support for layout tables.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx: add support to set an attribute-class for para-main.

2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: add option table-tagging=layout

2024-01-17 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx, latex-lab-amsmath.dtx, redefine \text to
2024-01-17 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-math.dtx, latex-lab-amsmath.dtx, redefine \text to
avoid faulty structure and faulty PDF from \mathchoice.
Add statistic for mathml handling.

2024-01-14 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-14 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-float.dtx, correct destination, see tagging issue #55

2024-01-14 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx, correct error message for environments,
2024-01-14 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx, correct error message for environments,
see tagging issue #57

2024-01-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-table.dtx: add some variables for tag names

2024-01-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2024-01-08 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* move mathml-AF support into latex-lab-math.ltx

2023-12-27 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2023-12-27 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* added latex-lab-title.dtx for maketitle/title and author tagging.

2023-11-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
2023-11-18 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-block.dtx, correct error message for items outside lists
see tagging issue #35

Expand All @@ -84,14 +100,14 @@
* latex-lab-table.dtx: use cmd hook for array, see tagging issue #28

2023-10-30 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* added latex-lab-table.dtx for basic table tagging.
* added latex-lab-table.dtx for basic table tagging.

2023-10-21 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-minipage.dtx: use sockets to allow local changes

2023-10-13 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-toc.dtx, latex-lab-sec.dtx, latex-lab-toc-kernel-changes: extend
\MakeLinkTarget to store the target-structure relationship too, see tagging issue #20
* latex-lab-toc.dtx, latex-lab-sec.dtx, latex-lab-toc-kernel-changes: extend
\MakeLinkTarget to store the target-structure relationship too, see tagging issue #20

2023-10-13 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* latex-lab-graphic.dtx: fix handling of scale factor, tagging issue #16
Expand All @@ -106,7 +122,7 @@
2023-09-04 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* label-lab-new-or-1.dtx latex-lab-new-or-2.dtx
fix position of kernel hook in \@makecol (tagpdf issue #58)

2023-09-04 Ulrike Fischer <Ulrike.Fischer@latex-project.org>
* documentmetadata-support.dtx: add debug key to load tagpdf-debug.
* new latex-lab-namespace.dtx with role mappings
Expand Down
84 changes: 69 additions & 15 deletions required/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
Expand All @@ -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}
Expand Down Expand Up @@ -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}
%
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -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: }
}
}

Expand Down Expand Up @@ -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}%
Expand All @@ -2437,14 +2479,27 @@
\parshape \@ne \leftmargin \linewidth
\footnotesize
\@setpar{{\@@par}}%
\ResumeTagging{footmisc}%
\leavevmode
\llap{\box\@tempboxa}%
\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

Expand Down Expand Up @@ -2723,9 +2778,8 @@
\@footnotemark
}
% \end{macrocode}
% TEMP PATCHES FOR TESTING
%
% \begin{macrocode}

\endinput
%</footmisc>
% \end{macrocode}
Expand Down

0 comments on commit 8c3d97a

Please sign in to comment.