Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I just tried this code to check whether both cases result in the same output. Apparently they are not identical. Why?

\documentclass[dvipsnames,cmyk]{minimal}
\usepackage[a4paper,margin=6cm]{geometry}
\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{graphicx}

\newpsstyle{gridstyle}{%
gridwidth=0.4pt,%default: 0.8pt
gridcolor=Red!20,%default: black
griddots=0,%default: 0 
%
gridlabels=5pt,%default: 10pt
gridlabelcolor=Blue,%default: black
%
subgriddiv=5,%default: 5
subgridwidth=0.2pt,%default: 0.4pt
subgridcolor=Green!20,%default: gray
subgriddots=0%default: 0
}
\psset{style=gridstyle}


\begin{document}
\pspicture(7,7)
\psgrid
\rput(2,2){\scalebox{2}{\pscircle{1}}}
\endpspicture

\vspace{1cm}

\pspicture(7,7)
\psgrid
\scalebox{2}{\rput(2,2){\pscircle{1}}}
\endpspicture
\end{document}

Could you elaborate how \psscalebox and \rput do their jobs internally?

share|improve this question
add comment

2 Answers

Why should this be the same?

  • first scaling effects everything, also the coordinates

  • first setting, then scaling doesn't effect the coordinates

However, use \psscalebox when using pstricks.

share|improve this answer
    
\scalebox{} does the same behavior as \psscalebox when they are used in PSTricks. I just tried. –  xport Jan 11 '11 at 15:32
    
@xport: parameter setting for x y scaling is different. And it makes more sense to use the macros from PSTricks here –  Herbert Jan 11 '11 at 15:43
    
I understood now. I forgot that the composition of translation and scaling is not commutative. :-) –  xport Jan 11 '11 at 15:50
add comment
up vote 0 down vote accepted

alt text

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.