Math Macro's In LyX
Udicoudco
udifoglle at gmail.com
Thu Sep 1 00:37:06 UTC 2022
On Thu, Sep 1, 2022 at 3:27 AM Udicoudco <udifoglle at gmail.com> wrote:
> Using \globaldefs (see page 275 in The TeX Book, or here) we might get a global assignment with \newcommand. First we can define a new command fo the matter (LyX may include this line in the preamble if it notices a math macro defintion was done via the GUI):
>
> \newcommand{\lyxnewcommand}[3][0]{\bgroup\globaldefs=1\newcommand{#2}[#1]{#3}\egroup}
>
> and then, if for example i would like to define a new math macro named \foo with 2 parameters via the GUI, LyX will write the following line:
>
> \lyxnewcommand[3]{\foo}{<definition of \foo>}
My apologies, the code should be \lyxnewcommand[2]{\foo}{<definition of \foo>}
Regards,
Udi
More information about the lyx-devel
mailing list