summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
diff options
context:
space:
mode:
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.tex72
1 files changed, 38 insertions, 34 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 32024c047d6..a9344f6c95c 100644
--- a/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmodulematrix.code.tex,v 1.4 2010/08/24 21:28:58 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/modules/pgfmodulematrix.code.tex,v 1.8 2013/09/17 17:34:00 tantau Exp $
\usepgfmodule{shapes}
@@ -156,7 +156,7 @@
\def\pgfmatrix#1#2#3#4#5#6{%
\ifpgfmatrix%
- \PackageError{pgf}{You cannot nest pgfmatrix environments, yet}{}
+ \pgferror{You cannot nest pgfmatrix environments, yet}
\fi%
\bgroup%
\everycr{}%
@@ -270,26 +270,7 @@
\pgfutil@ifnextchar[{\pgf@matrix@cell@cont}{\pgf@matrix@cell@cont[0pt]}}%}
\def\pgf@matrix@cell@cont[#1]{%
- \ifnum\pgfmatrixcurrentcolumn<\pgf@matrix@numberofcolumns%
- \else%
- {%
- \global\pgf@matrix@fixedfalse%
- \pgf@x=0pt%
- \pgf@matrix@addtolength{\pgf@x}{\pgfmatrixcolumnsep}%
- \pgf@matrix@addtolength{\pgf@x}{#1}%
- \ifpgf@matrix@fixed%
- \expandafter\pgfutil@g@addto@macro\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname%
- {\global\pgf@picmaxx=0pt}%
- \fi%
- \advance\pgfmatrixcurrentcolumn by1\relax % only temporary for the following:
- \expandafter\xdef\csname pgf@matrix@column@sep@\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@x}%
- \ifpgf@matrix@fixed%
- \expandafter\gdef\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname{\global\pgf@picminx=0pt}%
- \else%
- \expandafter\global\expandafter\let\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname=\pgfutil@empty%
- \fi%
- }%
- \fi%
+ \xdef\pgf@matrix@last@nextcell@options{#1}%
&\pgf@matrix@correct@calltrue&%
}%
@@ -402,19 +383,41 @@
\def\pgf@matrix@endcell{%
\ifpgf@matrix@empty@cell@%
\else%
- \expandafter\pgfmatrixendcode%
- \fi
+ \expandafter\expandafter\expandafter\pgfmatrixendcode%
+ \expandafter\ifpgf@matrix@last@cell@in@row\expandafter\pgf@matrix@last@cell@in@rowtrue\expandafter\fi%
+ \fi%
\pgfsys@endpicture%
+ \ifnum\pgfmatrixcurrentcolumn<\pgf@matrix@numberofcolumns%
+ \else%
+ \ifpgf@matrix@last@cell@in@row\else%
+ {%
+ \global\pgf@matrix@fixedfalse%
+ \pgf@x=0pt%
+ \pgf@matrix@addtolength{\pgf@x}{\pgfmatrixcolumnsep}%
+ \pgf@matrix@addtolength{\pgf@x}{\pgf@matrix@last@nextcell@options}%
+ \ifpgf@matrix@fixed%
+ \expandafter\pgfutil@g@addto@macro\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname%
+ {\global\pgf@picmaxx=0pt}%
+ \fi%
+ \advance\pgfmatrixcurrentcolumn by1\relax % only temporary for the following:
+ \expandafter\xdef\csname pgf@matrix@column@sep@\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@x}%
+ \ifpgf@matrix@fixed%
+ \expandafter\gdef\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname{\global\pgf@picminx=0pt}%
+ \else%
+ \expandafter\global\expandafter\let\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname=\pgfutil@empty%
+ \fi%
+ }%
+ \fi\fi%
+ % Special case of the empty picture
+ \ifdim\pgf@picmaxx=-16000pt\relax%
+ \global\pgf@picmaxx=0pt\relax%
+ \global\pgf@picminx=0pt\relax%
+ \global\pgf@picmaxy=0pt\relax%
+ \global\pgf@picminy=0pt\relax%
+ \fi%
\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname%
\pgf@matrix@row@finish%
\egroup\egroup%
- % Special case of the empty picture
- \ifdim\pgf@picmaxx=-16000pt\relax%
- \pgf@picmaxx=0pt\relax%
- \pgf@picminx=0pt\relax%
- \pgf@picmaxy=0pt\relax%
- \pgf@picminy=0pt\relax%
- \fi%
%
% Step 5: Horizontal gap
%
@@ -495,8 +498,7 @@
\def\pgf@matrix@padding{%
\ifpgf@matrix@correct@call%
\else%
- \PackageError{pgfbasematrix}{Single ampersand used with wrong
- catcode}{}%
+ \pgferror{Single ampersand used with wrong catcode}%
\fi%
\hskip\pgf@matrix@paddingskip\hfil%
}
@@ -599,13 +601,15 @@
% if the cell contains nothing, the following \let will be at the
% beginning (macro expansion has stopped here since neither \omit
% nor \span was found)
- \let\pgf@matrix@signal@cell@end=\pgf@matrix@signal@cell@end%
+ \let\pgf@matrix@signal@cell@end=\pgf@matrix@signal@cell@end
+ \pgf@matrix@last@cell@in@rowtrue%
&\pgf@matrix@correct@calltrue%
\global\pgf@matrix@fixedfalse%
\pgf@y=0pt%
\pgf@matrix@addtolength\pgf@y{\pgfmatrixrowsep}%
\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}
% exact definition does not matter, only needs to be unique.