# cline, offset

Denis Girou Denis.Girou at idris.fr
Tue Sep 19 12:47:04 CEST 2000

-----------------------------------------------------------------------------
This is the PSTricks mailing list, devoted to discussions about computational
graphics in (La)TeX using the PSTricks package from Timothy van Zandt.
For help using this mailing list, see instructions at the end of message.
-----------------------------------------------------------------------------

>>>>> "Bernd.Brandt" == Bernd Brandt <bernd at bio.vu.nl> writes:

Bernd.Brandt> A few months ago i received a way to draw nodes with labels.
Bernd.Brandt> I have constructed a psmatrix withtwo lines with an offset now.
Bernd.Brandt> How can i make the labels, which are put below and above the line,
Bernd.Brandt> follow the offset? Furthermore i used a dummy node, with a fixed
Bernd.Brandt> position where it should connect with the line. Is there a way to
Bernd.Brandt> automate this as well? (depending on the colsep, rowsep, and offset?

Bernd.Brandt> ...

Bernd.Brandt> % LABELS DO NOT 'OBEY' OFFSET
Bernd.Brandt>   \ncline{E00}{E01}^{$\lambda_A$}_{\rnode{XA1}{$A$}}

Bernd.Brandt> ...

Bernd.Brandt> %This is the fixed dummy node:
Bernd.Brandt>   \ncput[npos=0.9]{\pnode{X1}}
Bernd.Brandt>   \nccurve[nodesepA=0.1,nodesepB=0,ncurv=0.6,angleA=30, angleB=200]{-}{XA1}{X1}

If I understand correctly your questions, this is only because you use

Documentation page 26 (betadoc2) say that inside the psmatrix environment,
the parameter "shortput" is set to the "tablr" value (it is written "tab",
but I correct this information in the file obsolete/doc/pst-doc.err - and it
doesn't matter here). That is to say that the shortcut symbols ^,_,<,> refer
to the \t.put variants of node connections. In a psmatrix environment, they
work as expected with the "colsep" and "rowsep" parameters, but you are right
that the result look strange when the "offset" parameter vary (this is because
with \taput and \tbput, only the vertical position vary when "offset" vary).
So, you must use in your case the \n.put variants.

See the effects on the next short examples.

D.G.

\documentclass[a4paper]{article}

\usepackage{pst-node}

\pagestyle{empty}

\begin{document}

\psset{colsep=2,rowsep=1,mnode=circle}

\begin{psmatrix}
& A \\
B
\ncline{2,1}{1,2}^{x}_{y}
\end{psmatrix}
%
\hfill
\begin{psmatrix}
& A \\
B
\ncline[offset=1.5]{2,1}{1,2}^{x}_{y}
\end{psmatrix}
%
\hfill
\begin{psmatrix}
& A \\
B
\ncline[offset=-0.5]{2,1}{1,2}^{x}_{y}
\end{psmatrix}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\vspace{2cm}

\begin{psmatrix}
& A \\
B
\end{psmatrix}
\ncline{2,1}{1,2}\naput{x}\nbput{y}
%
\hfill
\begin{psmatrix}
& A \\
B
\end{psmatrix}
\ncline[offset=1.5]{2,1}{1,2}\naput{x}\nbput{y}
%
\hfill
\begin{psmatrix}
& A \\
B
\end{psmatrix}
\ncline[offset=-0.5]{2,1}{1,2}\naput{x}\nbput{y}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\vspace{2cm}
\SpecialCoor
\psset{offset=1}

\begin{psmatrix}
& A \\
B
\ncline{2,1}{1,2}^{x}_{\rnode{N1}{y}}
\end{psmatrix}
\ncput[npos=0.9]{\pnode{N2}}
\psline[linecolor=red](N1)(N2)
%
\hfill
\begin{psmatrix}
& A \\
B
\end{psmatrix}
\ncline{2,1}{1,2}\naput{x}\nbput{\rnode{N1}{y}}
\ncput[npos=0.9]{\pnode{N2}}
\psline[linecolor=red](N1)(N2)
%
\hfill
\begin{psmatrix}[colsep=-2,rowsep=3]
& A \\
B
\end{psmatrix}
\ncline{2,1}{1,2}\naput{x}\nbput{\rnode{N1}{y}}
\ncput[npos=0.9]{\pnode{N2}}
\psline[linecolor=red](N1)(N2)

\end{document}

-----------------------------------------------------------------------------