Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Let's say I want to create a "macro" called \limx that will be defined as:

\newcommand{\limx}{\displaystyle{\lim_{x\to\x_{0}}}}

How can I make LyX recognize it and make an auto-prieview of it?

Another example, I'm using the cancel package. When I'm using \cancel in a math equation it doesn't preview it while editing. I can still see "\cancel" on the equation editor. Only when I render the document the \cancel is being really rendered. How can I add that functionality to the LyX's WYSIWYG environment as well?

share|improve this question
    
Which version of LyX do you use? I have version 1.6.7 and when using the cancel package, \cancel previews just fine. So do macros that I define in the preamble. –  Jan Hlavacek Dec 5 '10 at 4:42
    
@Dave: Why the mathmode tag? –  Jan Hlavacek Dec 14 '10 at 17:59
    
@Jan: My mistake. –  Dave Jarvis Dec 14 '10 at 18:03
    
@Jan I'm using Lyx 1.6.7, but when i use "\cancel" it doesn't work for me. I still just see "\cancel" in the mathmode... –  DiGMi Dec 16 '10 at 13:29
    
In the equation editor, when actually editing the formula, it will use \cancel. As far as I know, there is no way to teach LyX a graphical representation of new macros that it doesn't already know. When you are done with editing, and leave the particular "equation" (I think it is "math inset" in LyXspeak), LyX should preview the formula just the way it will look in the compiled document. At that moment, \cancel should render the way it is supposed to. When you click on the equation again, you will enter edit mode, and and you will see cancel again. –  Jan Hlavacek Dec 16 '10 at 17:08
add comment

1 Answer

As I understand things, it's not necessary to do anything special for macros that get used inside equations; LyX just runs them through LaTeX and (with the aid of preview.sty) extracts the preview images.

share|improve this answer
    
This doesn't really answer the question at hand. I'm also working on creating previews in Lyx for custom Latex classes, and its not really all that straight-forward. –  Adam Miller Feb 10 '13 at 0:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.