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 defined some small pstricks makro:

\begin{pspicture}(-5,-5)(5,5)
    \newcommand{\leftwall}{%
    \psline(-4,-4)(-4,4)
    \multips(-4,-3.5)(0,0.5){14}{\psline(0,0)(-1,1)}
    }
    \leftwall
\end{pspicture}

And now I want the output of \leftwall reflected, to produce something like \rightwall. In this specific situation, I could just change the signs of the x coordinates, but this is ugly. How can I do this in general? I'm looking for a command like \psrotate from the pstricks-add package where I can specify two points that define a line along which I can reflect my \leftwall.

share|improve this question
    
Please show me the minimal code and use CODE tag please :D –  xport Jan 1 '11 at 14:42
add comment

1 Answer

up vote 2 down vote accepted

extend the example in a case that \leftwall and \rightwall allow coordinates to get rid of the \rput

\documentclass{minimal}
\usepackage{pstricks}
\newcommand\leftwall{%  
  \psline(-4,-4)(-4,4) 
  \psframe[linestyle=none,fillstyle=vlines](-4,-4)(-4.75,4)}
\newcommand\rightwall{\psscalebox{-1 1}{\leftwall}}
\begin{document}

\begin{pspicture}(-5,-5)(5,5) 
 \leftwall \rput(0,0){\rightwall}
\end{pspicture} 

\end{document}

alt text

share|improve this answer
    
So the core of your answer (apart from other improvements to the code) is: Use \psscalebox{-1 1}{stuff}. Together with rotations, reflections on arbitrary lines can be made. –  Turion Jan 1 '11 at 17:23
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.