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 no
11 \language_package default
12 \inputencoding auto-legacy
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
23 \font_typewriter_osf false
24 \font_sf_scale 100 100
25 \font_tt_scale 100 100
27 \use_dash_ligatures true
29 \default_output_format default
31 \bibtex_command default
32 \index_command default
33 \paperfontsize default
37 \use_package amsmath 1
38 \use_package amssymb 1
41 \use_package mathdots 0
42 \use_package mathtools 1
44 \use_package stackrel 1
45 \use_package stmaryrd 1
46 \use_package undertilde 1
48 \cite_engine_type default
52 \paperorientation portrait
64 \paragraph_separation indent
65 \paragraph_indentation default
67 \math_numbering_side default
72 \paperpagestyle default
74 \tracking_changes false
77 \postpone_fragile_content false
81 \docbook_table_output 0
82 \docbook_mathml_prefix 1
91 \begin_layout Enumerate
92 Simple macro definitions with position awareness:
94 \begin_inset FormulaMacro
101 \bla\mbox{ should look like }42
107 \begin_inset FormulaMacro
108 \renewcommand{\bla}{21}
115 \bla\mbox{ should look like }21.
123 \begin_layout Enumerate
124 Redefinitions of macros appearing in the definition of another macro:
126 \begin_inset FormulaMacro
127 \newcommand{\fooa}{x}
131 \begin_inset FormulaMacro
132 \newcommand{\foob}[1]{(#1\fooa)}
136 \begin_inset FormulaMacro
137 \renewcommand{\fooa}{y}
140 with the \SpecialChar TeX
142 \begin_inset listings
146 \begin_layout Plain Layout
155 \begin_layout Plain Layout
166 \begin_layout Plain Layout
180 \foob{\fooa}\mbox{ should look like }(yy)
188 \begin_layout Enumerate
191 \begin_inset FormulaMacro
196 \begin_inset FormulaMacro
197 \renewcommand{\foo}[2]{(#1,#2)}
203 \foo{abc}d\mbox{ should look like }(abc,d)\mbox{ if the second foo is there, otherwise like }-{abc}d
211 \begin_layout Enumerate
212 Arity change with incomplete arguments at line end:
214 \begin_inset FormulaMacro
215 \renewcommand{\foo}{-}
219 \begin_inset FormulaMacro
220 \renewcommand{\foo}[2]{(#1,#2)}
226 \frac{\foo{abc}{}}{1}\mbox{ should be }\frac{(abc,\,)}{1}\mbox{ if the second foo is defined. Otherwise }\frac{-{abc}{}}{1}
234 \begin_layout Enumerate
237 \begin_inset FormulaMacro
238 \renewcommand{\foo}[1]{\foo{#1}{}}
242 The inner foo should not we resolved as \SpecialChar TeX
243 would give a infinite recursion.
246 \begin_layout Enumerate
249 \begin_inset FormulaMacro
250 \renewcommand{\foo}[3]{\frac{{\displaystyle #1}\,{\displaystyle #2}}{{\displaystyle #3}}}
253 can be used to create tree-like structures like this one:
256 \foo{\foo{42}{\foo{asdf}{asdf}{asdf}}{21}}{\foo{asdf}{asdf}{asdf}}{asdf}.
264 \begin_layout Enumerate
266 \begin_inset FormulaMacro
267 \renewcommand{\foo}[2]{<#1|#2>}
271 Start using Ctrl-+ and Ctrl– when you are inside of the macro to fold and unfold,
276 \foo{\foo{42}{12}}{\foo{21}4}.
284 \begin_layout Enumerate
287 \begin_inset FormulaMacro
288 \renewcommand{\foo}[3][A][B]{(#1,#2)#3}
294 \foo[a]{}^{4}[b]c_{1}\mbox{ should look like }(a,B)\sqcup^{4}[b]c_{1}
302 \foo[a]c^{3}\mbox{ should look like }(a,B)c^{3}
310 \begin_layout Enumerate
311 Multiple optional parameters:
312 \begin_inset FormulaMacro
313 \renewcommand{\foo}[3][a][b][c]{(#1,#2,#3)}
317 \begin_inset Separator latexpar
324 \begin_layout Enumerate
325 \begin_inset Formula $\foo[][B]123\mbox{ should be }(a,B,c)123$
331 \begin_layout Enumerate
332 \begin_inset Formula $\foo[][][C]123\mbox{ should be }(a,b,C)123$