Debian Codegraph @

texmf-dist/tex/generic/youngtab/youngtab.sty

raw
1 %%
2 %% This is file `youngtab.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% youngtab.dtx (with options: `package')
8 %%
9 %% Copyright (C) 1996,98,99 Volker B"orchers and Stefan Gieseke,
10 %% This program can be redistributed and/or modified under the terms
11 %% of the LaTeX Project Public License Distributed from CTAN
12 %% archives in directory macros/latex/base/lppl.txt; either
13 %% version 1 of the License, or any later version.
14 %%
15 %% File: youngtab.dtx
16 %% Copyright (C) 1996,98,99 Volker B"orchers and Stefan Gieseke,
17 %% This program can be redistributed and/or modified under the terms
18 %% of the LaTeX Project Public License Distributed from CTAN
19 %% archives in directory macros/latex/base/lppl.txt; either
20 %% version 1 of the License, or any later version.
21 \NeedsTeXFormat{LaTeX2e}
22 \ProvidesPackage{youngtab}
23 [1999/05/19 v1.1; Macros for Young-Tableaux]
24 %% Package `youngtab' to use with TeX, LaTeX209 or LaTeX2e
25 %% (You will need LaTeX2e to extract the documentation and a STY-file
26 %% without comments from the .dtx file)
27 \newif\ify@autoscale \y@autoscaletrue \def\Yautoscale#1{\ifnum #1=0
28 \y@autoscalefalse\else\y@autoscaletrue\fi}
29 \newdimen\y@b@xdim
30 \newdimen\y@boxdim \y@boxdim=13pt
31 \def\Yboxdim#1{\y@autoscalefalse\y@boxdim=#1}
32 \newdimen\y@linethick \y@linethick=.3pt
33 \def\Ylinethick#1{\y@linethick=#1}
34 \newskip\y@interspace \y@interspace=0ex plus 0.3ex
35 \def\Yinterspace#1{\y@interspace=#1}
36 \newif\ify@vcenter \y@vcenterfalse
37 \def\Yvcentermath#1{\ifnum #1=0 \y@vcenterfalse\else\y@vcentertrue\fi}
38 \newif\ify@stdtext \y@stdtextfalse
39 \def\Ystdtext#1{\ifnum #1=0 \y@stdtextfalse\else\y@stdtexttrue\fi}
40 \newif\ify@enable@skew \y@enable@skewfalse
41 \DeclareOption{noautoscale}{\y@autoscalefalse}
42 \DeclareOption{vcentermath}{\y@vcentertrue}
43 \DeclareOption{stdtext}{\y@vcentertrue}
44 \DeclareOption{enableskew}{\y@enable@skewtrue}
45 \DeclareOption*{\PackageWarning{youngtab}{%
46 Unknown option `\CurrentOption' (Known:\MessageBreak
47 `vcentermath', `noautoscale', `stdtext', `enableskew'.)}}
48 \ProcessOptions\relax
49 \def\y@vr{\vrule height0.8\y@b@xdim width\y@linethick depth 0.2\y@b@xdim}
50 \def\y@emptybox{\y@vr\hbox to \y@b@xdim{\hfil}}
51 \ify@enable@skew
52 \def\y@abcbox#1{\if :#1\else
53 \y@vr\hbox to \y@b@xdim{\hfil#1\hfil}\fi}
54 \def\y@mathabcbox#1{\if :#1\else
55 \y@vr\hbox to \y@b@xdim{\hfil$#1$\hfil}\fi}
56 \else
57 \def\y@abcbox#1{\y@vr\hbox to \y@b@xdim{\hfil#1\hfil}}
58 \def\y@mathabcbox#1{\y@vr\hbox to \y@b@xdim{\hfil$#1$\hfil}}
59 \fi
60 \def\y@setdim{%
61 \ify@autoscale%
62 \ifvoid1\else\typeout{Package youngtab: box1 not free! Expect an
63 error!}\fi%
64 \setbox1=\hbox{A}\y@b@xdim=1.6\ht1 \setbox1=\hbox{}\box1%
65 \else\y@b@xdim=\y@boxdim \advance\y@b@xdim by -2\y@linethick
66 \fi}
67 \newcount\y@counter
68 \newif\ify@islastarg
69 \def\y@lastargtest#1,#2 {\if\space #2 \y@islastargtrue
70 \else\y@islastargfalse\fi}
71 \def\y@emptyboxes#1{\y@counter=#1\loop\ifnum\y@counter>0
72 \advance\y@counter by -1 \y@emptybox\repeat}
73 \def\y@nelineemptyboxes#1{%
74 \vbox{%
75 \hrule height\y@linethick%
76 \hbox{\y@emptyboxes{#1}\y@vr}
77 \hrule height\y@linethick}\vspace{-\y@linethick}}
78 \def\yng(#1){%
79 \y@setdim%
80 \hspace{\y@interspace}%
81 \ifmmode\ify@vcenter\vcenter\fi\fi{%
82 \y@lastargtest#1,
83 \vbox{\offinterlineskip
84 \ify@islastarg
85 \y@nelineemptyboxes{#1}
86 \else
87 \y@ungempty(#1)
88 \fi}}\hspace{\y@interspace}}
89 \def\y@ungempty(#1,#2){%
90 \y@nelineemptyboxes{#1}
91 \y@lastargtest#2,
92 \ify@islastarg
93 \y@nelineemptyboxes{#2}
94 \else
95 \y@ungempty(#2)
96 \fi}
97 \def\y@nelettertest#1#2. {\if\space #2 \y@islastargtrue
98 \else\y@islastargfalse\fi}
99 \def\y@abcboxes#1#2.{%
100 \ify@stdtext\y@abcbox#1\else\y@mathabcbox#1\fi%
101 \y@nelettertest #2.
102 \ify@islastarg\unskip%
103 \ify@stdtext\y@abcbox{#2}\else\y@mathabcbox{#2}\fi%
104 \else\y@abcboxes#2.\fi}
105 \ify@enable@skew
106 \newdimen\y@full@b@xdim
107 \newcount\y@m@veright@cnt
108 \def\y@get@m@veright@cnt#1#2.{%
109 \if :#1 \advance\y@m@veright@cnt by 1\y@get@m@veright@cnt#2.\fi}
110 \let\y@setdim@=\y@setdim
111 \def\y@setdim{%
112 \y@setdim@ \y@full@b@xdim=\y@b@xdim
113 \advance\y@full@b@xdim by 1\y@linethick}
114 \def\y@m@veright@ifskew#1{
115 \y@m@veright@cnt=0 \y@get@m@veright@cnt#1.
116 \moveright \y@m@veright@cnt\y@full@b@xdim}
117 \else
118 \def\y@m@veright@ifskew#1{}
119 \fi
120 \def\y@nelineabcboxes#1{%
121 \y@nelettertest #1.
122 \ify@islastarg
123 \y@m@veright@ifskew{#1}
124 \vbox{
125 \hrule height\y@linethick%
126 \hbox{\ify@stdtext\y@abcbox#1\else\y@mathabcbox#1\fi\y@vr}
127 \hrule height\y@linethick}\vspace{-\y@linethick}
128 \else
129 \y@m@veright@ifskew{#1}
130 \vbox{
131 \hrule height\y@linethick%
132 \hbox{\y@abcboxes #1.\y@vr}%
133 \hrule height\y@linethick}\vspace{-\y@linethick}
134 \fi}
135 \def\young(#1){%
136 \y@setdim%
137 \hspace{\y@interspace}%
138 \y@lastargtest#1,
139 \ifmmode\ify@vcenter\vcenter\fi\fi{%
140 \vbox{\offinterlineskip
141 \ify@islastarg\y@nelineabcboxes{#1}%
142 \else\y@ungabc(#1)%
143 \fi}}\hspace{\y@interspace}}
144 \def\y@ungabc(#1,#2){%
145 \y@nelineabcboxes{#1}%
146 \y@lastargtest#2,
147 \ify@islastarg\y@nelineabcboxes{#2}%
148 \else\y@ungabc(#2)%
149 \fi}
150 \endinput
151 %%
152 %% End of file `youngtab.sty'.