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

@@ -332,7 +332,7 @@ Direct Input: $∀ ∴ ∁ ∵ ∃ ∈ ∉ ∋ ⊂ ⊃ ∧ ↦ → ←
|||
|:-------------------------------------|:------
|$\def\foo{x^2} \foo + \foo$ | `\def\foo{x^2} \foo + \foo`
|$\gdef\bar#1{#1^2} \bar{y} + \bar{y}$ | `\gdef\bar#1{#1^2} \bar{y} + \bar{y}`
|$\gdef\foo#1{#1^2} \foo{y} + \foo{y}$ | `\gdef\foo#1{#1^2} \foo{y} + \foo{y}`
| | `\edef\macroname#1#2…{definition to be expanded}`
| | `\xdef\macroname#1#2…{definition to be expanded}`
| | `\let\foo=\bar`