Bug with EPStoTeX environment and attached labels?
Denis Girou
Denis.Girou at idris.fr
Fri Sep 4 23:02:46 CEST 1998
-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------
>>>>> "Torsten.Hilbrich" == Torsten Hilbrich <Torsten.Hilbrich at gmx.net> writes:
Torsten.Hilbrich> I have a problem with the n[abc]put command in my drawings. I was able
Torsten.Hilbrich> to produce a rather short example:
Torsten.Hilbrich> \documentclass{article}
Torsten.Hilbrich> \usepackage{pst-all}
Torsten.Hilbrich> \pagestyle{empty}
Torsten.Hilbrich> \begin{document}
Torsten.Hilbrich> \begin{TeXtoEPS}
Torsten.Hilbrich> \psxunit=3cm
Torsten.Hilbrich> \psyunit=2cm
Torsten.Hilbrich> \begin{pspicture}(0.5,0.5)(2.5,1.5)
Torsten.Hilbrich> % \psgrid
Torsten.Hilbrich> \rput(1,1){\rnode{1}{1}}
Torsten.Hilbrich> \rput(2,1){\rnode{2}{2}}
Torsten.Hilbrich> \ncline{->}{1}{2}
Torsten.Hilbrich> \ncput*{Test}
Torsten.Hilbrich> \end{pspicture}
Torsten.Hilbrich> \end{TeXtoEPS}
Torsten.Hilbrich> \end{document}
Torsten.Hilbrich> If I set this example the resulting bounding box is too large (the
Torsten.Hilbrich> origin (0,0) is always included into the bounding box). If I remove
Torsten.Hilbrich> the \ncput* line, the bounding box is correct.
Torsten.Hilbrich> ...
Torsten.Hilbrich> If you have any idea, what I can do to solve the problem, please tell
Torsten.Hilbrich> me. I tried the \naput, \nbput commands too, but they produces
Torsten.Hilbrich> exactly the same result. I really need to attach this kind of text in
Torsten.Hilbrich> my original drawings.
It is not a so easy question and I take time to understand exactly where and
why this occur. My answer is clear: "this is not a bug but a feature" (that is
to say an unfortunate limitation...). Problem come from the way \n[abc]put
works.
In fact, it is not so surprising and is clearly in the scope of what the
documentation says. Reread the comments of the TeXtoEPS environment page 80:
"... dvips will again try to find a tight bounding box ... If the bounding box
still isn't right, then you will have to edit the specification in the EPS
file by hand."
It's work correctly, as you see, for \rput macros (at least for cartesian
coordinates, as in your case!) because, if we look at the code, we can see
that the information about positionning is defined and so, known, at the TeX
level. So dvips is able to understand and use it during the computation of the
bounding box when using the -E option.
But \n[abc]put doesn't work at all on this way as it is related to nodes.
So, as we can see in the code, the positionning is defined at the PostScript
level and is the result of some computations made by the PostScript
interpreter. So, obviously, dvips can't have the relevant information and is
definitely unable to compute the correct bounding box in such cases.
We can easily verify it for instance. The following code will give a correct
answer with the accurate bounding box:
\begin{TeXtoEPS}
\rput(1,1){\rnode{1}{1}}
\rput(2,1){\rnode{2}{2}}
\ncline{->}{1}{2}
\end{TeXtoEPS}
The next one which do the same will be uncorrect, as the bounding box cannot
be computed correctly by dvips, as we use an intermediate node...
\begin{TeXtoEPS}
\pnode(1,1){A}
\SpecialCoor
\rput(A){\rnode{1}{1}}
\rput(2,1){\rnode{2}{2}}
\ncline{->}{1}{2}
\end{TeXtoEPS}
P.S. \naput and \nbput are just different interfaces which called the same
lower level mechanism, so it is logical that the problem is the same than with
\ncput.
D.G.
-----------------------------------------------------------------------------
The list interface (subscription, information, access to the archives) is on:
http://www.tug.org/cgi-bin/lwgate/pstricks
Otherway to unsubscribe, send mail to pstricks-request at mail.tug.org
with a blank subject and in body the line unsubscribe <email-address>
-----------------------------------------------------------------------------
More information about the PSTricks
mailing list