Skip to content

Commit

Permalink
fix for tagging-project issue 262 (#1419)
Browse files Browse the repository at this point in the history
* handle issue latex3/tagging-project#262

* correct environment

* typos from review
  • Loading branch information
u-fischer authored Jul 31, 2024
1 parent ac518aa commit 11f2110
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 5 deletions.
4 changes: 4 additions & 0 deletions base/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================

2024-07-27 Ulrike Fischer <[email protected]>
* lttagging.dtx: (subsection{Paragraph sockets}): A socket and plug to restore paragraph
setting added.

2024-07-13 Ulrike Fischer <[email protected]>
* lttagging.dtx: (subsection{Tagging sockets}): toc-related tagging sockets added.

Expand Down
31 changes: 29 additions & 2 deletions base/lttagging.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
%<*driver>
% \fi
\ProvidesFile{lttagging.dtx}
[2024/07/14 v1.0d LaTeX Kernel (tagging support)]
[2024/07/27 v1.0e LaTeX Kernel (tagging support)]
% \iffalse
\documentclass{l3doc}
\GetFileInfo{lttagging.dtx}
Expand Down Expand Up @@ -214,7 +214,6 @@
}
\ERRORusetaggingsocket % that should get a proper error message
}
\ExplSyntaxOff
% \end{macrocode}
%
% \end{macro}
Expand All @@ -223,6 +222,34 @@
% This collects tagging sockets that should be generally available
% so that they can also be used even if the tagging code is not loaded.
%
% \subsubsection{Tagging support for paragraph setup}
%
% Paragraphs are tagged through the code in the para/hooks. This code is sometimes
% adjusted, e.g. to produce a \enquote{flattened} paragraph or to use a different tag.
% Sockets related to such code parts are collected here.
%
% \begin{socketdecl}{tagsupport/para/restore}
% This socket restores the para related settings to their default. It
% should be used in places where ``normal'' paragraph tagging must be ensured, for example
% at the begin of a footnote.
% \begin{macrocode}
\NewSocket{tagsupport/para/restore}{0}
% \end{macrocode}
% \end{socketdecl}
%
% \begin{plugdecl}{default}
% \begin{macrocode}
\NewSocketPlug{tagsupport/para/restore}{default}
{
\tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
\tl_set_eq:NN \l__tag_para_tag_tl\l__tag_para_tag_default_tl
\bool_set_false:N\l__tag_para_flattened_bool
}
\AssignSocketPlug{tagsupport/para/restore}{default}
\ExplSyntaxOff
% \end{macrocode}
% \end{plugdecl}

% \subsubsection{Tagging sockets for toc}

% \begin{socketdecl}{tagsupport/toc/contentsline/before,
Expand Down
4 changes: 4 additions & 0 deletions required/latex-lab/changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-07-11 Ulrike Fischer <[email protected]>
* latex-lab-footnote.dtx: restore paragraph defaults at the begin of the footnote
tagging-project#262

2024-07-13 Frank Mittelbach <[email protected]>

* latex-lab-table.dtx (subsection{Tagging support sockets}):
Expand Down
20 changes: 18 additions & 2 deletions required/latex-lab/latex-lab-footnotes.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
%
% for those people who are interested or want to report an issue.
%
\def\ltlabfootnotedate{2024-07-05}
\def\ltlabfootnoteversion{0.8d}
\def\ltlabfootnotedate{2024-07-27}
\def\ltlabfootnoteversion{0.8e}

%<*driver>
\documentclass{l3doc}
Expand Down Expand Up @@ -1150,6 +1150,21 @@
%
%
% \begin{macro}{\fnote_footnotetext:n}
% We temporarily test for the tagging socket until it is in the next release:
% \begin{macrocode}
\str_if_exist:cF { l__socket_tagsupport/para/restore_plug_str }
{
\NewSocket{tagsupport/para/restore}{0}
\NewSocketPlug{tagsupport/para/restore}{default}
{
\tl_set:Nn \l__tag_para_main_tag_tl {text-unit}
\tl_set_eq:NN \l__tag_para_tag_tl\l__tag_para_tag_default_tl
\bool_set_false:N\l__tag_para_flattened_bool
}
\AssignSocketPlug{tagsupport/para/restore}{default}
}
% \end{macrocode}
%
% \begin{macrocode}
\cs_new_protected:Npn \fnote_footnotetext:n #1 {
\@@_debug_footnotetext:
Expand Down Expand Up @@ -1191,6 +1206,7 @@
\floatingpenalty \@MM
\hsize\columnwidth
\@parboxrestore
\UseTaggingSocket{para/restore}
\parindent 1em % typical default used in \@makefntext moved up here
\def\@currentcounter{footnote}
\protected@edef \@currentlabel { \p@footnote \@thefnmark }
Expand Down
2 changes: 1 addition & 1 deletion required/latex-lab/testfiles-OR/footmisc-007-rollback.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ l. ...\makeatletter\show\@footnotemark
\makeatother
Patched @footnotetext
> \@footnotetext=\protected\long macro:
#1->\__fnote_debug_footnotetext: \hook_use:n {fntext/before}\socket_use:n {tagsupport/fntext/begin}\socket_use:nn {fntext/process}{\hook_use:n {fntext}\reset@font \footnotesize \interlinepenalty \interfootnotelinepenalty \splittopskip \footnotesep \splitmaxdepth \dp \strutbox \floatingpenalty \@MM \hsize \columnwidth \@parboxrestore \parindent 1em\def \@currentcounter {footnote}\protected@edef \@currentlabel {\p@footnote \@thefnmark }\hook_use:n {fntext/para}\color@begingroup \socket_use:nn {fntext/make}{\socket_use:n {fntext/begin}\hook_use:n {fntext/begin}\ignorespaces #1\hook_use:n {fntext/end}\socket_use:n {fntext/end}}\par \color@endgroup }\socket_use:n {tagsupport/fntext/end}\hook_use:n {fntext/after}.
#1->\__fnote_debug_footnotetext: \hook_use:n {fntext/before}\socket_use:n {tagsupport/fntext/begin}\socket_use:nn {fntext/process}{\hook_use:n {fntext}\reset@font \footnotesize \interlinepenalty \interfootnotelinepenalty \splittopskip \footnotesep \splitmaxdepth \dp \strutbox \floatingpenalty \@MM \hsize \columnwidth \@parboxrestore \UseTaggingSocket {para/restore}\parindent 1em\def \@currentcounter {footnote}\protected@edef \@currentlabel {\p@footnote \@thefnmark }\hook_use:n {fntext/para}\color@begingroup \socket_use:nn {fntext/make}{\socket_use:n {fntext/begin}\hook_use:n {fntext/begin}\ignorespaces #1\hook_use:n {fntext/end}\socket_use:n {fntext/end}}\par \color@endgroup }\socket_use:n {tagsupport/fntext/end}\hook_use:n {fntext/after}.
l. ...\makeatletter\show\@footnotetext
\makeatother
-> The hook 'fnmark/before':
Expand Down
18 changes: 18 additions & 0 deletions required/latex-lab/testfiles-OR/footnote-heading.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
% from gh https://github.com/latex3/tagging-project/issues/262
\ExplSyntaxOn
\debug_on:n { check-declarations , deprecation }
\ExplSyntaxOff
\input{regression-test}
\DocumentMetadata{
pdfstandard=A-4f,
pdfversion=2.0,
lang=en-US,
testphase={phase-III},
}
\documentclass{article}

\begin{document}
\START
\section{First topic\footnote{This section closely follows Newton (1687).}}

\end{document}
25 changes: 25 additions & 0 deletions required/latex-lab/testfiles-OR/footnote-heading.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
This is a generated file for the l3build validation system.
Don't change this file in any respect.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <14.4> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line ....
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line ....
[1
] (footnote-heading.aux)
Package tagpdf Info: Finalizing the tagging structure:
(tagpdf) Writing out ~13 structure objects
(tagpdf) with ~12 'MC' leaf nodes.
(tagpdf) Be patient if there are lots of objects!
Package tagpdf Info: writing ParentTree
Package tagpdf Info: writing IDTree
Package tagpdf Info: writing RoleMap
Package tagpdf Info: writing ClassMap
Package tagpdf Info: writing NameSpaces
Package tagpdf Info: writing StructElems
Package tagpdf Info: writing Root

0 comments on commit 11f2110

Please sign in to comment.