summaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-07 13:38:15 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-07 13:38:15 -0700
commit9e6b9cdc5face62842cfee6a0eacefed82973239 (patch)
tree25acbc2e7952c995c35a8cbbd2258e8001ed8d56 /test/command
parent3504915e63c68c3a4e91b8dcccb90c93435cf212 (diff)
LaTeX reader: Support `\let`.
Also, fix regular macros so they're expanded at the point of use, and NOT also the point of definition. `\let` macros, by contrast, are expanded at the point of definition. Added an `ExpansionPoint` field to `Macro` to track this difference.
Diffstat (limited to 'test/command')
-rw-r--r--test/command/macros.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/command/macros.md b/test/command/macros.md
index 055c86d25..49a648c79 100644
--- a/test/command/macros.md
+++ b/test/command/macros.md
@@ -15,3 +15,26 @@ $\my+\my$
\newcommand{\my}{\phi}
$\my+\my$
```
+
+`\let` macros should be expanded at point of
+definition, while `\newcommand` macros should be
+expanded at point of use:
+
+```
+% pandoc -f latex -t latex
+\let\a\b
+\newcommand{\b}{\emph{ouk}}
+\a
+^D
+\b
+```
+
+```
+% pandoc -f latex -t latex
+\newcommand{\a}{\b}
+\newcommand{\b}{\emph{ouk}}
+\a
+^D
+\emph{ouk}
+```
+