aboutsummaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-08-11 10:32:52 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-08-11 10:32:52 -0700
commita0e44b1ff651ba59fe23b9e1b5d534d324dc0808 (patch)
treeb7847ac514fcacc088e1d7a0f3097436e5b93374 /test/command
parent06d97131e530d2ee9b14617290a157dd42c0db30 (diff)
downloadpandoc-a0e44b1ff651ba59fe23b9e1b5d534d324dc0808.tar.gz
LaTeX reader: improve handling of plain TeX macro primitives.
- Fixed semantics for `\let`. - Implement `\edef`, `\gdef`, and `\xdef`. - Add comment noting that currently `\def` and `\edef` set global macros (so are equivalent to `\gdef` and `\xdef`). This should be fixed by scoping macro definitions to groups, in a future commit. Closes #7474.
Diffstat (limited to 'test/command')
-rw-r--r--test/command/macros.md38
1 files changed, 37 insertions, 1 deletions
diff --git a/test/command/macros.md b/test/command/macros.md
index e3c07e661..9f7a0f9d3 100644
--- a/test/command/macros.md
+++ b/test/command/macros.md
@@ -25,7 +25,7 @@ expanded at point of use:
```
% pandoc -f latex -t latex
\let\a\b
-\newcommand{\b}{\emph{ouk}}
+\def\b{\emph{ouk}}
\a a
^D
@@ -123,3 +123,39 @@ hello+hello
hello+goodbye
```
+```
+% pandoc -f latex -t plain
+\def\txt{a}
+\def\foo{\txt}
+\let\bar\foo
+\bar % -> a
+\def\txt{b}
+\bar % -> b
+\def\foo{OH}
+\bar % -> b
+^D
+a b b
+```
+
+```
+% pandoc -f latex -t plain
+\def\aaa{aaa}
+\def\bbb{x\aaa}
+\edef\ccc{y\aaa}
+\def\aaa{AAA}
+\bbb \ccc
+^D
+xAAAyaaa
+```
+
+```
+% pandoc -f latex -t plain
+\gdef\aaa{aaa}
+\gdef\bbb{x\aaa}
+\xdef\ccc{y\aaa}
+\gdef\aaa{AAA}
+\bbb \ccc
+^D
+xAAAyaaa
+```
+