diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex | 111 |
1 files changed, 56 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex index f3158456ebe..50c0e1e52f7 100644 --- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex @@ -9,7 +9,7 @@ \ProvidesFileRCS{pgfmodulematrix.code.tex} -\usepgfmodule{shapes} +\usepgfmodule{shapes}% \newif\ifpgfmatrix \newif\ifpgf@matrix@correct@call @@ -37,17 +37,17 @@ % % \pgfsetmatrixrowsep{5pt} -\def\pgfsetmatrixrowsep#1{\def\pgfmatrixrowsep{#1}} -\def\pgfsetmatrixcolumnsep#1{\def\pgfmatrixcolumnsep{#1}} +\def\pgfsetmatrixrowsep#1{\def\pgfmatrixrowsep{#1}}% +\def\pgfsetmatrixcolumnsep#1{\def\pgfmatrixcolumnsep{#1}}% -\def\pgfmatrixrowsep{0pt} -\def\pgfmatrixcolumnsep{0pt} +\def\pgfmatrixrowsep{0pt}% +\def\pgfmatrixcolumnsep{0pt}% % The pgfmatrix command creates a node that contains a matrix. Like % the \pgfnode command, it is to be used inside a pgfpicture -% environment. +% environment. % % #1 = shape type % #2 = anchor @@ -59,12 +59,12 @@ % % Description: % -% This command creates a node that contains a matrix. For +% This command creates a node that contains a matrix. For % each cell of the matrix, drawing commands may be given. These % commands will create a cell picture and a bounding box is computed % for each cell picture. The cell picture is then placed inside the % cell. The position inside the cell is computed according to the -% following rules: +% following rules: % % 1. In each column, the origins of the cell pictures are all on a % vertical line. @@ -79,7 +79,7 @@ % inside a node whose name is given as #3, whose shape is #1, and % whose anchor is #2. This means that the resulting node is shifted % such that the given anchor lies at the origin. Then, as for a normal -% node, the #4 path usage command is used for the node. +% node, the #4 path usage command is used for the node. % % The parameter #5 is an additional negative shift for the node. Normally, such % a shift could be given beforehand (that is, the shift could be @@ -90,7 +90,7 @@ % positions in the matrix box. The origin of this coordinate system is % at the left baseline end of the matrix box, which corresponds to the % text anchor. The position #5 is then interpreted inside this -% coordinate system and then used for shifting. +% coordinate system and then used for shifting. % % The idea behind using the parameter #5 is the following: If you % specify "text" as anchor #2 and specify \pgfpointanchor{inner @@ -113,15 +113,15 @@ % % Lines are ended using the command \pgfmatrixendrow. The command \\ % is \let to be the same, but \\ is sometimes overridden by, say, -% minipage, so it's good to have \pgfmatrixendrow as a "fallback". +% minipage, so it's good to have \pgfmatrixendrow as a "fallback". % % Inside the matrix, \\ must be used to end every line ***including % the last***. You can pass an optional parameter to \\ as in \\[2pt] % to give an additional space after this particular line. % -% The usage of \\ at the end of the matrix is imporant since this +% The usage of \\ at the end of the matrix is important since this % command is used to find the end of the matrix. What happens is that -% \\ followed by a closing brace ends the matrix. +% \\ followed by a closing brace ends the matrix. % % Inside the matrix, you must use \pgfmatrixnextcell to separate % columns. The reason is that two columns are used internally for @@ -158,7 +158,7 @@ \ifpgfmatrix% \pgferror{You cannot nest pgfmatrix environments, yet} \fi% - \bgroup% + \bgroup% \everycr{}% #6% \def\pgf@matrix@par@shape{#1}% @@ -180,12 +180,12 @@ \let\pgf@matrix@node@list=\pgfutil@empty% \expandafter\let\csname pgf@matrix@column@finish@1\endcsname=\pgfutil@empty% \let\pgf@matrix@row@finish=\pgfutil@empty% - % + % % Get rid of bgroup % \afterassignment\pgf@matrix@cont\let\pgf@next=% -} -\def\pgf@matrix@cont{% +}% +\def\pgf@matrix@cont{% \setbox\pgf@matrix@box=\hbox\bgroup\vbox\bgroup% \halign\bgroup% \pgf@matrix@init@row% @@ -205,7 +205,7 @@ }&% ##\pgf@matrix@padding% \cr% -} +}% \def\pgf@end@matrix{% \egroup\egroup% @@ -240,7 +240,7 @@ \pgf@matrix@shift@nodes@secondary{\pgf@matrix@offset}% }% \fi% -} +}% @@ -267,7 +267,7 @@ % beginning (macro expansion has stopped here since neither \omit % nor \span was found) \let\pgf@matrix@signal@cell@end=\pgf@matrix@signal@cell@end% - \pgfutil@ifnextchar[{\pgf@matrix@cell@cont}{\pgf@matrix@cell@cont[0pt]}}%} + \pgfutil@ifnextchar[{\pgf@matrix@cell@cont}{\pgf@matrix@cell@cont[0pt]}}%}% \def\pgf@matrix@cell@cont[#1]{% \xdef\pgf@matrix@last@nextcell@options{#1}% @@ -275,10 +275,10 @@ }% -\def\pgf@matrix@fixed@text{between origins} -\def\pgf@matrix@natural@text{between borders} +\def\pgf@matrix@fixed@text{between origins}% +\def\pgf@matrix@natural@text{between borders}% -\def\pgf@matrix@addtolength#1#2{\edef\pgf@temp{#2}\expandafter\pgf@matrix@addtolength@\expandafter#1#2,\pgf@stop} +\def\pgf@matrix@addtolength#1#2{\edef\pgf@temp{#2}\expandafter\pgf@matrix@addtolength@\expandafter#1#2,\pgf@stop}% \def\pgf@matrix@addtolength@#1#2,#3\pgf@stop{% \def\pgf@temp{#2}% \ifx\pgf@temp\pgfutil@empty% @@ -298,7 +298,7 @@ \else% \pgf@matrix@addtolength@#1#3\pgf@stop% \fi% -} +}% @@ -310,7 +310,7 @@ \global\pgfmatrixcurrentcolumn=0\relax% \expandafter\gdef\csname pgf@matrix@maxy\the\pgfmatrixcurrentrow\endcsname{0pt}% \expandafter\gdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{0pt}% -} +}% @@ -319,7 +319,7 @@ \def\pgf@matrix@step@column{% \relax% \global\advance\pgfmatrixcurrentcolumn by1\relax% -} +}% @@ -342,9 +342,9 @@ % Step 4: Collect everything in a cell box % \setbox\pgf@matrix@cell=\hbox\bgroup\bgroup% - % make sure that cell pictures are not affected if matrizes have - % 'overlay' option on: - \pgf@relevantforpicturesizetrue + % make sure that cell pictures are not affected if matrices have + % 'overlay' option on: + \pgf@relevantforpicturesizetrue \pgfsys@beginpicture% \normalbaselines% % Find out whether the cell is empty: @@ -356,9 +356,9 @@ \pgf@matrix@empty@cell@false% \pgfmatrixbegincode% }% -} +}% -\def\pgf@matrix@empty@check{\futurelet\pgf@matrix@check@token\pgf@matrix@empty@check@cont} +\def\pgf@matrix@empty@check{\futurelet\pgf@matrix@check@token\pgf@matrix@empty@check@cont}% \def\pgf@matrix@empty@check@cont{% \ifx\pgf@matrix@check@token\pgf@matrix@signal@cell@end% \pgf@matrix@empty@cell@true% @@ -373,7 +373,7 @@ \expandafter \let% reinserted \fi% -} +}% \newif\ifpgf@matrix@empty@cell@ @@ -407,7 +407,7 @@ \expandafter\global\expandafter\let\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname=\pgfutil@empty% \fi% }% - \fi\fi% + \fi\fi% % Special case of the empty picture \ifdim\pgf@picmaxx=-16000pt\relax% \global\pgf@picmaxx=0pt\relax% @@ -425,20 +425,20 @@ \pgf@y=\csname pgf@matrix@column@sep@\the\pgfmatrixcurrentcolumn\endcsname\relax% \advance\pgf@picminx by-\pgf@y% \fi% - % + % % Step 6: Protocol and adjust height and depth % % Step 6.1: Protocol... % \ifdim\pgf@picmaxy>\csname pgf@matrix@maxy\the\pgfmatrixcurrentrow\endcsname% \expandafter\xdef\csname pgf@matrix@maxy\the\pgfmatrixcurrentrow\endcsname{\the\pgf@picmaxy}% - \fi% + \fi% \ifdim\pgf@picminy<\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname% \expandafter\xdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{\the\pgf@picminy}% - \fi% + \fi% % % Step 6.2: and setup. - % + % \ht\pgf@matrix@cell=\pgf@picmaxy% \dp\pgf@matrix@cell=-\pgf@picminy% % @@ -453,16 +453,16 @@ \else% \ifdim\pgf@picmaxx>\csname pgf@matrix@maxx\the\pgfmatrixcurrentcolumn\endcsname% \expandafter\xdef\csname pgf@matrix@maxx\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@picmaxx}% - \fi% + \fi% \ifdim\pgf@picminx<\csname pgf@matrix@minx\the\pgfmatrixcurrentcolumn\endcsname% \expandafter\xdef\csname pgf@matrix@minx\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@picminx}% - \fi% + \fi% \fi% % % Step 7.2: and setup. - % + % \xdef\pgf@matrix@paddingskip{\the\pgf@picmaxx}% - % + % % Step 8: Put in the box now % \hfil\hskip-\pgf@picminx% @@ -471,7 +471,7 @@ % % Step 9: End bounding box \endpgfinterruptboundingbox% -} +}% % Default code for the start and end code \let\pgfmatrixbegincode=\relax @@ -489,7 +489,7 @@ \xdef\pgf@matrix@node@list{\pgf@matrix@node@list,{#1}}% \expandafter\xdef\csname pgf@matrix@node@location@#1\endcsname{{\the\pgfmatrixcurrentrow}{\the\pgfmatrixcurrentcolumn}}% \fi% -} +}% @@ -501,7 +501,7 @@ \pgferror{Single ampersand used with wrong catcode}% \fi% \hskip\pgf@matrix@paddingskip\hfil% -} +}% % Compute the real positions of the origins @@ -509,7 +509,7 @@ % We must now compute the real positions of the origins of all the % small pictures. To this end, we need to compute prefix sums. After % the procedure is done, the minx and the maxy will contain the origin -% positions. +% positions. \def\pgf@matrix@compute@origin{% % @@ -550,7 +550,7 @@ \expandafter\xdef\csname pgf@matrix@minx\the\c@pgf@counta\endcsname{\the\pgf@x}% \repeat% }% -} +}% % Shift the nodes to their origins @@ -577,7 +577,7 @@ \fi% }% }% -} +}% % The second shifting, done in the following procedure, shifts all @@ -593,7 +593,7 @@ \fi% \fi% }% -} +}% % End of line @@ -603,21 +603,22 @@ % nor \span was found) \let\pgf@matrix@signal@cell@end=\pgf@matrix@signal@cell@end \pgf@matrix@last@cell@in@rowtrue% + \xdef\pgf@matrix@rowsep{\pgfmatrixrowsep}% &\pgf@matrix@correct@calltrue% \global\pgf@matrix@fixedfalse% \pgf@y=0pt% - \pgf@matrix@addtolength\pgf@y{\pgfmatrixrowsep}% + \pgf@matrix@addtolength\pgf@y{\pgf@matrix@rowsep}% \pgfutil@ifnextchar[{\pgfmatrixendrow@skip}{\pgf@matrix@finish@line}% -} +}% \newif\ifpgf@matrix@last@cell@in@row -\def\pgf@matrix@signal@cell@end{\pgf@matrix@signal@cell@end} +\def\pgf@matrix@signal@cell@end{\pgf@matrix@signal@cell@end}% % exact definition does not matter, only needs to be unique. \def\pgfmatrixendrow@skip[#1]{% \pgf@matrix@addtolength\pgf@y{#1}% \pgf@matrix@finish@line% -} +}% \def\pgf@matrix@finish@line{% \global\pgf@y=\pgf@y% @@ -625,12 +626,12 @@ \global\advance\pgf@ya by\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname% \expandafter\xdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{\the\pgf@ya}% \pgfutil@ifnextchar\egroup{\cr\pgf@end@matrix}{\pgf@matrix@no@eom@found}% -} +}% \def\pgf@matrix@eom@found{% \cr% \pgf@end@matrix% -} +}% \def\pgf@matrix@no@eom@found{% \cr% @@ -645,7 +646,7 @@ \global\let\pgf@matrix@row@finish=\pgfutil@empty% \fi% }% -} +}% \endinput |