GNOME Bugzilla – Bug 156171
EPS+PSFrag produces better output than TeX+PSTricks
Last modified: 2009-02-05 20:49:49 UTC
The Dia FAQ states that to use mathematical formulas in Dia drawings you should export the drawing to TeX PSTricks macros format and use LaTeX package PSTricks. But the output of the same drawing exported to EPS and using the LaTeX package PSFrag is much better (see attached files). Therefore I suggest that the FAQ be changed accordingly. Please check attached my files with sample output.
Created attachment 32939 [details] Sample drawing and output. The zip file contains the following files: geometria_dif_dist_2d.dia Dia drawing geometria_dif_dist_2d.eps Dia drawing exported to EPS (using PS fonts) geometria_dif_dist_2d.tex Dia drawing exported to TeX PSTricks macros test-eps_psfrags.ps Output of LaTeX using EPS+PSFrags test-eps_psfrags.tex LaTeX document that uses .eps figure test-tex_pstricks.ps Output of LaTeX using TeX+PSTricks test-tex_pstricks.tex LaTeX document that uses .tex figure
Thanks for the nice samples which finally allowed me to reproduce and fix some other longstanding bug: 2006-01-14 Hans Breuer <hans@breuer.org> * plug-ins/pstricks/render_pstricks.c(draw_string) : now that I've found the nice samples from bug #156171 it was quite simple to confirm that the y value need indeed to be inverted. Fixes bug #304974. Also special case strings starting with \tex - i.e. dont escape them - to keep the use-case of direct tex input. Now - with Dia cvs - I can produce a dvi file from pstricks which looks as right as your EPS+PSFrags output. But using dvipdf on it screws coordinates again. Isn't screwing the some positions the only issue in your sample, i.e. the textrendering works equally well for both cases? If there is more to be fixed on Dia's pstricks output I'd need some help on tex commands. Thinking that both ways should work I'm moving this from the doc component to export.
felipe, can you please respond to hans' last comment? thanks in advance.
In general, pstricks images should not be expected to look right in xdvi. xdvi even prints a warning to this effect: xdvi-xaw3d.bin: Warning: Raw Postscript commands on page 2 may be rendered incorrectly. xdvi tries its best to render embedded postscript, but knows it can't get it completely right. Hans's fix of inverting the y co-ordinates fixes the xdvi rendering, but breaks the postscript, which is actually the important thing. I don't think the original poster was complaining about the position of the text labels. The lines in the image are slightly misplaced - the corners don't meet where they are supposed to. I was able to fix this problem by adding a "%" character at the end of each line containing a \newrgbcolor command. % diff pstricks/render_pstricks.c.2007-4-13 pstricks/render_pstricks.c 219c219 < fprintf(renderer->file, "\\newrgbcolor{dialinecolor}{%s %s %s}\n", --- > fprintf(renderer->file, "\\newrgbcolor{dialinecolor}{%s %s %s}%%\n", 233c233 < fprintf(renderer->file, "\\newrgbcolor{diafillcolor}{%s %s %s}\n", --- > fprintf(renderer->file, "\\newrgbcolor{diafillcolor}{%s %s %s}%%\n", 794c794 < pstricks_dtostr(py_buf,-pos->y), --- > pstricks_dtostr(py_buf,pos->y), (As a side comment, I liked it better when the pstricks exporter didn't escape tex commands - the primary reason to use this exporter rather than just saving to postscript is to be able to use tex commands.)
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!