Skip to content

Commit

Permalink
amsthm.sty.ltxml: ignore \thmnote, \thmnumber, \thmnote if the respec…
Browse files Browse the repository at this point in the history
…tive arguments are empty (#2227)
  • Loading branch information
xworld21 authored Oct 8, 2023
1 parent 41bad55 commit 03e56ef
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/LaTeXML/Package/amsthm.sty.ltxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ use warnings;
use LaTeXML::Package;

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Let('\@xp', '\expandafter');
Let('\@nx', '\noexpand');
RequirePackage('amsgen');

# Core is defined in LaTeX.ltxml

Expand Down Expand Up @@ -77,7 +76,13 @@ DefPrimitive('\newtheoremstyle{}{}{}{}{}{}{}{}{}', sub {
my $headformatter;
if (!IsEmpty($headspec)) { # If spec given, create formatter macro
$headformatter = T_CS('\format@title@theoremstyle@' . ToString($name));
DefMacroI($headformatter, convertLaTeXArgs(3, 0), $headspec); }
DefMacroI($headformatter, convertLaTeXArgs(3, 0),
# amsthm.sty uses the code below to ignore \thmname, \thmnumber, \thmnote
# if the respective arguments are empty
Tokens(TokenizeInternal('\@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}' .
'\@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}' .
'\@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}'),
$headspec)); }

$name = ToString($name);
saveTheoremStyle($name,
Expand Down

0 comments on commit 03e56ef

Please sign in to comment.