## pgf-users

 [Pgf-users] How to align matrixes From: Woody Wu - 2013-01-08 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. 
 Re: [Pgf-users] How to align matrixes From: Stefan Pinnow - 2013-01-08 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 B-3-2, ] (C) { aa & ba & ca & da \\ ab & |(test)| bb & cb & db \\ }; % show that C-2-2' (= test') is placed 2cm right of B-3-2' \fill [blue] (test.west) circle (1pt); \fill [orange] (B-3-2.east) circle (1pt); \draw [help lines] (B-3-2) -- +(2cm,0); \end{tikzpicture} \end{document} % --------------------------- > -----Original Message----- > From: Woody Wu [mailto:narkewoody@...] > Sent: Tuesday, January 08, 2013 9:51 AM > To: pgf-users > Subject: [Pgf-users] 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. 
 Re: [Pgf-users] How to align matrixes From: Woody Wu - 2013-01-09 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 B-3-2, > ] (C) { > aa & ba & ca & da \\ > ab & |(test)| bb & cb & db \\ > }; > > % show that C-2-2' (= test') is placed 2cm right of B-3-2' > \fill [blue] (test.west) circle (1pt); > \fill [orange] (B-3-2.east) circle (1pt); > > \draw [help lines] (B-3-2) -- +(2cm,0); > > \end{tikzpicture} > \end{document} > % --------------------------- > > > > -----Original Message----- > > From: Woody Wu [mailto:narkewoody@...] > > Sent: Tuesday, January 08, 2013 9:51 AM > > To: pgf-users > > Subject: [Pgf-users] 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, T-SQL, SSAS, SSIS, SSRS > and more. Get SQL Server skills now (including 2012) with LearnDevNow - > 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > SALE \$99.99 this month only - learn more at: > http://p.sf.net/sfu/learnmore_122512 > _______________________________________________ > pgf-users mailing list > pgf-users@... > https://lists.sourceforge.net/lists/listinfo/pgf-users -- woody I can't go back to yesterday - because I was a different person then.