3

enter image description here

My code:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{vietnam}
\usepackage{amsmath,amssymb,mathptmx}
\usepackage{pstricks,pst-node} % required package
\usepackage{auto-pst-pdf} 
\begin{document}
\begin{pspicture}
\psmatrix[,colsep=1.5cm]
                  & [mnode=circle] X \\
[mnode=oval] ABCD &  \psframebox[framearc=.3]{E}
 \endpsmatrix
 \psset{nodesep=3pt,nrot=:U}
 \ncline{1,2}{2,1}
 \nbput{abcd}
 \ncline{<-}{1,2}{2,2}
 \ncput*{ch}
 \ncline[linestyle=dotted]{2,1}{2,2}
 \nbput{dcba}
 \end{pspicture}
 \end{document}

enter image description here

How to rotate "abcd" like "above"? Is there another way?

 \nbput->\naput. 

The result as the following:

enter image description here

3

Just swap the linked nodes and change \nbput to \naput:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{vietnam}
\usepackage{amsmath,amssymb,mathptmx}
\usepackage{pstricks,pst-node} % required package
\usepackage{auto-pst-pdf}

\begin{document}

\begin{pspicture}
\psmatrix[,colsep=1.5cm]
                  & [mnode=circle] X \\
[mnode=oval] ABCD & \psframebox[framearc=.3]{E}
 \endpsmatrix
 \psset{nodesep=3pt,nrot=:U}
 \ncline{2,1}{1,2}
 \naput{abcd}
 \ncline{<-}{1,2}{2,2}
 \ncput*{ch}
 \ncline[linestyle=dotted]{2,1}{2,2}
 \nbput{dcba}
 \end{pspicture}

 \end{document} 

enter image description here

  • you also have to change the order of the nodes. Compare the example code from Bernhard: \ncline{2,1}{1,2} – user2478 Nov 28 '18 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy