[pstricks] pspicture: shift and nesting
Bernd Westphal
Bernd.Westphal at Informatik.Uni-Oldenburg.DE
Mon Jul 10 19:05:20 CEST 2006
Moin.
The appended example illustrates a problem I have with nested pspicture
environments. If an enclosing pspicture uses the shift parameter, then the
enclosed pspicture environments are also affected.
I would expect the appended example to provide three different ways to produce
the same thing:
- a coordinate system with the origin at the baseline of enclosing text
- a black rectangle of roughly the size 0.5x1 at (1,1) relative to the origin,
possibly a slightly smaller blue rectangle lying within
Actually only the first version does it.
In the second case, the origin of the coordinate system is not at the baseline.
And in the third case the nested pspicture seems to extend from 0 to 2 in
y-direction while it should be only 0.5 units in height.
Why is this?
Or is it in general a bad idea to nest pspicture environments? I actually
often use macros that draw symbols within a pspicture environment and then
place multiple copies of these symbols within a larger pspicture environment.
Regards,
Bernd
- - - - - - - -
My environment is as follows. An ad-hoc switch to pstricks 1.14 didn't
change the behaviour:
This is pdfeTeXk, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
%&-line parsing enabled.
entering extended mode
(./a.tex
LaTeX2e <2003/12/01>
Babel <v3.8g> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, basque, bulgarian, coptic, welsh, czech, slovak, german, ngerman, d
anish, spanish, catalan, estonian, finnish, french, greek, monogreek, ancientgr
eek, croatian, hungarian, interlingua, ibycus, indonesian, icelandic, italian,
latin, mongolian, dutch, norsk, polish, portuguese, pinyin, romanian, russian,
slovene, uppersorbian, serbian, swedish, turkish, ukenglish, ukrainian, loaded.
(/usr/local/texlive/2005/texmf-dist/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/local/texlive/2005/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2005/texmf-dist/tex/latex/pstricks/pstricks.sty
(/usr/local/texlive/2005/texmf-dist/tex/generic/pstricks/pstricks.tex
`PSTricks' v1.12 <2005/10/25> (tvz)
(/usr/local/texlive/2005/texmf-dist/tex/generic/pstricks/pstricks.con))
(/usr/local/texlive/2005/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/local/texlive/2005/texmf/tex/latex/config/color.cfg)
(/usr/local/texlive/2005/texmf-dist/tex/latex/graphics/dvips.def)))
(/usr/local/texlive/2005/texmf-dist/tex/latex/pstricks/pst-plot.sty
(/usr/local/texlive/2005/texmf-dist/tex/generic/pstricks/pst-plot.tex
v97 patch 2, 1999/12/12
(/usr/local/texlive/2005/texmf-dist/tex/generic/multido/multido.tex
v1.41, 2004/05/18 <tvz>))) (./a.aux) [1] (./a.aux)
*File List*
article.cls 2004/02/16 v1.4f Standard LaTeX document class
size11.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
pstricks.sty 2005/10/07 v0.25 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex 2005/10/25 v1.12 `PSTricks' (tvz)
xcolor.sty 2005/10/15 v2.06 LaTeX color extensions (UK)
color.cfg 2001/08/31 v1.1 color configuration of teTeX/TeXLive
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pst-plot.sty 2004/07/15 package wrapper for pst-plot.tex
pst-plot.tex 2004/05/18 1.41 `pst-plot' (tvz)
***********
)
Output written on a.dvi (1 page, 5620 bytes).
Transcript written on a.log.
- - 8< - - -
\listfiles
\documentclass[a4paper,11pt]{article}
\usepackage{pstricks}
\usepackage{pst-plot}
\begin{document}
\rule{1cm}{2pt}\begin{pspicture}[shift=-2\psyunit](0,-2)(3,3)
\psaxes(0,0)(0,-2)(3,3)
\rput(1,1){\psframe(-0.5,0.25)(0.5,-0.25)}
\end{pspicture}\rule{1cm}{2pt}
\bigskip
\rule{1cm}{2pt}\begin{pspicture}[shift=-2\psyunit](0,-2)(3,3)
\psaxes(0,0)(0,-2)(3,3)
\rput(1,1){%
\psframebox{\begin{pspicture}[shift=0](-0.5,0.25)(0.5,-0.25)
\psframe[linecolor=blue](-0.5,0.25)(0.5,-0.25)
\end{pspicture}}}
\end{pspicture}\rule{1cm}{2pt}
\bigskip
\rule{1cm}{2pt}\begin{pspicture}[shift=-2\psyunit](0,-2)(3,3)
\psaxes(0,0)(0,-2)(3,3)
\rput(1,1){%
\psframebox{\begin{pspicture}(-0.5,0.25)(0.5,-0.25)
\psframe[linecolor=blue](-0.5,0.25)(0.5,-0.25)
\end{pspicture}}}
\end{pspicture}\rule{1cm}{2pt}
\end{document}
More information about the PSTricks
mailing list