Open mbertucci47 opened 6 days ago
I think the space parameters are ignored because they are used to set \@topsep
and \@topsepadd
which the firstaid code doesn't use because the theorem is no longer implemented as a trivlist (please correct me if I'm wrong).
that sounds like a very likely cause (not being able to look right now)
And I think the head punctuation is ignored because \the\thm@headpunct
was moved into \thmhead@plain
but is not accounted for with other \thmhead
s.
@FrankMittelbach handling the topspace is rather easy, I simply need to pass the value to the instance call. But I'm not sure what to do about the space below. end-skip
seems to do nothing:
\DocumentMetadata
{
lang=en-US,
pdfversion=2.0,
pdfstandard=ua-2,
testphase={phase-III,math,table,title,firstaid}
}
\documentclass{article}
\begin{document}
xxxxx
\begin{enumerate}[end-skip=50pt]
\item blub
\end{enumerate}
xxxxx
\end{document}
The firstaid code defines \thmname
etc. to tag their contents but does not wrap it in a Caption
struct if \thmhead
is not \thmhead@plain
, since \tag_struct_begin:n{tag=Caption}
is set in \thmhead@plain
but not otherwise.
So that chunk of code could instead be
\def\@begintheorem##1##2[##3]{%
\UseInstance{blockenv}{theorem}{}
\tagpdfparaOff
\mode_leave_vertical:
\MakeLinkTarget{\l__block_thm_current_counter_tl}
\group_begin:
\normalfont
\the\thm@headfont \thm@indent
\@ifempty{##1}
{\let\thmname\@gobble}
{\def\thmname####1{\tag_mc_begin:n {}####1\tag_mc_end:}}%
\@ifempty{##2}
{\let\thmnumber\@gobble}
{\def\thmnumber####1
{\tag_struct_begin:n{tag=Lbl}\tag_mc_begin:n {}
####1
\tag_mc_end:\tag_struct_end:}}%
\@ifempty{##3}
{\let\thmnote\@gobble}
{\def\thmnote####1{\tag_mc_begin:n{}####1\tag_mc_end:}}%
\tag_struct_begin:n{tag=Caption}
\thm@swap\swappedhead\thmhead{##1}{##2}{##3}%
\tag_mc_begin:n{}\the\thm@headpunct\tag_mc_end:
\tag_struct_end:
\thmheadnl % possibly a newline.
\hskip\thm@headsep
\group_end:
\tagpdfparaOn
\UseTaggingSocket{para/begin} %
\ignorespaces}
\def\thmhead@plain##1##2##3{%
\thmname{##1}
\thmnumber{
\@ifnotempty{##1}{~}\@upn{##2}
}%
\thmnote{\pdffakespace\space{\the\thm@notefont(##3)}}
}
\let\thmhead\thmhead@plain
\def\swappedhead##1##2##3{%
\thmnumber{##2}
\thmname{\@ifnotempty{##2}{\nobreakspace}##1}
\thmnote{\pdffakespace\space{\the\thm@notefont(##3)}}
}
where \tag_struct_begin:n{tag=Caption}
and \tag_struct_end:
are moved inside \@begintheorem
, out of \thmhead@plain
and \swappedhead
, and the same for \tag_mc_begin:n{}\the\thm@headpunct\tag_mc_end:
.
The amsthm firstaid seems to work well. I tested the amsthm file thmtest.tex and found only two issues. It seems the "space above" and "space below" parameters of
\newtheoremstyle
are not respected at all. Also, if a custom head spec is given in\newtheoremstyle
, then the head punctuation is ignored and parent-child warnings are produced. Here's an example.As you can see, the
20pt
space above is ignored, and there is no period after the theorem head.