Math & ScienceConnected Nodes in Matrices

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Connected Nodes in Matrices

Post by ghostanime2001 »

How do you use \Rnode, \rnode, \rput etc... inside matrices? I want to be able to connect one element to another element in different rows or columns. Also I want to set different styles for those elements. How do I use node connections with matrices? I receive an error.

Code: Select all

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

\begin{document}
  $
    \bordermatrix{%
        & a & b & c \cr
      A & \Rnode{a}{aA} & 0 & 0 \cr
      B & 0 & \Rnode{b}{bB} & 0 \cr
      C & 0 & 0 & \Rnode{c}{cC} \cr
    }
  $
  \ncline{a}{b}
\end{document}
Last edited by ghostanime2001 on Thu Jul 25, 2013 2:12 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
tommytex
Posts: 39
Joined: Wed Jan 23, 2013 10:04 pm

Re: Connected Nodes in Matrices

Post by tommytex »

Hi,

i think you have to let latex create the matrix first, then "overpaint" with tikz nodes, something like Alain Matthes' example:

http://www.texample.net/tikz/examples/m ... terminant/
(therefore use tikz matrix environment)

greez tommytex :geek:
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: Connected Nodes in Matrices

Post by ghostanime2001 »

I cannot use pstricks nodes ?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Connected Nodes in Matrices

Post by localghost »

The provided code example works fine for me when compiled via LaTeX→DVI→PS→PDF.
Attachments
qtmp.png
qtmp.png (2.1 KiB) Viewed 8618 times
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: Connected Nodes in Matrices

Post by ghostanime2001 »

can you post the code ?
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: Connected Nodes in Matrices

Post by cgnieder »

I think Thorsten means the code you posted. I tried it, too, and it worked for me as well, both compiled the way Thorsten mentioned and compilation vie XeLaTeX.

Regards
site moderator & package author
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: Connected Nodes in Matrices

Post by ghostanime2001 »

oh I see, I was compiling with pdflatex instead of xelatex. I re-compiled my code with xelatex and I produced the same result.
Post Reply