Commit 4a99a83
Fix spacing in
Previously, in a mathtext string like `r"$\sin x$"`, a thin space would
(correctly) be added between "sin" and "x", but that space would be
missing in expressions like `r"$\max f$"`. The difference arose because
of the slightly different handling of subscripts and superscripts
after the `\sin` and `\max` operators: `\sin^n` puts the superscript as
a normal exponent, but `\max_x` puts the subscript centered below the
operator name ("overunder symbol). The previous code for inserting the
thin space did not handle the "overunder" case; fix that. The new
behavior is tested by the change in test_operator_space, as well as by
mathtext1_dejavusans_06.
The change in mathtext_foo_29 arises because the extra thin space now
inserted after `\limsup` slightly shifts the centering of the whole
string. Ideally that thin space should be suppressed if there's no
token after the operator, but that's not something currently implemented
either for e.g. `\sin` (compare e.g. the right-alignments in
`text(.5, .9, r"$\sin$", ha="right"); text(.5, .8, r"$\mathrm{sin}$", ha="right"); axvline(.5)`
where the extra thin space after `\sin` is visible), so this patch just
makes things more consistent.r"$\max f$".1 parent 707f384 commit 4a99a83
2 files changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2362 | 2362 | | |
2363 | 2363 | | |
2364 | 2364 | | |
2365 | | - | |
2366 | | - | |
| 2365 | + | |
2367 | 2366 | | |
2368 | 2367 | | |
2369 | 2368 | | |
| |||
2483 | 2482 | | |
2484 | 2483 | | |
2485 | 2484 | | |
2486 | | - | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
2487 | 2491 | | |
2488 | 2492 | | |
2489 | 2493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| |||
0 commit comments