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'm trying to create a diagram in the psmatrix environment which has a double line connecting to a node and then has two separate lines coming from the node, one line coming from each of the two double lines.

Here is a MWE:

    \documentclass{article}

    \usepackage{pst-node}

    \begin{document}

    \begin{figure}[H]
    \centering
    $\psmatrix[colsep=0.3cm,rowsep=.4cm,mnode=circle]
    [mnode=dot,dotscale=.00001] \\
    [mnode=dot,dotscale=.00001] & [mnode=dot,dotscale=.00001] & [mnode=dot,dotscale=.00001] \\
    [mnode=r] && [mnode=r]
    \ncline[doubleline=true]{1,1}{2,2}
    \ncline{2,2}{3,1}
    \ncline{2,2}{3,3}
    \psset{linestyle=dashed}\ncline{2,1}{2,3}
    \endpsmatrix
    $
    \end{figure}

    \end{document}

It is working how I want to with the double line, however the lines from (2,2) to (3,1) and from (2,2) to (3,3) are coming from the same part of the node at (2,2). I want the line from (2,2) to (3,1) to connect to the left-hand line from the doubleline and the line from (2,2) to (3,3) to connect to the right-hand line from the doubleline.

I am processing the file through LaTeX -> PS -> PDF.

share|improve this question
1  
Welcome to the TeX.SX, meta.tex.stackexchange.com/questions/1436/welcome-to-tex-sx! Could you please post a complete example starting with \documentclass... and ending with \end{document} plus a note how you are processing the file. It will help us tremendously. –  Malipivo Mar 28 at 5:31
    
I've made an edit. Thanks. –  Jonathan Mar 28 at 6:02

2 Answers 2

The easiest way to achieve your goal is to offset each of the \nclines:

enter image description here

\documentclass{article}

\usepackage{pst-node}

\begin{document}

\psmatrix[colsep=0.3cm,rowsep=.4cm,mnode=circle]
  [mnode=dot,dotscale=.00001] \\
  [mnode=dot,dotscale=.00001] & [mnode=dot,dotscale=.00001] & [mnode=dot,dotscale=.00001] \\
  [mnode=r] && [mnode=r]
  \ncline[doubleline=true]{1,1}{2,2}
  \ncline[offset=-\pslinewidth]{2,2}{3,1}
  \ncline[offset=\pslinewidth]{2,2}{3,3}
  \psset{linestyle=dashed}\ncline{2,1}{2,3}
\endpsmatrix

\end{document}
share|improve this answer
    
This works how I want it to. Thank you! –  Jonathan Apr 1 at 3:24

I do not understand the sense of [mnode=dot,dotscale=.00001]. However, you can also use \psline for a connection over three nodes:

\documentclass{article}
\usepackage{pst-node}

\begin{document}

    $\psmatrix[colsep=0.3cm,rowsep=.4cm,mnode=circle]
     [mnode=p,name=A]\\
     [mnode=p] & [mnode=p,name=B] & [mnode=p]\\
     [mnode=r,name=C] && [mnode=r,name=D]
     \psline(A)(B)(C)
     \pcline[offset=1mm](A)(D)
     \ncline[linestyle=dashed]{2,1}{2,3}
    \endpsmatrix
    $

\end{document}

enter image description here

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.