# LyX new macros and instant preview

When we define new macros in LyX, can we still have instant preview for them?

For example, I defined a new command `\abc`, but when I put `\abc` in the math inset, it does not have instant preview. Though if I compile to a DVI, it's there in DVI.

Thank you.

-
Welcome newuser! Could you fill out your question a bit more? "Instant preview" sounds a bit like <a href="tex.stackexchange.com/questions/tagged/…; but not sure in the context of macros. What is it you want to do? If you're asking for a feature to be added to LyX, though, you should <a href="lyx.org/trac/wiki/BugTrackerHome">contact the LyX developers</a> –  Matthew Leingang Oct 27 '10 at 19:01
@Matthew. By instant preview, I mean Tools->Preferences->Look&Feel->Display->Instant Preview. It's in the math inset. My problem is that, for example, I define a new command \abc, but when I put \abc in the math inset, it does not have instant preview. Though if I complie to a DVI, it's there in DVI. –  newuser Oct 27 '10 at 20:11
Hm, that's strange, it works for me. Can you give us more details? How exactly do you define `\abc`. Do you get instant preview if you do not use user defined commands? –  Jan Hlavacek Oct 27 '10 at 22:25
Hi, I get instant preview with ordinarty commands. And for example, I define \$\newcommand{\abc}{A}\$, then I put \abc in math inset, it does not show anything –  newuser Oct 28 '10 at 3:06
If you are the same "newuser" who asked what is the black part in the Lyx window, then you have managed to open multiple separate accounts (possibly you have multiple OpenIDs). Flag one of the questions for moderator attention and ask for help. –  dmckee Oct 28 '10 at 8:16
show 1 more comment

@Jan: Lyx assembles a Latex text from its own representation, but the contents of the preamble and Tex code block are completely uninterpreted. If one Tex block contains a `\newcommand` definition, Lyx won't know that it is related to a macro in another Tex block. Lyx can't do "instant preview" with them. –  Charles Stewart Nov 9 '10 at 16:55
@Jan: I've tried this out: with `\newcommand{\five}{5}` in either the preamble or a Tex block, the control sequence `\five` renders as whitespace. What do you mean by "macros defined in the preamble do seem to be recognized in the preview"? –  Charles Stewart Nov 9 '10 at 21:17