Commit f8edf20
committed
escape the TeX rendering of a single underscore as a variable name
A single underscore is a valid variable name.
If the student enters an answer like `a_(b)` and "single-letter variable names" is turned on, it's interpreted as `a * _ * b`.
The underscore wasn't escaped when rendered in LaTeX, so the whole expression would be `a_b`, which looks like it's been interpreted correctly.
This changes `getNameInfo` so a variable name starting with an underscore always counts as `isLong` and is rendered in LaTeX with `\texttt` and the underscores are escaped.1 parent 218e554 commit f8edf20
File tree
4 files changed
+6
-4
lines changed- runtime/scripts
- tests
- jme
4 files changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3617 | 3617 | | |
3618 | 3618 | | |
3619 | 3619 | | |
3620 | | - | |
| 3620 | + | |
3621 | 3621 | | |
3622 | 3622 | | |
3623 | 3623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12440 | 12440 | | |
12441 | 12441 | | |
12442 | 12442 | | |
12443 | | - | |
| 12443 | + | |
12444 | 12444 | | |
12445 | 12445 | | |
12446 | 12446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2321 | 2321 | | |
2322 | 2322 | | |
2323 | 2323 | | |
2324 | | - | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
2325 | 2327 | | |
2326 | 2328 | | |
2327 | 2329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11776 | 11776 | | |
11777 | 11777 | | |
11778 | 11778 | | |
11779 | | - | |
| 11779 | + | |
11780 | 11780 | | |
11781 | 11781 | | |
11782 | 11782 | | |
| |||
0 commit comments