docs: Fix \bar documentation by avoiding global redefinition (#3804)

* `\bar` examples weren't rendering correctly because of `\gdef\bar`
  example when illustrating `\gdef` and `\xdef`.
* Improve `\bar` name to `\sqr` when defining squaring
  (not necessary for fix, but improved naming).
* Fix `\def` scoping test that originally seemed related.

Fixes #3803
This commit is contained in:
Erik Demaine
2023-04-11 11:29:06 -04:00
committed by GitHub
parent 01488c6d3c
commit 92ac286a3a
3 changed files with 6 additions and 6 deletions

View File

@@ -3471,7 +3471,7 @@ describe("A macro expander", function() {
it("\\def changes settings.macros with globalGroup", () => {
const macros = {};
expect`\gdef\foo{1}`.toParse(new Settings({macros, globalGroup: true}));
expect`\def\foo{1}`.toParse(new Settings({macros, globalGroup: true}));
expect(macros["\\foo"]).toBeTruthy();
});