Skip to content

Commit

Permalink
Merge pull request #1141 from somiaj/set-inequality-tex
Browse files Browse the repository at this point in the history
Fix issue with variable TeX output with var = value inequality.
  • Loading branch information
Alex-Jordan authored Nov 29, 2024
2 parents a12274b + f3f6e0d commit 238144f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions macros/contexts/contextInequalities.pl
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,8 @@ package Inequalities::Set;
sub string {
my $self = shift;
my $equation = shift;
my $x = $self->{varName} || ($self->context->variables->names)[0];
my $context = $self->context;
my $x = $self->{varName} || ($context->variables->names)[0];
$x = $context->{variables}{$x}{string} if defined $context->{variables}{$x}{string};
my @coords = ();
foreach my $a (@{ $self->data }) {
Expand All @@ -908,7 +909,8 @@ sub string {
sub TeX {
my $self = shift;
my $equation = shift;
my $x = $self->{varName} || ($self->context->variables->names)[0];
my $context = $self->context;
my $x = $self->{varName} || ($context->variables->names)[0];
$x = $context->{variables}{$x}{TeX} if defined $context->{variables}{$x}{TeX};
$x =~ s/^([^_]+)_?(\d+)$/$1_{$2}/;
my @coords = ();
Expand Down

0 comments on commit 238144f

Please sign in to comment.