9e6b9cdc5f
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.
554 B
554 B
% pandoc -f markdown+latex_macros -t markdown
\newcommand{\my}{\phi}
$\my+\my$
^D
\newcommand{\my}{\phi}
$\phi+\phi$
% pandoc -f markdown-latex_macros -t markdown
\newcommand{\my}{\phi}
$\my+\my$
^D
\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}