1 % slashbox.sty by Koichi Yasuoka, May 27, 1993
2 % minor modification by Toru Sato, May 31, 1993
3 \typeout{slashbox style by K.Yasuoka, May 1993.}%
12 \def\@slashboxpicture##1{%
13 \put(0,0){\line(##1,1){\@slashboxwd}}%
14 \put(0,\@slashboxht){\makebox(0,0)[tl]{\box\@slashboxa}}%
15 \put(\@slashboxwd,0){\makebox(0,0)[br]{\box\@slashboxb}}%
20 \def\@slashboxpicture##1{%
21 \put(0,\@slashboxht){\line(##1,-1){\@slashboxwd}}%
22 \put(0,0){\makebox(0,0)[bl]{\box\@slashboxa}}%
23 \put(\@slashboxwd,\@slashboxht){\makebox(0,0)[tr]{\box\@slashboxb}}%
27 \def\@slashbox{\@ifnextchar [{\@@slashbox}{\@@slashbox[0pt]}}
28 \def\@@slashbox[#1]{\@ifnextchar [{\@@@slashbox[#1]}{\@@@slashbox[#1][c]}}
29 \def\@@@slashbox[#1][#2]#3#4{%
30 % #1: width, #2: suppression of \tabcolsep on `l', `r', or `lr' side
31 % #3: left item, #4: right item
32 \@slashsepl=\tabcolsep
33 \@slashsepr=\tabcolsep
34 \@tfor\@tempa :=#2\do{\expandafter\let
35 \csname @slashsep\@tempa\endcsname=\z@}%
36 \setbox\@slashboxa=\hbox{\strut\hskip\tabcolsep\shortstack[l]{#3}}%
37 \setbox\@slashboxb=\hbox{\shortstack[r]{#4}\hskip\tabcolsep\strut}%
38 \setbox\@slashboxa=\hbox{\raise\dp\@slashboxa\box\@slashboxa}%
39 \setbox\@slashboxb=\hbox{\raise\dp\@slashboxb\box\@slashboxb}%
40 \setbox\@slashboxc=\hbox{%
41 \@tempdima=\wd\@slashboxa
42 \advance\@tempdima by \wd\@slashboxb
43 \advance\@tempdima by \@slashsepl
44 \advance\@tempdima by \@slashsepr
46 \ifdim\@tempdimb>\@tempdima \@tempdima=\@tempdimb\fi%
47 \@tempdimb=\ht\@slashboxa
48 \advance\@tempdimb by \dp\@slashboxa
49 \advance\@tempdimb by \ht\@slashboxb
50 \advance\@tempdimb by \dp\@slashboxb
53 \advance\@tempcnta by \@tempcntb
54 \advance\@tempcnta by -1
55 \divide\@tempcnta by \@tempcntb
56 \ifnum\@tempcnta>6 \@tempcnta=6
57 \@tempdimb=0.166666666\@tempdima
59 \ifnum\@tempcnta<1 \@tempcnta=1\fi
61 \multiply\@tempdima by \@tempcnta
63 \advance\@tempdima by -\@slashsepl
64 \advance\@tempdima by -\@slashsepr
65 \@slashboxwd=\@tempdima
66 \@slashboxht=\@tempdimb
67 \@tempcntb=\@slashsepl
68 \setlength{\unitlength}{1sp}%
69 \begin{picture}(\@slashboxwd,\@slashboxht)(\@tempcntb,0)
70 \advance\@tempdima by \@slashsepl
71 \advance\@tempdima by \@slashsepr
72 \@slashboxwd=\@tempdima
73 \@slashboxpicture{\@tempcnta}
76 $\vcenter{\box\@slashboxc}$%