Skip to content

Commit

Permalink
Fix TeX output for formulas when MathQuill is used
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Dec 1, 2024
1 parent 1014a1c commit 6dcc4c3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions macros/contexts/contextUnits.pl
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ sub addUnit {
$constants->add(
$name => {
value => context::Units::Unit->new($name => $unit),
TeX => "\\text{$name}",
isUnit => 1,
isConstant => 1
}
Expand Down Expand Up @@ -1817,6 +1818,14 @@ sub string {
return &{ $self->super("string") }($self, @_);
}

#
# Call the super TeX method (so fractions are properly handled, for example)
#
sub TeX {
my $self = shift;
return &{ $self->super("TeX") }($self, @_);
}

#############################################################

package context::Units::BOP::add;
Expand Down

0 comments on commit 6dcc4c3

Please sign in to comment.