Instant preview doesn't work in Hardy

Bug #236785 reported by MartinE
8
Affects Status Importance Assigned to Milestone
lyx (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Hardy by Benedikt Wegmann
Nominated for Intrepid by Benedikt Wegmann

Bug Description

Binary package hint: lyx

The instant preview feature does not work in Ubuntu 8.04. I have installed preview-latex-style, netpbm and ghostscript, but to no avail. Lyx simply doesn't use the instant preview feature. Starting Lyx from the command line, i get the following error messages:

This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)
' TeX output 2008.06.02:1451' -> 0lyxpreview.ps
</usr/share/texmf-texlive/dvips/base/tex.pro>
</usr/share/texmf-texlive/dvips/base/texps.pro>
</usr/share/texmf-texlive/dvips/base/special.pro>.
</usr/share/texmf-texlive/fonts/type1/bluesky/cm/cmr10.pfb>
</usr/share/texmf-texlive/fonts/type1/bluesky/cm/cmmi10.pfb>[1]
Failed: gs 0lyxpreview.ps
This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)
' TeX output 2008.06.02:1453' -> 1lyxpreview.ps
</usr/share/texmf-texlive/dvips/base/tex.pro>
</usr/share/texmf-texlive/dvips/base/special.pro>. [1]
Failed: gs 1lyxpreview.ps
This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)
' TeX output 2008.06.02:1453' -> 2lyxpreview.ps
</usr/share/texmf-texlive/dvips/base/tex.pro>
</usr/share/texmf-texlive/dvips/base/texps.pro>
</usr/share/texmf-texlive/dvips/base/special.pro>.
</usr/share/texmf-texlive/fonts/type1/bluesky/cm/cmsy10.pfb>
</usr/share/texmf-texlive/fonts/type1/bluesky/cm/cmr10.pfb>
</usr/share/texmf-texlive/fonts/type1/bluesky/cm/cmmi10.pfb>[1]
Failed: gs 2lyxpreview.ps

What am I missing here?

Revision history for this message
MartinE (martin-engbers-gmx) wrote :

It seems to be a problem with dvips. I have attached the dvi- and ps-file that lyx tried to create in /tmp. As you can see, the dvi-file contains the LaTeX-Snippets that Lyx wanted to display, but the ps-file is empty. Any help on this issue would be greatly appreciated.

Revision history for this message
MartinE (martin-engbers-gmx) wrote :
Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

MartinE: are there logs in /tmp?

Revision history for this message
MartinE (martin-engbers-gmx) wrote :

Yes, I have attached the log file. There's nothing suspicious in it, i fear. Anyway, the log file only logs the creation of 0lyxpreview.dvi, which seems to be fine. There are no logs about the creation of 0lyxpreview.ps.

I have manually run "dvips -0 0lyxpreview 0lyxpreview" and it created an empty ps-file, without printing any error messages. So I suspect this might actually be a bug in dvips.

Revision history for this message
Guillaume M (diabo-bugreport) wrote :
Download full text (4.0 KiB)

I can confirm the bug with instant preview not working, where lyx leaves the following error message: "failed: gs 0lyxpreview.ps". I have a candidate solution/workaround, see below.

Note however that the ps file LyX created in /tmp was fine in my case.

As suggested in http://archive.netbsd.se/?ml=lyx-devel&a=2007-05&t=4342060 I have installed the package dvipng which removes the "failed: gs 0lyxpreview.ps" error message. However, instant preview is still broken. I now have on the command line the following:

dvipng warning: Bad resolution (-D) parameter, ignored dvipng warning: at (75,15) unimplemented \special{ps: currentpoint currentpoint translate 0.07472 0.11023 scale neg exch neg exch translate} dvipng warning: at (91,15) unimplemented \special{ps: gsave currentpoint currentpoint translate 90 neg rotate neg exch neg exch translate} dvipng warning: at (233,15) unimplemented \special{ps: currentpoint grestore moveto} dvipng warning: at (75,15) unimplemented \special{ps: currentpoint currentpoint translate 1 0.07472 div 1 0.11023 div scale neg exch neg exch translate} dvipng warning: at (102,15) unimplemented \special{ps: currentpoint currentpoint translate 0.07472 0.11023 scale neg exch neg exch translate} dvipng warning: at (119,15) unimplemented \special{ps: gsave currentpoint currentpoint translate 90 neg rotate neg exch neg exch translate} dvipng warning: at (260,15) unimplemented \special{ps: currentpoint grestore moveto} dvipng warning: at (102,15) unimplemented \special{ps: currentpoint currentpoint translate 1 0.07472 div 1 0.11023 div scale neg exch neg exch translate}

Ok, that was with hardy's dvipng. I installed the latest dvipng from http://download.savannah.gnu.org/releases/dvipng/ and LyX now gives me:

dvipng warning: Bad resolution (-D) parameter, ignored GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
dvipng warning: No GhostSc...

Read more...

Revision history for this message
MartinE (martin-engbers-gmx) wrote :

Thanks a lot! I found that step 1 and 3 aren't necessary for me: instant preview works as soon as dvipng was installed. However I still get the following error message:

          dvipng warning: "Bad resolution (-D) parameter, ignored"

And the resolution is indeed bad - instant-preview-formulae are rendered way too small. Is it possible to manually adjust the -D parameter somewhere in the Lyx Configuration?

Thanks again, Martin

Revision history for this message
MartinE (martin-engbers-gmx) wrote :

Hi again,

The resolution of formulae was unconnected to this bug. Adding the line "\preview_scale_factor 1.0" to the MISC SECTION of ~/.lyx/preferences solved that.

For me, instant preview worked as soon as i installed the dvipng package. However, I get the same error message that you posted from Hardy's dvipng:

"dvipng warning: at (0,-1) ignored header \special{! /DvipsToPDF { 72.27 mul Resolution div } def /PDFToDvips { 72.27 div Resolution mul } def /HyperBorder { 1 PDFToDvips } def /H.V {pdf@hoff pdf@voff null} def /H.B {/Rect[pdf@llx pdf@lly pdf@urx pdf@ury]} def /H.S { currentpoint HyperBorder add /pdf@lly exch def dup DvipsToPDF /pdf@hoff exch def HyperBorder sub /pdf@llx exch def } def /H.L { 2 sub dup /HyperBasePt exch def PDFToDvips /HyperBaseDvips exch def currentpoint HyperBaseDvips sub /pdf@ury exch def /pdf@urx exch def } def /H.A { H.L currentpoint exch pop vsize 72 sub exch DvipsToPDF HyperBasePt sub sub /pdf@voff exch def } def /H.R { currentpoint HyperBorder sub /pdf@ury exch def HyperBorder add /pdf@urx exch def currentpoint exch pop vsize 72 sub exch DvipsToPDF sub /pdf@voff exch def } def systemdict /pdfmark known { userdict /?pdfmark systemdict /exec get put }{ userdict /?pdfmark systemdict /pop get put userdict /pdfmark systemdict /cleartomark get put } ifelse }"

 I also compiled dvipng 1.10 and 1.11, and I also get the error

"dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript GPL Ghostscript 8.61: Unrecoverable error, exit code 1"

For me, however, instant preview works with Hardy's dvipng package, without changing "document > parameters > document class > postcript driver".

Thanks for your help, Martin

Revision history for this message
Benedikt Wegmann (benny-wegmann) wrote :

I can confirm the bug.
Installing package "dvipng" and adding "\preview_scale_factor 1.0" to ~/.lyx/preferences fixed preview.

Dara Adib (daradib)
Changed in lyx:
status: New → Confirmed
Revision history for this message
Dara Adib (daradib) wrote :

Closing this bug. The dvipng package, which must be installed for instant preview, is a recommended dependency and therefore is installed by default in Ubuntu 8.10 and above.

Changed in lyx:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.