[pstricks] Border matrix macro from mathmode doc in plain Tex

Herbert Voss Herbert.Voss at FU-Berlin.DE
Fri Oct 31 09:52:49 CET 2008


John Smith schrieb:
> I tried to use this in plain Tex. The code is

% not really a PSTricks question, insn't it ;-)
\newdimen\@tempdima
\newdimen\@tempdimb

> \newif\if at borderstar
> \def\bordermatrix{\@ifnextchar*{%
> \@borderstartrue\@bordermatrix at i}{\@borderstarfalse\@bordermatrix at i*}%
> }
> \def\@bordermatrix at i*{\@ifnextchar[{\@bordermatrix at ii}{\@bordermatrix at ii
> [()]}}
> \def\@bordermatrix at ii[#1]#2{%
> \begingroup
> \m at th\@tempdima8.75\p@\setbox\z@\vbox{%
>  \def\cr{\crcr\noalign{\kern 2\p@\global\let\cr\endline }}%
>  \ialign {$##$\hfil\kern 2\p@\kern\@tempdima & \thinspace %
>  \hfil $##$\hfil && \quad\hfil $##$\hfil\crcr\omit\strut %
>  \hfil\crcr\noalign{\kern -\baselineskip}#2\crcr\omit %
>  \strut\cr}}%
>  \setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}%
>  \setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}%
>  \setbox\tw@\hbox{%
>  $\kern\wd\@ne\kern -\@tempdima\left\@firstoftwo#1%
>  \if at borderstar\kern2pt\else\kern -\wd\@ne\fi%
>  \global\setbox\@ne\vbox{\box\@ne\if at borderstar\else\kern 2\p@\fi}%
>  \vcenter{\if at borderstar\else\kern -\ht\@ne\fi%
>  \unvbox\z@\kern-\if at borderstar2\fi\baselineskip}%
>  \if at borderstar\kern-2\@tempdima\kern2\p@\else\,\fi\right\@secondoftwo#1 $%
>  }\null \;\vbox{\kern\ht\@ne\box\tw@}%
>  \endgroup
>  }
> 
> This gives an error because of undefined variable \@tempdima. How can I fix
> it? Also what does the 8.75pt refer to on this line. What happens if I want
> to use the code with a large font, say 20pt?

try it out ... should be no problem.

Herbert


More information about the PSTricks mailing list