On 30/03/2011 6:40 PM, veno...@arcadiaclub.com wrote:
   From what I can tell the issue arises from a bug in either hyperref
package or preview-latex package: when eqn numbers are
involved an error
occurs on dvi output and we don't recover a preview image. As
mentioned
the solutions proposed are workarounds. venom is working on a better
fix, i.e. proper handling of failed dvi output, and pass those failed
snippets onto pdflatex.

OK, here we are. The patch is ready, I've tested it under Windows and Linux,
with and without hyperref package. The attached example file didn't work as
pdflatex can't render PSTricks, with my patch works fine. I've tested also
[examples/instant-preview.lyx] and the math manual.
In short: pdflatex is run on pages which failed after the legacy route (and
dvipng route). I've also simplified pre-existing code creating a pair of new
functions.
Now functions return a tuple made of an integer exit code and a list containing
the metrics for the generated pages/IP insets.

Hope you like it! Any comment is welcome!
Here's the source of the patch as Pavel always asks me to send in plain text,
but I don't know how to do that in Outlook :P

venom00


That's great, thanks! The patch applies fine and I can't make it to fail with my test cases. I get a bunch of

GPL Ghostscript 8.71: Unrecoverable error, exit code 1

on the terminal but all previews appear (and I think I saw those error messages before, too). Nice work!

+    # latex failed
+    # FIXME: try with pdflatex
+    if not os.path.isfile(dvi_file):
+        error("No DVI output.")
+

why the FIXME?

Cheers,
Julien

Reply via email to