After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 156171 - EPS+PSFrag produces better output than TeX+PSTricks
EPS+PSFrag produces better output than TeX+PSTricks
Status: RESOLVED INCOMPLETE
Product: dia
Classification: Other
Component: exports
0.94
Other All
: Normal normal
: ---
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2004-10-22 18:54 UTC by Felipe G. Nievinski
Modified: 2009-02-05 20:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample drawing and output. (50.49 KB, application/x-zip-compressed)
2004-10-22 19:00 UTC, Felipe G. Nievinski
Details

Description Felipe G. Nievinski 2004-10-22 18:54:25 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.
Comment 1 Felipe G. Nievinski 2004-10-22 19:00:07 UTC
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
Comment 2 Hans Breuer 2006-01-14 16:17:40 UTC
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.
Comment 3 André Klapper 2006-10-02 08:11:13 UTC
felipe, can you please respond to hans' last comment? thanks in advance.
Comment 4 Dan Gildea 2007-04-13 19:50:15 UTC
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.)
Comment 5 Tobias Mueller 2009-02-05 20:49:49 UTC
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!