1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
%
% tableaux.sty version 1.0
% Copyright (C) 2007 by Kasper Peeters
%
% A LaTeX style file for drawing Young diagrams and Young tableaux.
%
% This file is part of the Cadabra computer algebra system,
%
% http://www.aei.mpg.de/~peekas/cadabra/
%
% but may be distributed /or modified under the conditions of the
% LaTeX Project Public License, either version 1.3 of this license or
% (at your option) any later version. The latest version of this
% license is in
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
% The current maintainer of this work is Kasper Peeters.
%
\def\@tabforc#1#2#3{\expandafter\tabf@rc\expandafter#1{#2 \^}{#3}}
\def\tabf@@rc#1#2#3\tabf@@rc#4{\def#1{#2}#4\tabf@rc#1{#3}{#4}}
\long\def\ReturnAfterFi#1\fi{\fi#1}
\def\tabf@rc#1#2#3{%
\def\temp@ty{#2}%
\ifx\@empty\temp@ty
\else
\ReturnAfterFi{%
\tabf@@rc#1#2\tabf@@rc{#3}%
}%
\fi
}%
% Sorry, some global registers...
\newdimen\ytsize\ytsize=2mm
\newdimen\ytfsize\ytfsize=4mm
\newcount\repcnt
\newdimen\acchspace
\newdimen\accvspace
\newdimen\raiseh
\newdimen\maxw
\newcommand\phrule[1]{\hbox{\vbox to0pt{\hrule height .2pt width#1\vss}}}
%\newcommand\pvrule{\vbox{\hbox to0pt{\vrule width .2pt height\ytsize\hss}}}
\newcommand\ftableau[1]{%
\def\ctest{,}
\def\Ktest{\^}
\acchspace=0ex
\accvspace=0ex
\maxw=0ex
\vbox{\hbox{%
\@tabforc\thisel{#1}{%
\ifx\thisel\Ktest{%
\ifnum\maxw=0\maxw=\acchspace\fi%
\raisebox{\accvspace}{\vbox to \ytfsize{\hbox to
0pt{\vrule height \ytfsize\hss}}}\kern\acchspace\kern-\maxw}
\else\ifx\thisel\ctest
\ifnum\maxw=0\maxw=\acchspace\fi%
\raisebox{\accvspace}{\vbox to \ytfsize{\hbox to 0pt{\vrule height \ytfsize\hss}}}%
\kern\acchspace\acchspace=0ex
\advance\accvspace by -\ytfsize
\else
\setbox3=\hbox{$\thisel$}%
\raiseh=\ytfsize%
\advance\raiseh by -1ex%
\divide\raiseh by 2%
\advance\acchspace by-\ytfsize%
\raisebox{\accvspace}{\vbox to \ytfsize{\hrule\hbox to%
\ytfsize{\vrule height \ytfsize\hskip.5ex%
\raisebox{\raiseh}{\tiny$\thisel$}\hss}\vss\phrule{\ytfsize}}}%
\fi\fi}}}}
\newcommand\tableau[1]{%
\def\stest{ }
\def\Ktest{\^}
\acchspace=0ex
\accvspace=0ex
\maxw=0ex
\hbox{%
\@tabforc\thisel{#1}{%
\ifx\thisel\Ktest{}
\else
\repcnt=\thisel%
\loop{}%
\advance\acchspace by-\ytsize%
\raisebox{\accvspace}{\vbox to \ytsize{\hrule \hbox to%
\ytsize{\vrule height \ytsize\hss}\vss\phrule{\ytsize}}}%
\advance\repcnt by -1\ifnum\repcnt>1{}\repeat%
\ifnum\maxw=0\maxw=\acchspace\fi%
\raisebox{\accvspace}{\vbox to \ytsize{\hbox to 0pt{\vrule height \ytsize\hss}}}%
\kern\acchspace\acchspace=0ex%
\advance\accvspace by -\ytsize%
\fi}\kern-\maxw}}
|