>       I have a problem with instant preview of equations (which
> I shut off).  I find that defined math symbols don't show up.
> 
>       If I define
> 
> \newcommand\Pc{P^c}
> 
> and then have an equation
> 
>               \Pc = P^c
> 
> the left-hand side will show up in the preview, but not the
> right.  Nothing shows up, including in the .dvi or .png files,

Where do you define \newcommand? If you add it to the LyX preamble, then it 
should be exported to the preview LaTeX file. If you define it as ERT in the 
body of the LyX document, it won't be exported.

You can check yourself. The preview.tex file that is used to generate your 
previews will be in the LyX temp directory.

> I also get messages such as shown below when the equation preview
> processes and equation (perhaps a side effect of something else)

> \special{!/preview <at> version(11.84)def}.  dvipng warning: at
> (4294967070,4294967271) ignored header \special{!userdict
> begin/preview-bop-level 0 def/bop-hook{/preview-bop-level dup
> load dup 0 le{/isls false def/vsize 792 def/hsize 612 def}if 1
> add store}bind def/eop-hook{/preview-bop-level dup load dup 0
> gt{1 sub}if store}bind def end}.

The previews are generated using a python script, lyxpreview2bitmap.py, that 
itself uses external tools. The script can either use dvipng to convert a .dvi 
file directly to multiple .png files containing the previewed snippets, or it 
can use dvips and gs. This latter approach is slower, but gs understands all 
PostScript specials inserted in the .dvi. dvipng simply doesn't. So, the 
warning is simply telling you that dvipng has encountered a PostScript 
special. It looks like it ignored it.

You can use dvips and gs rather than dvipng by editing the 
lyxpreview2bitmap.py script:

 
156     # This can go once dvipng becomes widespread. 
157     dvipng = find_exe(["dvipng"], path) 
158     if dvipng == None: 

Comment out the existing line 157 and add a line
        dvipng = None

Angus

Reply via email to