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.

The left triangle is the image of the right triangle about the vertical line in between them as the mirror.

I only want geometric objects and label position (but excluding their labels) to be reflected. How can I prevent the labels of the left triangle from being reflected?

\documentclass[pstricks,border=12pt,12pt]{standalone}
\usepackage{pst-node}

\def\Right#1{%
    \pnodes(1,1){#11}(3,1){#12}(1,4){#13}
    \pspolygon(#11)(#12)(#13)
    \uput[180](#11){A}
    \uput[0](#12){B}
    \uput[180](#13){C}
}
\begin{document}
\begin{pspicture}(-4,0)(4,5)
    \Right{A}
    \psscalebox{-1 1}{\Right{B}}
\end{pspicture}
\end{document}

enter image description here

The output I want to get is as follows.

enter image description here

Note

Please don't suggest me to separate the left and right object by defining an individual macro for each because my real scenario needs reflection technique and I also want to adopt the DRY principle (Don't Repeat Yourself!).

Edit

I tried the following

\rput{*0}(!N-#11.x .3 sub N-#11.y){A}
\rput{*0}(!N-#12.x .3 add N-#12.y){B}
\rput{*0}(!N-#13.x .3 sub N-#13.y){C}

but it does not help.

I also tried the following but it does not help.

\documentclass[pstricks,border=12pt,12pt]{standalone}
\usepackage{pst-node}
%\psset{saveNodeCoors}
\def\Right#1{%
    \pnodes(1,1){#11}(3,1){#12}(1,4){#13}
    \pspolygon(#11)(#12)(#13)
    %\rput{*0}(!N-#11.x .3 sub N-#11.y){A}
    %\rput{*0}(!N-#12.x .3 add N-#12.y){B}
    %\rput{*0}(!N-#13.x .3 sub N-#13.y){C}
    \uput[180](#11){A}
    \uput[0](#12){B}
    \uput[180](#13){C}
}
\begin{document}
\begin{pspicture}(-4,0)(4,5)
    \Right{A}
    \pscustom
    {
        \code{-1 1 scale}
        \Right{B}
    }
\end{pspicture}
\end{document}
share|improve this question
    
The macro \psscalebox is a box scaling macro. That means the content is save in an lrbox and modified by the given parameters. –  Marco Daniel Feb 22 at 11:10
    
@MarcoDaniel: I tried with \code{-1 1 scale} but it does not help as well. –  In PSTricks we trust Feb 22 at 11:12
    
I think the package pst-optic is more suitable for your needs. –  Marco Daniel Feb 22 at 11:25

1 Answer 1

up vote 4 down vote accepted
\documentclass[pstricks,border=12pt,12pt]{standalone}
\usepackage{pst-node}

\newcommand\Right[2][1 1]{%
  \psscalebox{#1}{%
    \pnodes(1,1){#21}(3,1){#22}(1,4){#23}%
    \pspolygon(#21)(#22)(#23)%
    \uput[180](#21){\psscalebox{#1}{A}}%
    \uput[0](#22){\psscalebox{#1}{B}}%
    \uput[180](#23){\psscalebox{#1}{C}}%
}}
\begin{document}
\begin{pspicture}(-4,0)(4,5)
    \Right{A}
    \Right[-1 1]{B}
\end{pspicture}
\end{document}
share|improve this answer

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.