Bug 305713 - Implement postscript (specials) to support tikz graphics
Summary: Implement postscript (specials) to support tikz graphics
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: DVI backend (show other bugs)
Version: 0.19.60
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-24 13:14 UTC by Stefan Kebekus
Modified: 2014-05-08 17:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
sample tex file (1.84 KB, text/x-tex)
2012-08-24 13:15 UTC, Stefan Kebekus
Details
DVI file generated out of sample TeX file. Does not show properly. (19.15 KB, application/x-dvi)
2012-08-24 13:16 UTC, Stefan Kebekus
Details
PDF file generated out of sample TeX file. Does show properly. (42.78 KB, application/pdf)
2012-08-24 13:16 UTC, Stefan Kebekus
Details
Screenshot from my Mac, showing the TeXShop shows the file correctly (606.21 KB, image/png)
2012-08-28 15:05 UTC, Stefan Kebekus
Details
An other dvi file with same problem. (44 bytes, text/plain)
2013-03-15 03:00 UTC, German
Details
This is how my dvi file is rendered by okular (6.84 KB, application/octet-stream)
2013-03-15 03:03 UTC, German
Details
this is how my dvi file is rendered by okular (46 bytes, text/plain)
2013-03-15 03:07 UTC, German
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Kebekus 2012-08-24 13:14:31 UTC
When viewing DVI files that contain tikz graphics (which is becoming the standard for graphics in TeX documents), text labels are misplaced. Using the same TeX file to generate a PDF document, the graphics shows properly

Reproducible: Always

Steps to Reproduce:
1. open the attached DVI file in the okular viewer
Comment 1 Stefan Kebekus 2012-08-24 13:15:04 UTC
Created attachment 73430 [details]
sample tex file
Comment 2 Stefan Kebekus 2012-08-24 13:16:02 UTC
Created attachment 73431 [details]
DVI file generated out of sample TeX file. Does not show properly.
Comment 3 Stefan Kebekus 2012-08-24 13:16:39 UTC
Created attachment 73433 [details]
PDF file generated out of sample TeX file. Does show properly.
Comment 4 Albert Astals Cid 2012-08-24 18:10:06 UTC
I tried both xdvi and evince and both of them show it the same way we do.

Maybe it's a bug in tex->dvi generation?

Do you have any dvi viewer that shows the file correctly?
Comment 5 Luigi Toscano 2012-08-25 11:48:22 UTC
For the record, tested also on:
- yap 2.9.4206 (from MiKTeX 2.9): wrong rendering, also the curves completely messed up.
- kdvi 1.4 from KDE 3.5.10: same rendering, so it's not a regression in the okular dvi generators which inherits that code.
Comment 6 Christoph Feck 2012-08-25 17:52:45 UTC
The question rather was, if you know of a DVI viewer, where it is shown _without_ bugs (to prove that the DVI file is correct).
Comment 7 Stefan Kebekus 2012-08-25 18:08:18 UTC
The DVI file that I uploaded can be converted to a correct PS file using the dvips program under Linux. It also shows correctly in TeXShop under MacOS.
Comment 8 Albert Astals Cid 2012-08-27 20:00:25 UTC
Could you please attach such screenshot of such MacOs software?
Comment 9 Stefan Kebekus 2012-08-28 15:04:52 UTC
> Could you please attach such screenshot of such MacOs software?

Sure. Please note that TeXShop converts the DVI file to PDF internally (hence the window title). I made absolutely sure the my Mac's harddisk contains only the DVI file. The PDF oder TeX files have never been uploaded to my Mac.

You might also be interested to know that DVI file prints file from okular. But this is probably because the printing uses dvips internally, and dvips interprets the DVI file correctly...
Comment 10 Stefan Kebekus 2012-08-28 15:05:48 UTC
Created attachment 73527 [details]
Screenshot from my Mac, showing the TeXShop shows the file correctly
Comment 11 Albert Astals Cid 2012-08-28 22:08:31 UTC
To be honest i'm still not convinced the dvi file is correct, since as you say TeXShop is running dvipdf on the file.

I'm not a dvi expert either to confirm or reject so i'll leave it as unconfirmed until someone can prove it's wrong or not.
Comment 12 German 2013-03-15 03:00:40 UTC
Created attachment 78085 [details]
An other dvi file with same problem.
Comment 13 German 2013-03-15 03:03:47 UTC
Created attachment 78086 [details]
This is how my dvi file is rendered by okular
Comment 14 German 2013-03-15 03:07:01 UTC
Created attachment 78087 [details]
this is how my dvi file is rendered by okular

Sorry, i made something wrong in comentary 13, and dont know how to delete or edit.
Comment 15 German 2013-03-15 03:10:27 UTC
The dvi file i attached is correctly displayed by yap, and also after dvips and ps2pdf the result is a correct pdf file.

here is a snapshot of yap: https://www.dropbox.com/s/dfkjp86v5azrf4f/SceenShot.PNG

I tested this compiling both with texlive and with miktex.
Comment 16 Albert Astals Cid 2013-03-20 00:02:25 UTC
http://tex.stackexchange.com/questions/5826/tikz-with-positioning-does-not-work-with-dvi

This is basically not a bug, unless someone wants to include gs parsing on our dvi backend

I've been having a look at the file and what happens is

draw("G1")
somePSCommands
draw("G2")

it happens that those ps commands move where G2 would end up but since we don't do PS parsing G1 and G2 end of top of eachother

Comments?
Comment 17 German 2013-03-20 03:37:23 UTC
Now I understand it's not a bug, and can also guess why dvips solves the problem.

Including or not ps parsing in dvi frontend is a developers decision. And I'm not a developer. So I'll argue from user point of view.

Philosophically, a dvi parser should not parse ps.

In the other side, there is an integration issue with kile.
tikz is becoming an usual package in latex. Not so long ago, tikz came with a warning telling it should be compiled with pdflatex (I read that in todonotes documentation), and that was a pain in systems which didn't support backward search of pdf. I guess that is why someone implemented that mixture of ps and dvi.
One can blame tikz developers, one can go with mixing dvi and ps, or, as kile + okular does manage backward search of pdf, one can try to find a compromise solution.

Actually I'm doing that by hand: depending on which machine I'm using, I use kile|pdflatex|okular, or texnikcenter|latex|yap. I wander if it is a good idea or not making kile to detect that tikz issue and warn the user or even change it automatically.
Comment 18 Albert Astals Cid 2013-03-20 19:39:13 UTC
You can create a bug/wish for the kile product in bugs.kde.org about that, i'm sure the kile devels are happy to help.

Actually one of my ideas yesterday was to try to detect if the file had been genereated using tikz and offer the user to run dvipdf ourselves, but couln't find a way to distinguish such a file