From: Woody Wu <narkewoody@gm...>  20130108 08:52:15

Hi, Supposse I have two matrix, left one is A and right one is B, each of them contains a column of nodes. Then I want to align the A and B. Case 1: To align top of B with top of A. I did something like: \node (B) [matrix, anchor=north west, right=of A.north east, matrix of nodes ....] { ... }; But this doesn't work, it seems that the 'anchor' setting for the matrix is not taking effets. Case 2: To align the first cell (a node) in B with the second cell (a node) in A. For this, I totally have no idea. Could anyone please help me? Thanks in advance.  woody I can't go back to yesterday  because I was a different person then. 
From: Stefan Pinnow <MoG<ul@gm...>  20130108 20:04:15
Attachments:
smime.p7s

Hello Woody, I think you can find both answers in the pgf manual (v2.10) on page 208. Please find attached also a minimal example. Best regards, Stefan Pinnow %  minimal example  \documentclass{article} \usepackage{tikz} \usetikzlibrary{ matrix, positioning, } \begin{document} \begin{tikzpicture} % create matrix `A' \matrix [ matrix of nodes, ] (A) { aa & ba & ca & da \\ ab & bb & cb & db \\ }; % create matrix `B' % align both matrices at the top \matrix [ matrix of nodes, matrix anchor=north west, right=0pt of A.north east, ] (B) { aa & ba \\ ab & bb \\ ac & bc \\ ad & bd \\ }; % show that matrix `A' and `B' are aligned at the top \fill [green] (A.north east) circle (3pt); \fill [red] (B.north west) circle (2pt); % create matrix `C' \matrix [ matrix of nodes, matrix anchor=test.center, right=2cm of B32, ] (C) { aa & ba & ca & da \\ ab & (test) bb & cb & db \\ }; % show that `C22' (= `test') is placed 2cm right of `B32' \fill [blue] (test.west) circle (1pt); \fill [orange] (B32.east) circle (1pt); \draw [help lines] (B32)  +(2cm,0); \end{tikzpicture} \end{document} %  > Original Message > From: Woody Wu [mailto:narkewoody@...] > Sent: Tuesday, January 08, 2013 9:51 AM > To: pgfusers > Subject: [Pgfusers] How to align matrixes > > Hi, > > Supposse I have two matrix, left one is A and right one is B, each of them > contains a column of nodes. Then I want to align the A and B. > > Case 1: To align top of B with top of A. I did something like: > \node (B) [matrix, anchor=north west, right=of A.north east, matrix > of nodes ....] { ... }; > > But this doesn't work, it seems that the 'anchor' setting for the > matrix is not taking effets. > > Case 2: To align the first cell (a node) in B with the second cell (a > node) in A. For this, I totally have no idea. > > Could anyone please help me? Thanks in advance. > >  > woody > I can't go back to yesterday  because I was a different person then. 
From: Woody Wu <narkewoody@gm...>  20130109 00:53:31

Hi, Stefan It's great! Thanks for the example! woody On Tue, Jan 08, 2013 at 09:04:08PM +0100, Stefan Pinnow wrote: > Hello Woody, > > I think you can find both answers in the pgf manual (v2.10) on page 208. > Please find attached also a minimal example. > > Best regards, > Stefan Pinnow > > %  minimal example  > \documentclass{article} > \usepackage{tikz} > \usetikzlibrary{ > matrix, > positioning, > } > \begin{document} > \begin{tikzpicture} > % create matrix `A' > \matrix [ > matrix of nodes, > ] (A) { > aa & ba & ca & da \\ > ab & bb & cb & db \\ > }; > > % create matrix `B' > % align both matrices at the top > \matrix [ > matrix of nodes, > matrix anchor=north west, > right=0pt of A.north east, > ] (B) { > aa & ba \\ > ab & bb \\ > ac & bc \\ > ad & bd \\ > }; > > % show that matrix `A' and `B' are aligned at the top > \fill [green] (A.north east) circle (3pt); > \fill [red] (B.north west) circle (2pt); > > % create matrix `C' > \matrix [ > matrix of nodes, > matrix anchor=test.center, > right=2cm of B32, > ] (C) { > aa & ba & ca & da \\ > ab & (test) bb & cb & db \\ > }; > > % show that `C22' (= `test') is placed 2cm right of `B32' > \fill [blue] (test.west) circle (1pt); > \fill [orange] (B32.east) circle (1pt); > > \draw [help lines] (B32)  +(2cm,0); > > \end{tikzpicture} > \end{document} > %  > > > > Original Message > > From: Woody Wu [mailto:narkewoody@...] > > Sent: Tuesday, January 08, 2013 9:51 AM > > To: pgfusers > > Subject: [Pgfusers] How to align matrixes > > > > Hi, > > > > Supposse I have two matrix, left one is A and right one is B, each of them > > contains a column of nodes. Then I want to align the A and B. > > > > Case 1: To align top of B with top of A. I did something like: > > \node (B) [matrix, anchor=north west, right=of A.north east, matrix > > of nodes ....] { ... }; > > > > But this doesn't work, it seems that the 'anchor' setting for the > > matrix is not taking effets. > > > > Case 2: To align the first cell (a node) in B with the second cell (a > > node) in A. For this, I totally have no idea. > > > > Could anyone please help me? Thanks in advance. > > > >  > > woody > > I can't go back to yesterday  because I was a different person then. >  > Master SQL Server Development, Administration, TSQL, SSAS, SSIS, SSRS > and more. Get SQL Server skills now (including 2012) with LearnDevNow  > 200+ hours of stepbystep video tutorials by Microsoft MVPs and experts. > SALE $99.99 this month only  learn more at: > http://p.sf.net/sfu/learnmore_122512 > _______________________________________________ > pgfusers mailing list > pgfusers@... > https://lists.sourceforge.net/lists/listinfo/pgfusers  woody I can't go back to yesterday  because I was a different person then. 