From: Alvaro T. C. <al...@an...> - 2003-12-15 19:55:06
Attachments:
test.zip
|
Hello, I have been playing with PyX. I really like it and I'm trying to adopt it for most of the figures of our free documents project. I have run into a problem which solution perhaps you know. I would be very grateful if you could point me in the right direction. After extensive testing what I can say is the following (tetex 2.x, redhat 9, python 2.2.x): When using the figures within latex, they look good on the DVI, PS and PDF (with PDFLATEX) output, but not with the DVIPDFM output. The problem appears with graphs, in some but not all of the axes labels. I have prepared a very simple test file which demonstrates it. The pyx files are very rudimentary, as I was and am still learning. =20 I forward also the mail to DVIPDFM's author, perhaps he knows of the problem already. TIA, =E1. PS. CC to me as I'm not (yet) subscribed --=20 =C1lvaro Tejero Cantero http://alqua.com -- documentos libres free documents |
From: Mark A. W. <mw...@ke...> - 2003-12-15 21:10:59
|
On Mon, Dec 15, 2003 at 03:58:12PM -0500, Alvaro Tejero Cantero wrote: > I have been playing with PyX. I really like it and I'm trying to adopt > it for most of the figures of our free documents project. ... > When using the figures within latex, they look good on the DVI, PS and > PDF (with PDFLATEX) output, but not with the DVIPDFM output. This isn't a bug in dvipdfm per se, but it's a bug in the external command that dvipdfm uses to convert EPS to PDF for embedded images. I think the following change will fix your problem. If you can find the dvipdfm "config" file, try changing the line: D "zcat -f %i | gs -q -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.2 -dUseFlateCompression=true -sOutputFile=%o - - to D "epstopdf --outfile=%o %i" (This "fix" assumes you have a "epstopdf" script that accepts the "--outfile" option). You will also need to change: V 2 to V 3 BTW, dvipdfm (and pdftex) have a crude internal PostScript interpreter that works on very restrictive subset of PS files, such as those that come from MetaPost. I don't know anything about PyX (and I also don't subscribe to the list), but if there's an option for changing the "prologues" output (like the MetaPost option) dvipdfm could be made to read it natively without needing to call an external converter. Mark Wicks (DVIPDFM author) -- |
From: Joerg L. <jo...@us...> - 2003-12-16 16:21:41
|
On 15.12.03, Mark A. Wicks wrote: > On Mon, Dec 15, 2003 at 03:58:12PM -0500, Alvaro Tejero Cantero wrote: > > When using the figures within latex, they look good on the DVI, PS and > > PDF (with PDFLATEX) output, but not with the DVIPDFM output. > > This isn't a bug in dvipdfm per se, but it's a bug in the external > command that dvipdfm uses to convert EPS to PDF for embedded images. I > think the following change will fix your problem. If you can find the > dvipdfm "config" file, try changing the line: > > D "zcat -f %i | gs -q -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.2 -dUseFlateCompression=true -sOutputFile=%o - - > > to > > D "epstopdf --outfile=%o %i" Alternatively, you can replace the -sPAPERSIZE option by -dEPSCrop, which uses the bounding box specified in the EPS file, i.e. D "zcat -f %i | gs -q -dEPSCrop -sDEVICE=pdfwrite -dCompatibilityLevel=1.2 -dUseFlateCompression=true -sOutputFile=%o - - Note that this requires at least Ghostscript 8.0. > BTW, dvipdfm (and pdftex) have a crude internal PostScript interpreter > that works on very restrictive subset of PS files, such as those that > come from MetaPost. I don't know anything about PyX (and I also don't > subscribe to the list), but if there's an option for changing the > "prologues" output (like the MetaPost option) dvipdfm could be made to > read it natively without needing to call an external converter. The Postscript used by PyX is also very small subset of the Postscript language, so in principle a direct interpretation by dvipdfm or pdftex should be possible. Is there a definition of the PS subset implemented by dvipdfm or pdftex? Best regards, Jörg -- JOERG LEHMANN | PyX - High quality PostScript figures with Python & TeX jo...@lu... | Visit http://pyx.sourceforge.net/ |
From: Alvaro T. C. <al...@an...> - 2003-12-16 18:17:05
|
[Sorry for the duplicates --it's my typo day] Hello, > The Postscript used by PyX is also very small subset of the Postscript > language, so in principle a direct interpretation by dvipdfm or pdftex > should be possible. Is there a definition of the PS subset implemented > by dvipdfm or pdftex? >=20 I'm wondering whether PyX could be made to write to TeXmacs' (http://texmacs.org) psdevice... The author of TeXmacs states that it's easy to write an interface TeXmacs<->Python, and in fact many examples of such interfaces exist (http://www.texmacs.org/tmweb/plugins/plugins.en.html, also shell and scheme). Conversely, perhaps a way could be found to get typeset boxes from TeXmacs for inclusion into PyX. What do you think? I would love to see Python (and PyX in particular) and TeXmacs meet! --=20 =C1lvaro Tejero Cantero http://alqua.com -- documentos libres free documents |
From: Andre W. <wo...@us...> - 2003-12-17 23:00:53
|
Hi Alvaro, On 16.12.03, Alvaro Tejero Cantero wrote: > I'm wondering whether PyX could be made to write to TeXmacs' > (http://texmacs.org) psdevice... The author of TeXmacs states that it's > easy to write an interface TeXmacs<->Python, and in fact many examples > of such interfaces exist > (http://www.texmacs.org/tmweb/plugins/plugins.en.html, also shell and > scheme). Conversely, perhaps a way could be found to get typeset boxes > from TeXmacs for inclusion into PyX. > > What do you think? I would love to see Python (and PyX in particular) > and TeXmacs meet! As you already mentioned, there are (at least) two different tasks related to TeXmacs one could think of. The first is writing a PyX plugin for TeXmacs. As I understand TeXmacs (I've just browsed thru the documentation for a while), it should be possible to embed the PostScript created from PyX directly into TeXmacs. While this sounds interesting, the main PyX development deals with some other, very important issues right now. (In case you are interested: We have started a new attribute handling and will hopefully be able to release it in 0.5 in January ... this will be an important step towards an even better design and handling and also towards a beta version ...) The other topic you mentioned is about the TeX output. You are right that it might be possible to insert a different mechanism for creating text in PyX. However, we have spend quite some time for really great TeX integration. Since we interpret the TeX outout (dvi) directly, we have a well done typesetter with all the nice features of TeX. This doesn't mean that different sources of typesetted text are not interesting at all, but this is not a major topic for us in the current state of development. However, it might not be so difficult to insert something, which puts PostScript into PyX (you can include PostScript by the epsfile module right away). But you will immediately see, that there are problems you have to deal with. For example the fonts should be collected into a global prolog in order to keep the resulting files efficient ... all those things guide you into the same direction like it is already done in the text module. And there we have an easy to parse output (dvi) and can handle everything else directly -- thus with the best control over the resulting PostScript. Note that there is an old, still working code for text creation via TeX *and* *dvips* in the module tex.py ... but this is a bad solution compared to what we have now. However it tells you that it is possible to embed those things into PyX right away ... André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |
From: Alvaro T. C. <al...@an...> - 2003-12-16 17:33:32
|
Hello, I'm starting to think that this might have also something to do with PyX. My evidence comes from a multipart book that I have written in LyX. The only chapter with eps figures coming from PyX is giving problems: I can convert to postscript with dvips, but then some of the pages are missing in gv. Strangely enough, if I print the last of the pages which is viewable through GV (and contains a PyX graph) I get the "hidden pages" (from number 4 to number 10 or so). This happened in a more radical flavour when I put the attached PyX graph in the cover of a LaTeX book: the only page showed by GV was precisely the cover (although I didn't do the printing test). So AFAIK something strange might be happening with PyX's eps output, do you have experienced this kind of problems? are my figures buggy? > This isn't a bug in dvipdfm per se, but it's a bug in the external > command that dvipdfm uses to convert EPS to PDF for embedded images. I > think the following change will fix your problem. If you can find the > dvipdfm "config" file, try changing the line: >=20 > D "zcat -f %i | gs -q -sPAPERSIZE=3Da0 -sDEVICE=3Dpdfwrite -dCompatibilit= yLevel=3D1.2 -dUseFlateCompression=3Dtrue -sOutputFile=3D%o - - >=20 > to=20 >=20 > D "epstopdf --outfile=3D%o %i" I haven't yet tested your fix Mark, because ironically, I know that epstopdf chokes with some of my figures (not the PyX ones, though). As what I'm writing is a kind of makefile (an "AAP recipe") for multiple format document compilation, I must find some general way to do it... Thank you very much for the prompt response, Mark, Regards, =E1lvaro. PS. I can post an URL for the mentioned document if that might help. (Mark - sorry for the duplicate) --=20 =C1lvaro Tejero Cantero http://alqua.com -- documentos libres free documents |
From: Andre W. <wo...@us...> - 2003-12-17 23:08:45
|
Hi Alvaro, On 16.12.03, Alvaro Tejero Cantero wrote: > I'm starting to think that this might have also something to do with > PyX. My evidence comes from a multipart book that I have written in LyX. > The only chapter with eps figures coming from PyX is giving problems: I > can convert to postscript with dvips, but then some of the pages are > missing in gv. Strangely enough, if I print the last of the pages which > is viewable through GV (and contains a PyX graph) I get the "hidden > pages" (from number 4 to number 10 or so). > > This happened in a more radical flavour when I put the attached PyX > graph in the cover of a LaTeX book: the only page showed by GV was > precisely the cover (although I didn't do the printing test). > > So AFAIK something strange might be happening with PyX's eps output, > > do you have experienced this kind of problems? are my figures buggy? Well, the PostScript code created by PyX should have a really good quality. We do have control over all the PostScript written to the eps output and we have tried to be very accurate regarding the standards. While there might be bugs in PyX leading to broken PostScript, we have used it ourselfs for several theses, posters, quite some papers ... the PostScript seems to be very robust (indeed, we do have much less problems with broken figures etc. since we use PyX ourself). On the other hand, we have observed strange behaviour of ghostscript from time to time when interpreting PostScript (independend of the source of the PostScript -- for PyX as well as for other sources). For example the pattern filling example creates strange output even with the most recent release of ghostscript (8.11). Many of these problems are related to the antialiasing mode of ghostscript. But this antialiasing can be turned off (in ghostview you can troggle it via "a"). This helps in a lot of cases. However, if your problem remains, it would be great to try to minimize the example. And then try to print it on different PostScript printers. Usually PostScript printers do have much less problems with interpreting the PostScript. But we've also observed bugs in PostScript interpreters built into printers ... which we could clearly identfy as bugs in the interpreter. André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |