Discussion:
[Dvipng] disappearing branches with qtree
Jürgen Spitzmüller
2007-06-08 11:30:19 UTC
Permalink
Hello,

this is an issue that was raised on LyX bugzilla, please cf.
http://bugzilla.lyx.org/show_bug.cgi?id=3704

It appears that branches of trees drawn with the LaTeX package qtree vanish in
the dvipng process. I've attached a tarball with the tex, dvi and png file
and the log produced by LyX's preview-latex implementation. This is with
dvipng 1.9.

Is this a dvipng issue? Is there something we can do on the LyX side?

Thanks,
JÃŒrgen
Jan-Åke Larsson
2007-06-12 21:11:40 UTC
Permalink
Somehow, this went off-list

-------- Ursprungligt meddelande --------
Date: Fri, 08 Jun 2007 16:35:29 +0200
From: Jan-Åke Larsson <***@mai.liu.se>
To: Jürgen Spitzmüller <***@t-online.de>
Subject: Re: [Dvipng] disappearing branches with qtree
Post by Jürgen Spitzmüller
Is this a dvipng issue? Is there something we can do on the LyX side?
Jan-Åke Larsson
2007-06-12 21:12:43 UTC
Permalink
And here's the response...

-------- Ursprungligt meddelande --------
From: ***@t-online.de (Jürgen Spitzmüller)
To: Jan-Åke Larsson <***@mai.liu.se>
Subject: Re: [Dvipng] disappearing branches with qtree
Date: Fri, 8 Jun 2007 19:34:41 +0200

Also sprach Jan-Åke Larsson:
Jan-Åke Larsson
2007-06-12 21:17:13 UTC
Permalink
I see. Would be great if you'd find a solution. In any case, I'll add your
description to our bug tracker, so that it is documented.
I'm onto a solution. Rendering raw PostScript isn't as hard as I
thought, given the pngalpha device available in modern gs releases. I
have managed to enable even PSTricks (!) stuff. The main remaining thing
is that the stuff you use seems to split the necessary code into three
separate specials. I'll have to solve that, combining them into one
somehow. Other than that, we should be home free.....

/JÅ
Jan-Åke Larsson
2007-07-21 22:05:52 UTC
Permalink
Jürgen Spitzmüller
2007-07-22 09:35:30 UTC
Permalink
Okay, there is now a version of dvipng at the CVS archive at savannah
which attempts to implement raw PostScript specials.
[...]
I'd appreciate if presumptive users would test this, and report their
problems/success.
I tested with qtree, and the preview looks fine now: the branches are
displayed.
I get lots of the following messages on the console, though (don't know if
that matters or if my Ghostscript installation is to blame):

ESP Ghostscript 8.15.3: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript
ESP Ghostscript 8.15.3: Unrecoverable error, exit code 1

Many thanks for fixing this!

Jürgen
Jan-Åke Larsson
2007-07-22 16:08:28 UTC
Permalink
Post by Jürgen Spitzmüller
I tested with qtree, and the preview looks fine now: the branches are
displayed.
I get lots of the following messages on the console, though (don't know if
ESP Ghostscript 8.15.3: Unrecoverable error, exit code 1
dvipng warning: No GhostScript pngalpha output, cannot render raw PostScript
ESP Ghostscript 8.15.3: Unrecoverable error, exit code 1
Hmmm, do you have an example DVI?

/JÅ
Jürgen Spitzmüller
2007-07-24 06:04:50 UTC
Permalink
Post by Jan-Åke Larsson
Hmmm, do you have an example DVI?
yes. attached.

Jürgen
Jan-Åke Larsson
2007-07-24 14:12:12 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Jan-Åke Larsson
Hmmm, do you have an example DVI?
yes. attached.
Okay, I fixed some typos in the code, but one problem remains: one of
the PostScript headers generates a syntax error. Any idea why? What code
is generating this?

/JÅ
Jürgen Spitzmüller
2007-07-24 14:43:45 UTC
Permalink
Post by Jan-Åke Larsson
Okay, I fixed some typos in the code, but one problem remains: one of
the PostScript headers generates a syntax error. Any idea why? What code
is generating this?
It's strange. In my original document (a beamer presentation), the error
occurs and the branches are now incomplete again (after cvs up). If I copy
the individual qtree constructs to a new file, though, preview shows up
correctly (without errors).

Attached is the LyX-generated tex file that is used to generate the preview
dvi, and again, the dvi.

Hope this helps,
Jürgen
Jan-Åke Larsson
2007-07-30 19:32:15 UTC
Permalink
Post by Jürgen Spitzmüller
It's strange. In my original document (a beamer presentation), the error
occurs and the branches are now incomplete again (after cvs up). If I copy
the individual qtree constructs to a new file, though, preview shows up
correctly (without errors).
Attached is the LyX-generated tex file that is used to generate the preview
dvi, and again, the dvi.
Okay, I have traced this to the file pgfsys-dvips.def, where you have
statements like

/pgfsc{}B% stroke color is empty by default

In other files in the same TeX directory, this line reads

/pgfsc{} bind def% stroke color is empty by default

If I do search-and-replace "}B" for "} bind def" in pgfsys-dvips.def and
rerun latex on 1lyxpreview.tex, the error disappears. I've seen error
messages from xdvi that seems to be similar to this, and queries on the
internet about this. This should probably be reported as a bug on
http://sourceforge.net/projects/pgf/, but I am reluctant to do that
since I do not use the package myself.

Possibly dvips understands "B" as "bind def", I do not know. There is
certainly no header included in your file that defines "B".

Would you report this, Jürgen?
/JÅ
Jürgen Spitzmüller
2007-07-31 05:58:45 UTC
Permalink
Post by Jan-Åke Larsson
Would you report this, Jürgen?
Done:
http://sourceforge.net/tracker/index.php?func=detail&aid=1764170&group_id=142562&atid=752792

Jürgen
Jürgen Spitzmüller
2007-07-31 06:54:01 UTC
Permalink
Post by Jan-Åke Larsson
Possibly dvips understands "B" as "bind def", I do not know. There is
certainly no header included in your file that defines "B".
Hm, I just saw that dvips-generated postscript files usually contain
definitions like

begin/N{def}def/B{bind def}N

I am not familar with PostScript, but doesn't that mean that "B" is defined as
an alias to "bind def" by dvips? Thus, the code in the pgf file would be
valid, wouldn't it?

Jürgen
Jan-Åke Larsson
2007-07-31 09:42:48 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Jan-Åke Larsson
Possibly dvips understands "B" as "bind def", I do not know. There is
certainly no header included in your file that defines "B".
Hm, I just saw that dvips-generated postscript files usually contain
definitions like
begin/N{def}def/B{bind def}N
I am not familar with PostScript, but doesn't that mean that "B" is defined as
an alias to "bind def" by dvips? Thus, the code in the pgf file would be
valid, wouldn't it?
Yes and no. The code is provided for the dvips driver, to make
Postscript out of DVI. However, there are other drivers around that take
dvips-intended DVIs and displays them. This includes dvipng and xdvi.

I could arrange for dvipng to include the correct incanatation to make
this work, but that would not fix xdvi's problem. I think it is better
to fix this closer to the source.

Cheers,
Jan-Åke
Jan-Åke Larsson
2007-07-31 09:58:07 UTC
Permalink
Post by Jürgen Spitzmüller
Okay, there is now a version of dvipng at the CVS archive at savannah
which attempts to implement raw PostScript specials.
[...]
I'd appreciate if presumptive users would test this, and report their
problems/success.
I tested with qtree, and the preview looks fine now: the branches are
displayed.
The errors you got should be gone now.

I still need people to test the functionality of the
Postscript-including code. I did notice that there are more variants of
raw PostScript inclusion than I first thought. I'll try to incorporate
these too, but there will probably not be a new release of dvipng (that
contains this) anytime soon.

But please do try the CVS version.
/JÅ

Loading...