Skip to content

Commit

Permalink
DefMath can coerce more symbols to simpler primitives (rather than co…
Browse files Browse the repository at this point in the history
…nstructors)
  • Loading branch information
brucemiller committed May 28, 2024
1 parent 04bd256 commit 105cc78
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/LaTeXML/Package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,8 @@ my $math_options = { # [CONSTANT]
revert_as => 1,
hide_content_reversion => 1 }; # DEPRECATE!
my $simpletoken_options = { # [CONSTANT]
name => 1, meaning => 1, omcd => 1, role => 1, mathstyle => 1,
protected => 1, robust => 1,
name => 1, meaning => 1, omcd => 1, role => 1, mathstyle => 1, stretchy => 1,
protected => 1, robust => 1, alias => 1,
lpadding => 1, rpadding => 1,
font => 1, scriptpos => 1, scope => 1, locked => 1 };

Expand Down Expand Up @@ -1746,13 +1746,16 @@ sub defmath_prim {
my %properties = %options;
my $font = LookupValue('font')->merge(%$reqfont)->specialize($string);
my $mode = (LookupValue('IN_MATH') ? 'math' : 'text');
my $alias = (ref $options{alias} ? $options{alias}
: (defined $options{alias} ? T_CS($options{alias}) : undef));
my $reversion =
((!defined $options{reversion}) && (($options{revert_as} || '') eq 'presentation')
? $presentation : $alias // $cs);
foreach my $key (keys %properties) {
my $value = $properties{$key};
if (ref $value eq 'CODE') {
$properties{$key} = &$value(); } }
LaTeXML::Core::Box->new($string, $font, $locator,
((!defined $options{reversion}) && (($options{revert_as} || '') eq 'presentation')
? $presentation : $cs),
LaTeXML::Core::Box->new($string, $font, $locator, $reversion,
mode => $mode, %properties); }));
return; }

Expand Down

0 comments on commit 105cc78

Please sign in to comment.