1 #LyX 1.6svn created this file. For more info see http://www.lyx.org/
10 \font_typewriter default
11 \font_default_family default
17 \paperfontsize default
25 \paperorientation portrait
28 \paragraph_separation indent
30 \quotes_language english
33 \paperpagestyle default
34 \tracking_changes false
46 \begin_layout Enumerate
47 Simple macro definitions with position awareness:
48 \begin_inset FormulaMacro
53 \begin_inset Formula \[
54 \bla\mbox{ should look like }42\]
59 \begin_inset FormulaMacro
60 \renewcommand{\bla}{21}
64 \begin_inset Formula \[
65 \bla\mbox{ should look like }21.\]
72 \begin_layout Enumerate
73 Redefinitions of macros appearing in the definition of another macro:
74 \begin_inset FormulaMacro
79 \begin_inset FormulaMacro
80 \newcommand{\foob}[1]{(#1\fooa)}
84 \begin_inset FormulaMacro
85 \renewcommand{\fooa}{y}
93 \begin_layout PlainLayout
101 \begin_layout PlainLayout
111 \begin_layout PlainLayout
122 \begin_inset Formula \[
123 \foob{\fooa}\mbox{ should look like }(yy)\]
130 \begin_layout Enumerate
132 \begin_inset FormulaMacro
137 \begin_inset FormulaMacro
138 \renewcommand{\foo}[2]{(#1,#2)}
142 \begin_inset Formula \[
143 \foo{abc}d\mbox{ should look like }(abc,d)\mbox{ if the second foo is there, otherwise like }-{abc}d\]
150 \begin_layout Enumerate
151 Arity change with incomplete arguments at line end:
152 \begin_inset FormulaMacro
153 \renewcommand{\foo}{-}
157 \begin_inset FormulaMacro
158 \renewcommand{\foo}[2]{(#1,#2)}
162 \begin_inset Formula \[
163 \frac{\foo{abc}{}}{1}\mbox{ should be }\frac{(abc,\,)}{1}\mbox{ if the second foo is defined. Otherwise }\frac{-{abc}{}}{1}\]
170 \begin_layout Enumerate
172 \begin_inset FormulaMacro
173 \renewcommand{\foo}[1]{\foo #1{}}
177 The inner foo should not we resolved as TeX would give a infinite recursion.
180 \begin_layout Enumerate
182 \begin_inset FormulaMacro
183 \renewcommand{\foo}[3]{\frac{{\displaystyle #1}\,{\displaystyle #2}}{{\displaystyle #3}}}
186 can be used to create tree-like structures like this one:
187 \begin_inset Formula \[
188 \foo{\foo{42}{\foo{asdf}{asdf}{asdf}}{21}}{\foo{asdf}{asdf}{asdf}}{asdf}.\]
195 \begin_layout Enumerate
197 \begin_inset FormulaMacro
198 \renewcommand{\foo}[2]{<#1|#2>}
202 Start using Ctrl-+ and Ctrl-- when you are inside of the macro to fold
205 \begin_inset Formula \[
206 \foo{\foo{42}{12}}{\foo{21}4}.\]
213 \begin_layout Enumerate
215 \begin_inset FormulaMacro
216 \renewcommand{\foo}[3][A][B]{(#1,#2)#3}
220 \begin_inset Formula \[
221 \foo[a]{}^{4}[b]c_{1}\mbox{ should look like }(a,B)\sqcup^{4}[b]c_{1}\]
226 \begin_inset Formula \[
227 \foo[a]c^{3}\mbox{ should look like }(a,B)c^{3}\]
234 \begin_layout Enumerate
235 Multiple optional parameters:
236 \begin_inset FormulaMacro
237 \renewcommand{\foo}[3][a][b][c]{(#1,#2,#3)}
244 \begin_layout Enumerate
245 \begin_inset Formula $\foo[][B]123\mbox{ should be }(a,B,c)123$
251 \begin_layout Enumerate
252 \begin_inset Formula $\foo[][][C]123\mbox{ should be }(a,b,C)123$