%% TeX output of pspp

%% Define the horizontal space between table columns
\def\psppcolumnspace{1mm}


%% Sets the environment for rendering material in table cell
%% The parameter is the number of columns in the table
\def\cell#1{\normalbaselines\advance\hsize by
-#1.0\psppcolumnspace\advance\hsize by \psppcolumnspace\divide\hsize by
#1\noindent\raggedright\hskip0pt}

%% Render the text centre justified
\def\startcentre{\begingroup\leftskip=0pt plus 1fil
\rightskip=\leftskip\parfillskip=0pt}
\def\stopcentre{\par\endgroup}
\long\def\centre#1{\startcentre#1\stopcentre}

%% Render the text right justified
\def\startright{\begingroup\leftskip=0pt plus 1fil
\parfillskip=0pt}
\def\stopright{\par\endgroup}
\long\def\right#1{\startright#1\stopright}


{\parindent=0pt
{\bf Columns}\par
\offinterlineskip\halign{\strut%
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{9}#}}\cr
\multispan{8}\span\hsize=9.0\hsize\advance\hsize8.0\psppcolumnspace
\centre{b}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{b1}&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{b2}&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{b3}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{a}&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{a}&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{a}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
\centre{a1}&\centre{a2}&\centre{a3}&\centre{a1}&\centre{a2}&\centre{a3}&\centre%
{a1}&\centre{a2}&\centre{a3}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
\right{0}&\right{1}&\right{2}&\right{3}&\right{4}&\right{5}&\right{6}&\right{7}%
&\right{8}\cr
}% End of \halign
}
\vskip 3ex


{\parindent=0pt
{\bf Rows - Corner}\par
\offinterlineskip\halign{\strut%
{\vbox{\cell{3}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{3}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{3}#}}\cr
b&a&\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
b1&a1&\right{0}\cr
&a2&\right{1}\cr
&a3&\right{2}\cr
b2&a1&\right{3}\cr
&a2&\right{4}\cr
&a3&\right{5}\cr
b3&a1&\right{6}\cr
&a2&\right{7}\cr
&a3&\right{8}\cr
}% End of \halign
}
\vskip 3ex


{\parindent=0pt
{\bf Rows - Nested}\par
\offinterlineskip\halign{\strut%
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\cr
b&b1&a&a1&\right{0}\cr
&&&a2&\right{1}\cr
&&&a3&\right{2}\cr
&b2&a&a1&\right{3}\cr
&&&a2&\right{4}\cr
&&&a3&\right{5}\cr
&b3&a&a1&\right{6}\cr
&&&a2&\right{7}\cr
&&&a3&\right{8}\cr
}% End of \halign
}
\vskip 3ex


{\parindent=0pt
{\bf Column x Row - Corner}\par
\offinterlineskip\halign{\strut%
{\vbox{\cell{4}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{4}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{4}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{4}#}}\cr
b&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{a}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
&\centre{a1}&\centre{a2}&\centre{a3}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
b1&\right{0}&\right{1}&\right{2}\cr
b2&\right{3}&\right{4}&\right{5}\cr
b3&\right{6}&\right{7}&\right{8}\cr
}% End of \halign
}
\vskip 3ex


{\parindent=0pt
{\bf Column x Row - Nested}\par
\offinterlineskip\halign{\strut%
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\cr
\multispan{1}\span\hsize=2.0\hsize\advance\hsize1.0\psppcolumnspace
&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{a}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
&\centre{a1}&\centre{a2}&\centre{a3}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
b&b1&\right{0}&\right{1}&\right{2}\cr
&b2&\right{3}&\right{4}&\right{5}\cr
&b3&\right{6}&\right{7}&\right{8}\cr
}% End of \halign
}
\vskip 3ex


{\parindent=0pt
{\bf Row x Column - Corner}\par
\offinterlineskip\halign{\strut%
{\vbox{\cell{4}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{4}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{4}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{4}#}}\cr
a&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{b}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
&\centre{b1}&\centre{b2}&\centre{b3}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
a1&\right{0}&\right{3}&\right{6}\cr
a2&\right{1}&\right{4}&\right{7}\cr
a3&\right{2}&\right{5}&\right{8}\cr
}% End of \halign
}
\vskip 3ex


{\parindent=0pt
{\bf Row x Column - Nested}\par
\offinterlineskip\halign{\strut%
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\hskip\psppcolumnspace\hfil&\vrule
{\vbox{\cell{5}#}}\cr
\multispan{1}\span\hsize=2.0\hsize\advance\hsize1.0\psppcolumnspace
&\multispan{2}\span\hsize=3.0\hsize\advance\hsize2.0\psppcolumnspace
\centre{b}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
&\centre{b1}&\centre{b2}&\centre{b3}\cr
\noalign{\hrule\vskip -\normalbaselineskip}\cr
a&a1&\right{0}&\right{3}&\right{6}\cr
&a2&\right{1}&\right{4}&\right{7}\cr
&a3&\right{2}&\right{5}&\right{8}\cr
}% End of \halign
}
\vskip 3ex


\bye
