|
Edit Links |
Tips /
MathMacrosCategories: Math << Nomenclature | Page list | ChildMathMacros >>This page contains tips about Math Macros in LyX Alternative math-macro definition modeMath-macros can be defined in two ways. The usual way is to use the mini-buffer. Either use the mouse to put the cursor in the mini-buffer or type Meta-x. Then type: math-macro name args, where name is a string and args is an optional integer indicating the number of arguments. LyX will then open a math environment in which the macro definition can be entered. In current versions of LyX, you enter arguments by typing "\#n", where n is the number of the argument. In earlier versions, you could type just "#n", but the "#" now needs to be escaped. The other way is simply to enter the LaTeX definition directly and then convert it. So you can type \def\exp#1#2{#1^#2} or \newcommand{\exp}[2]{#1^#2}, select the typed text, and type Ctr-M to convert it to a math-macro. Renaming a macroThis allows a trick for renaming a macro (using the minibuffer you can only delete it and recreate):
Changing an existing commandMath-macros translate to To change an existing command (and its rendering in Lyx) you can use the following trick: Assume you want to redefine
Now LaTeX will produce the desired output, but LyX can't see the ERT redefinition, so it will still display the the old Re symbol as you edit. To make LyX display it the way you want during editing:
|