git.iko.soy/typeable/pandoc
on ab792fa help sign in
125 lines 1.7 kB history raw
1```
2% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute
3\newcommand{\my}{\phi}
4$\my+\my$
5^D
6\newcommand{\my}{\phi}
8$\phi+\phi$
9```
11```
12% pandoc -f markdown-latex_macros -t markdown+raw_tex-raw_attribute
13\newcommand{\my}{\phi}
14$\my+\my$
15^D
16\newcommand{\my}{\phi}
18$\my+\my$
19```
21`\let` macros should be expanded at point of
22definition, while `\newcommand` macros should be
23expanded at point of use:
25```
26% pandoc -f latex -t latex
27\let\a\b
28\newcommand{\b}{\emph{ouk}}
29\a a
30^D
31a̱
32```
34```
35% pandoc -f latex -t latex
36\newcommand{\a}{\b}
37\newcommand{\b}{\emph{ouk}}
38\a a
39^D
40\emph{ouk}a
41```
43```
44% pandoc -f latex -t latex
45\def\BDpos{}
46\def\BDneg{-}
47\def\beq{\begin{align}}
48\def\eeq{\end{align}}
49\def\e#1{\emph{#1}}
50\def\f#1#2{\emph{#1--#2}}
52$5\BDneg 6\BDpos 7$
54\beq
55x &= y\\
56\eeq
58\e{hi}
60\f{hi}{ok}
61^D
62\(5-67\)
64\[\begin{aligned}
65x &= y\\\end{aligned}\]
67\emph{hi}
69\emph{hi--ok}
70```
72```
73% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute
74\newcommand{\my}{\phi}
75\begin{equation}
76\my+\my
77\end{equation}
78^D
79\newcommand{\my}{\phi}
81\begin{equation}
82\phi+\phi
83\end{equation}
84```
86```
87% pandoc -f markdown-latex_macros -t markdown+raw_tex-raw_attribute
88\newcommand{\my}{\phi}
89\begin{equation}
90\my+\my
91\end{equation}
92^D
93\newcommand{\my}{\phi}
95\begin{equation}
96\my+\my
97\end{equation}
98```
100```
101% pandoc -f markdown+latex_macros -t markdown+raw_tex-raw_attribute
102\newcommand{\my}{\emph{a}}
103\my
104^D
105\newcommand{\my}{\emph{a}}
106\emph{a}
107```
109<https://tex.stackexchange.com/questions/258/what-is-the-difference-between-let-and-def>
111```
112% pandoc -f latex -t plain
113\def\bar{hello}
114\let\fooi\bar
115\def\fooii{\bar}
116\fooi +\fooii
118\def\bar{goodbye}
119\fooi +\fooii
120^D
121hello+hello
123hello+goodbye
124```