From 9e6b9cdc5face62842cfee6a0eacefed82973239 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 7 Aug 2017 13:38:15 -0700 Subject: 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. --- test/command/macros.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/command') 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} +``` + -- cgit v1.2.3