16.1 LaTeX

ltthm.dtx

In latex.cls \@thm is defined with two arguments, and in amsthm.sty with three parameters. In both cases we have a \@currentlabel defined through a refstepcounter, and the latter command introducing its own identity, instead of that of the theorem, into the xref file (and then the href fields of the html tags). The following code corrects that behavior.

<..latex ltthm..>
 \def\:thm{\o:@thm:}
 \def\:temp{<.seed begin theorem.>\:thm}
 \HLet\@thm=\:temp
 \let\o:@endtheorem:=\@endtheorem
 \append:def\@endtheorem{\c:newtheorem}
 \NewConfigure{newtheorem}{3}
 -_-_-

<..seed begin theorem..>
 \let\sv:item=\item
 \def\item[##1]{<.no page break before item.>\let\item=\sv:item
                \item[##1]\b:newtheorem}%
 \a:newtheorem\AutoRefstepAnchor
 -_-_-

A page break before an item might have a different behavor than a regular start of a paragraph at an item. Hence, the following code.

<..no page break before item..>
 \nobreak
 -_-_-