1 #LyX 2.4 created this file. For more info see https://www.lyx.org/
5 \save_transient_properties true
8 \use_default_options false
9 \maintain_unincluded_children false
11 \language_package default
14 \font_roman "default" "default"
15 \font_sans "default" "default"
16 \font_typewriter "default" "default"
17 \font_math "auto" "auto"
18 \font_default_family default
19 \use_non_tex_fonts false
22 \font_sf_scale 100 100
23 \font_tt_scale 100 100
25 \use_dash_ligatures true
27 \default_output_format default
29 \bibtex_command default
30 \index_command default
31 \paperfontsize default
35 \use_package amsmath 1
36 \use_package amssymb 1
39 \use_package mathdots 0
40 \use_package mathtools 1
42 \use_package stackrel 1
43 \use_package stmaryrd 1
44 \use_package undertilde 1
46 \cite_engine_type default
50 \paperorientation portrait
61 \paragraph_separation indent
62 \paragraph_indentation default
64 \math_numbering_side default
69 \paperpagestyle default
71 \tracking_changes false
84 \begin_layout Enumerate
85 Simple macro definitions with position awareness:
86 \begin_inset FormulaMacro
93 \bla\mbox{ should look like }42
99 \begin_inset FormulaMacro
100 \renewcommand{\bla}{21}
106 \bla\mbox{ should look like }21.
114 \begin_layout Enumerate
115 Redefinitions of macros appearing in the definition of another macro:
116 \begin_inset FormulaMacro
117 \newcommand{\fooa}{x}
121 \begin_inset FormulaMacro
122 \newcommand{\foob}[1]{(#1\fooa)}
126 \begin_inset FormulaMacro
127 \renewcommand{\fooa}{y}
130 with the \SpecialChar TeX
132 \begin_inset listings
136 \begin_layout Plain Layout
145 \begin_layout Plain Layout
156 \begin_layout Plain Layout
170 \foob{\fooa}\mbox{ should look like }(yy)
178 \begin_layout Enumerate
180 \begin_inset FormulaMacro
185 \begin_inset FormulaMacro
186 \renewcommand{\foo}[2]{(#1,#2)}
192 \foo{abc}d\mbox{ should look like }(abc,d)\mbox{ if the second foo is there, otherwise like }-{abc}d
200 \begin_layout Enumerate
201 Arity change with incomplete arguments at line end:
202 \begin_inset FormulaMacro
203 \renewcommand{\foo}{-}
207 \begin_inset FormulaMacro
208 \renewcommand{\foo}[2]{(#1,#2)}
214 \frac{\foo{abc}{}}{1}\mbox{ should be }\frac{(abc,\,)}{1}\mbox{ if the second foo is defined. Otherwise }\frac{-{abc}{}}{1}
222 \begin_layout Enumerate
224 \begin_inset FormulaMacro
225 \renewcommand{\foo}[1]{\foo{#1}{}}
229 The inner foo should not we resolved as \SpecialChar TeX
230 would give a infinite recursion.
233 \begin_layout Enumerate
235 \begin_inset FormulaMacro
236 \renewcommand{\foo}[3]{\frac{{\displaystyle #1}\,{\displaystyle #2}}{{\displaystyle #3}}}
239 can be used to create tree-like structures like this one:
242 \foo{\foo{42}{\foo{asdf}{asdf}{asdf}}{21}}{\foo{asdf}{asdf}{asdf}}{asdf}.
250 \begin_layout Enumerate
252 \begin_inset FormulaMacro
253 \renewcommand{\foo}[2]{<#1|#2>}
257 Start using Ctrl-+ and Ctrl– when you are inside of the macro to fold and
262 \foo{\foo{42}{12}}{\foo{21}4}.
270 \begin_layout Enumerate
272 \begin_inset FormulaMacro
273 \renewcommand{\foo}[3][A][B]{(#1,#2)#3}
279 \foo[a]{}^{4}[b]c_{1}\mbox{ should look like }(a,B)\sqcup^{4}[b]c_{1}
287 \foo[a]c^{3}\mbox{ should look like }(a,B)c^{3}
295 \begin_layout Enumerate
296 Multiple optional parameters:
297 \begin_inset FormulaMacro
298 \renewcommand{\foo}[3][a][b][c]{(#1,#2,#3)}
302 \begin_inset Separator latexpar
309 \begin_layout Enumerate
310 \begin_inset Formula $\foo[][B]123\mbox{ should be }(a,B,c)123$
316 \begin_layout Enumerate
317 \begin_inset Formula $\foo[][][C]123\mbox{ should be }(a,b,C)123$