-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
braces around math #1086
Comments
I am not able to reproduce this. For me on the current |
OK, it's more complicated than I thought. I get braces with the combination of MathObjects and PGML.
|
OK, thanks for the wider context. The braces are coming from this line: Line 892 in 2bd3ca3
It has been some decades since I wrote it, but I suspect the idea was to allow things like $a = Real(123);
BEGIN_PGML
[`x^[$a]`]
END_PGML to work without knowing whether $a = Real(123);
BEGIN_PGML
[`x^{[$a]}`]
END_PGML to make sure you handle both cases, in the situation where $a = Formula("pi+1");
$f = Formula("x^$a"); which is why MathObjects stringify using parentheses in these situations. You could probably remove the braces in the TeX output, but it might break existing problems that use these constructions. On the other hand, if you want to avoid the braces, you could do $x = Formula('x';
BEGIN_PGML
[`[$x->TeX]`]
END_PGML or $x = Formula('x';
BEGIN_PGML
[`[@ $x->TeX @]`]
END_PGML to get the un-braced version in the cases where you want to allow line breaking for in-line math expressions. |
This is not really a PG "issue". But I am having an issue with PTX that and LaTeX that stems from something MathObjects does, so I will post here.
If you have like
$f = Formula('x');
, then$f->TeX
is{x}
with those surrounding braces. Why are those there? And where are they added? (I looked around inValue
but could not pinpoint them.)I am wondering if it would be safe to make those go away. This has to do with https://tex.stackexchange.com/questions/722329/unwanted-space-in-tcbraster. If a math expression ends up being wider than a
tcolorbox
that contains it, and the math expression has these braces, my best understanding is that the math expression is not line-breakable and that leads to the issue described there.Perhaps this is a webwork2 issue though too (in rare situations) since several hardcopy themes use
tcolorbox
.The text was updated successfully, but these errors were encountered: