Hello, I am using Lyx 1.3 with qt frontend.
suppose you want a macro for \a^{#1} where #1 is user input.
In the doc mini-buffer one would type, e.g.,
math-macro ax 1 (enter)
This brings up the macro box in the Lyx doc; in the first box you might type 
ax (should give the LaTex name for the shortcut). In the second you would 
type a^{#1}.
Now in Lyx math mode if you type \ax you get an array to input something for 
#1, doing so and hitting space you get what you expect in the equation 
editor. If you open the doc with say a text editor, you will see an inset for 
the macro which enables its use throughout the doc.
Back in Lyx, hit View->dvi. You will get an error; LaTex does not recognize 
the macro. In other words the Formula Macro inset in the Lyx file format is 
not translated to the LaTex version of the document, i.e., it should have in 
its preamble
\newcommand{\ax}[1]{a^#1}
 You can also see this by exporting the Lyx doc to LaTex and opening the LaTex 
doc with a text editor.
Is this a feature not really working in the qt frontend yet? did it work in 
the xforms version (I really never used that).
There is a workaround: create the macro as above, save the document, remove 
the macrobox in the doc, then open Layout->Document->Preamble and type
the LaTex \newcommand for a macro. Viewing the dvi will now work fine.

best regards, b...
-- 
***************************************************************
William O. Bray, Professor
Department of Mathematics & Statistics
University of Maine
Orono, Maine 04469
***************************************************************
Phone: 207-581-3932      Fax: 207-581-3902
***************************************************************
http://germain.umemat.maine.edu/faculty/bray/index.html
***************************************************************

Reply via email to