Paul Johnson <pauljohn32 <at> gmail.com> writes:

> 
> Hit that button, and the macro editor inserts {#1} at the
> end of your macro name and it also plops a #1 into the "TeX" box.
> 
> The documentation says, "The wanted formula is inserted in the first
> blue box."  How it gets in there is the big mystery to me.

Just type it in. If you want to molest the automatically supplied argument (#1),
just highlight it and then type a command. For instance, if you highlight #1 and
type '\bm' followed by a space, the body of the macro becomes '\bm{#1}'.

If you need to repeat the argument (for instance, you want #1+#1 for some
reason), you can insert additional copies by typing '\#1'.
> 
> After I did the "append argument" button, the last two boxes look like this:
>  _      _
> |#1|  |_|
> TeX LyX
> 
> It is a bit tricky to put the desired macros into the box on the left.
> You can't just type them. My first try was to just type;
> 
> \bm{\mathrm{#1}}
> 
> Epic fail. Just as I could not type #1 in my macro name, I can't type
> it here. Typing #1 leads to a big blue #1, where LyX thinks I mean the
> math symbols are #1, not that I mean the argument placeholder.

Just escape the hash sign with a backslash.

> 
> What goes in the little box called "LyX"? I don't know.

This is what you want LyX to display in the math inset. The default, I think, is
to display LyX's representation of the result if you used commands that LyX
knows (it knows, for instance, that \bm means show the content in bold) and a
verbatim repeat of the macro body otherwise. Note to the documentation team:
unlike in earlier versions of the math manual, I did not see this explained in
section 22.2 of the current version!

Paul



Reply via email to