git.iko.soy/typeable/pandoc
on 2.0 help sign in
68 lines 850 B history raw
1```
2% pandoc -f markdown+latex_macros -t markdown
3\newcommand{\my}{\phi}
4$\my+\my$
5^D
6\newcommand{\my}{\phi}
7$\phi+\phi$
8```
10```
11% pandoc -f markdown-latex_macros -t markdown
12\newcommand{\my}{\phi}
13$\my+\my$
14^D
15\newcommand{\my}{\phi}
16$\my+\my$
17```
19`\let` macros should be expanded at point of
20definition, while `\newcommand` macros should be
21expanded at point of use:
23```
24% pandoc -f latex -t latex
25\let\a\b
26\newcommand{\b}{\emph{ouk}}
27\a
28^D
29\b
30```
32```
33% pandoc -f latex -t latex
34\newcommand{\a}{\b}
35\newcommand{\b}{\emph{ouk}}
36\a
37^D
38\emph{ouk}
39```
41```
42% pandoc -f latex -t latex
43\def\BDpos{}
44\def\BDneg{-}
45\def\beq{\begin{align}}
46\def\eeq{\end{align}}
47\def\e#1{\emph{#1}}
48\def\f#1#2{\emph{#1--#2}}
50$5\BDneg 6\BDpos 7$
52\beq
53x &= y\\
54\eeq
56\e{hi}
58\f{hi}{ok}
59^D
60\(5-67\)
62\[\begin{aligned}
63x &= y\\\end{aligned}\]
65\emph{hi}
67\emph{hi--ok}
68```