From eb49231093d1336c3166b1b979ad69342430b282 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 16 Aug 2012 22:44:34 +0000 Subject: ytableau (16aug12) git-svn-id: svn://tug.org/texlive/trunk@27430 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ytableau/ytableau.pdf | Bin 352629 -> 362582 bytes .../texmf-dist/source/latex/ytableau/ytableau.dtx | 173 ++++++++++++++++++--- Master/texmf-dist/tex/latex/ytableau/ytableau.sty | 70 +++++++-- 3 files changed, 208 insertions(+), 35 deletions(-) diff --git a/Master/texmf-dist/doc/latex/ytableau/ytableau.pdf b/Master/texmf-dist/doc/latex/ytableau/ytableau.pdf index 548e4c53f95..d113064e402 100644 Binary files a/Master/texmf-dist/doc/latex/ytableau/ytableau.pdf and b/Master/texmf-dist/doc/latex/ytableau/ytableau.pdf differ diff --git a/Master/texmf-dist/source/latex/ytableau/ytableau.dtx b/Master/texmf-dist/source/latex/ytableau/ytableau.dtx index 15f859913c4..25fb4ca5e6f 100644 --- a/Master/texmf-dist/source/latex/ytableau/ytableau.dtx +++ b/Master/texmf-dist/source/latex/ytableau/ytableau.dtx @@ -18,7 +18,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{ytableau} -% [2012/06/17 v1.2 Many-featured Young tableaux and Young diagrams] +% [2012/08/14 v1.3 Many-featured Young tableaux and Young diagrams] % %<*driver> \documentclass{ltxdoc} @@ -98,7 +98,7 @@ % % \fi % -% \CheckSum{497} +% \CheckSum{580} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -147,7 +147,7 @@ % \title{The \textsf{ytableau} package\thanks{This document describes % \textsf{ytableau}~\fileversion, dated~\filedate.}} % \author{Ryan Reich\\\texttt{ryan.reich@gmail.com}} -% \date{June 17, 2012} +% \date{August 14th, 2012} % \maketitle % % \tableofcontents @@ -205,7 +205,12 @@ % We believe the package achieves all these things. There should be nothing that one would want to % do with Young tableaux that cannot be accomplished in the obvious way using the commands given % below. - +% +% \section*{Requirements} +% This package is quite self-contained and I have tried to avoid pulling in +% very large prerequisites. It includes \textsf{pgfkeys}, \textsf{pgfopts}, and +% \textsf{xcolor}, and specifically requires version 2 (2011/06/02) of +% \textsf{pgfopts}; this is enforced in the code. % % \section{User commands} % \label{s:user commands} @@ -359,6 +364,11 @@ % are otherwise centered). The latter (which are synonyms) center them vertically and % independently of each other. Use |nobaseline| for tableaux with numbers, but |baseline| for % anything else, particularly anything with some depth. + +% \item \DescribeOption{tabloids} \DescribeOption{notabloids} +% |tabloids|/|notabloids|. The former switches off drawing the vertical edges +% in a tableau, producing a ``tabloid''; the latter (the default) switches them +% back on. Syntax such as |tabloids = off| or |tabloids = true| is allowed. % \end{itemize} % It may not be useful to set these options globally, so we provide a macro for changing each of % these parameters ``on the fly'': @@ -439,11 +449,37 @@ % \end{verbatim} % \end{minipage} % \end{center} +% +% \begin{center} +% \ytableausetup +% {boxsize=normal,tabloids} +% \ytableaushort{ +% 123, 45, 6 +% } +% \hfill +% \ytableaushort{ +% 1\none3, 45, 6 +% } +% \hfill +% \begin{minipage}{0.5\textwidth} +% \begin{verbatim} +% \ytableausetup +% {boxsize=normal,tabloids} +% \ytableaushort{ +% 123, 45, 6 +% } +% \hfill +% \ytableaushort{ +% \none 23, 45, 6 +% } +% \end{verbatim} +% \end{minipage} +% \end{center} % % \subsection{Skew tableaux} % % \begin{center} -% \ytableausetup{boxsize=normal} +% \ytableausetup{notabloids} % \begin{ytableau} % \none & \none & 1 & 2 \\ % \none & 1 & 2 \\ @@ -453,7 +489,7 @@ % \hfill % \begin{minipage}{0.5\textwidth} % \begin{verbatim} -% \ytableausetup{boxsize=normal} +% \ytableausetup{notabloids} % \begin{ytableau} % \none & \none & 1 & 2 \\ % \none & 1 & 2 \\ @@ -618,6 +654,7 @@ % \changes{v1.1}{2011/01/31}{Changed the namespace convention from \texttt{ytableau@...} to \texttt{...@YT} to make the index useful and the macros shorter.} % \changes{v1.2}{2012/06/17}{Removed a lot of pointless endline-comments after control sequences and added spaces after numbers.} % \changes{v1.2}{2012/06/17}{Fixed a bug where the prevailing font size was ignored or imperfectly obeyed.} +% \changes{v1.3}{2012/08/14}{Require sufficiently new \textsf{pgfopts} since v.1 breaks.} % % \subsection{Global defintions} % @@ -761,6 +798,37 @@ \edef\macro@boxdim@YT{\boxdim@normal@YT} % \end{macrocode} % \end{macro} +% \begin{macro}{\hrule@normal@YT} +% \begin{macro}{\vrule@normal@YT} +% |\hrule| and |\vrule| for drawing the frames around tableau cells. The +% vertical ones are a little shorter to produce a small overlap that eliminates +% gaps at the corners without producing anti-gaps in the hinting at the edges. +% I am basically copying the idea from \textsf{xcolor}'s |\boxframe|. +% \begin{macrocode} +\def\hrule@normal@YT{% + \hrule width \dimexpr \boxdim@YT + \fboxrule * 2\relax + height \fboxrule +} +\def\vrule@normal@YT{% + \vrule height \dimexpr \boxdim@YT + \fboxrule\relax + width \fboxrule +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\hrule@none@YT} +% \begin{macro}{\vrule@none@YT} +% Fake rules for |\none| to give the correct spacing. +% \begin{macrocode} +\def\hrule@none@YT{\kern\fboxrule} +\def\vrule@none@YT{% + \vrule width 0pt + height \dimexpr \boxdim@YT + \fboxrule\relax + \kern\fboxrule +} +% \end{macrocode} +% \end{macro} +% \end{macro} % % \begin{macro}{\font@YT} % \changes{v1.2}{2012/06/17}{Changed name from \texttt{\textbackslash defarg@YT}.} @@ -1030,13 +1098,34 @@ % \begin{macrocode} centerboxes/.style = {baseline = false}, } +\pgfkeys{/ytableau/options, +% \end{macrocode} +% \begin{option}{tabloids} +% \changes{v1.3}{2012/08/14}{Added option.} +% Causes the vertical lines of a tableau to be omitted. +% \end{option} +% \begin{macrocode} + tabloids/.default = true, + tabloids/.is choice, + tabloids/true/.code = {% + \global\let\vrule@YT=\vrule@none@YT + \global\let\hrule@YT=\hrule@normal@YT + }, + tabloids/false/.code = {% + \global\let\vrule@YT=\vrule@normal@YT + \global\let\hrule@YT=\hrule@normal@YT + }, + tabloids/on/.style = {tabloids/true}, + tabloids/off/.style = {tabloids/false}, + notabloids/.style = {tabloids/false}, +} % \end{macrocode} % % \changes{v1.2}{2012/06/17}{No longer pass options to \textsf{xcolor}.} % Process the options now. Then we load \textsf{xcolor}. % \begin{macrocode} -\ytableausetup{nosmalltableaux,mathmode,baseline} -\RequirePackage{pgfopts} +\ytableausetup{nosmalltableaux,mathmode,baseline,notabloids} +\RequirePackage{pgfopts}[2011/06/02] \ProcessPgfPackageOptions{/ytableau/options} \RequirePackage{xcolor} % \end{macrocode} @@ -1192,8 +1281,8 @@ % \begin{macrocode} \newcommand{\none@YT}[1][]{% \def\thisboxcolor@YT{clear}% - \fboxsep = \boxframe@YT\relax - \fboxrule = 0pt % + \let\hrule@YT=\hrule@none@YT + \let\vrule@YT=\vrule@none@YT \startbox@@YT#1\endbox@YT \nullfont } @@ -1268,44 +1357,82 @@ \hss \egroup % \end{macrocode} -% We want all the boxes to have a consistent baseline, so we normalize them to the same size. -% Multiple text lines will be aligned with the baseline of the last line at the center, so this -% really only works well for single lines of text. +% We want all the boxes to have a consistent baseline, so we normalize them to +% the same size. Multiple text lines will be aligned with the baseline of the +% last line at the center, so this really only works well for single lines of +% text. % \begin{macrocode} \ifbaseline@YT \ht\thisbox@YT=\ht\refhtdp@YT \dp\thisbox@YT=\dp\refhtdp@YT \fi +% \end{macrocode} +% The extra |\fboxrule| is to account for the margin on the vertical edges of +% the frame. +% \begin{macrocode} \fcolorbox@YT{\thisboxcolor@YT}{% - \vbox to \boxdim@YT{\vss\box\thisbox@YT\vss}% + \vbox to \dimexpr\boxdim@YT + \fboxrule\relax{\vss\box\thisbox@YT\vss}% }% } % \end{macrocode} % \end{macro} % % \begin{macro}{\fcolorbox@YT} -% We need a wrapper around |\fcolorbox| since it produces an opaque box, and sometimes, we want -% |clear|. +% \changes{v1.3}{2012/08/14}{Rewrote to draw the vertical and horizontal lines +% separately, so the \texttt{tabloids} option is possible.} +% We need a wrapper around |\colorbox| since it produces an opaque box, and +% sometimes, we want |clear|. We also have to draw the frame carefully. Note +% the order of the |\vbox| and the |\hbox|: it has to be that way, else |\none| +% gives a strange gap at the right edge in tabloids since the inner set of +% rules is shorter, and |\colorbox| does odd things inside a |\vbox|. % % |#1| = color, |#2| = contents % \begin{macrocode} \def\fcolorbox@YT#1#2{% - \compare@@YT{#1}{clear}% - \ifeq@YT +% \end{macrocode} +% This idea is again from \textsf{xcolor}. +% \begin{macrocode} + \lower\fboxrule\vbox{% + \ifodd\fboxrule\kern1sp \fi + \kern0.5\fboxrule + \hbox{% + \kern\fboxrule + \compare@@YT{#1}{clear}% + \ifeq@YT % \end{macrocode} % Clear background; don't draw anything. % \begin{macrocode} - \fbox{#2}% - \else + #2% + \else % \end{macrocode} -% Colored background; pass it to |\fcolorbox|. +% Colored background; pass it to |\colorbox|. % \begin{macrocode} - \fcolorbox{.}{#1}{#2}% - \fi + \colorbox{#1}{#2}% + \fi + \rules@YT{v}% + }% + \kern-0.5\fboxrule + \rules@YT{h}% + }% } % \end{macrocode} % \end{macro} % +% \begin{macro}{\rules@YT} +% \changes{v1.3}{2012/08/14}{Added.} +% Draws |\boxdim@YT|-spaced rules either |h|orizontally or |v|ertically. This +% is so that the entire frame can be drawn after the contents of a box. +% It is drawn \emph{before} the current location. +% \begin{macrocode} +\def\rules@YT#1{% + \expandafter\let\expandafter\rule@YT\csname #1rule@YT\endcsname + \kern-\dimexpr\boxdim@YT + \fboxrule\relax + \rule@YT + \kern\boxdim@YT + \rule@YT +} +% \end{macrocode} +% \end{macro} % \subsection{\texttt{ytableaushort} command} % \changes{v1.2}{2012/06/17}{Fixed a bug in \texttt{\textbackslash ytableaushort} where \texttt{\{,\}} was treated as a comma at the beginning of a line.} % diff --git a/Master/texmf-dist/tex/latex/ytableau/ytableau.sty b/Master/texmf-dist/tex/latex/ytableau/ytableau.sty index 9a4203d2dcd..af03c28f3cf 100644 --- a/Master/texmf-dist/tex/latex/ytableau/ytableau.sty +++ b/Master/texmf-dist/tex/latex/ytableau/ytableau.sty @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{ytableau} - [2012/06/17 v1.2 Many-featured Young tableaux and Young diagrams] + [2012/08/14 v1.3 Many-featured Young tableaux and Young diagrams] \newbox\tableaux@YT @@ -44,6 +44,20 @@ \def\boxdim@normal@YT{1.5em} \let\boxdim@save@YT = \boxdim@normal@YT \edef\macro@boxdim@YT{\boxdim@normal@YT} +\def\hrule@normal@YT{% + \hrule width \dimexpr \boxdim@YT + \fboxrule * 2\relax + height \fboxrule +} +\def\vrule@normal@YT{% + \vrule height \dimexpr \boxdim@YT + \fboxrule\relax + width \fboxrule +} +\def\hrule@none@YT{\kern\fboxrule} +\def\vrule@none@YT{% + \vrule width 0pt + height \dimexpr \boxdim@YT + \fboxrule\relax + \kern\fboxrule +} \def\font@YT{} \def\set@mathmode@YT{% \gdef\skipin@YT{$}% @@ -140,8 +154,23 @@ nobaseline/.style = {baseline = false}, centerboxes/.style = {baseline = false}, } -\ytableausetup{nosmalltableaux,mathmode,baseline} -\RequirePackage{pgfopts} +\pgfkeys{/ytableau/options, + tabloids/.default = true, + tabloids/.is choice, + tabloids/true/.code = {% + \global\let\vrule@YT=\vrule@none@YT + \global\let\hrule@YT=\hrule@normal@YT + }, + tabloids/false/.code = {% + \global\let\vrule@YT=\vrule@normal@YT + \global\let\hrule@YT=\hrule@normal@YT + }, + tabloids/on/.style = {tabloids/true}, + tabloids/off/.style = {tabloids/false}, + notabloids/.style = {tabloids/false}, +} +\ytableausetup{nosmalltableaux,mathmode,baseline,notabloids} +\RequirePackage{pgfopts}[2011/06/02] \ProcessPgfPackageOptions{/ytableau/options} \RequirePackage{xcolor} \newenvironment{ytableau}[1][] @@ -194,8 +223,8 @@ \def\cr@YT{\cr} \newcommand{\none@YT}[1][]{% \def\thisboxcolor@YT{clear}% - \fboxsep = \boxframe@YT\relax - \fboxrule = 0pt % + \let\hrule@YT=\hrule@none@YT + \let\vrule@YT=\vrule@none@YT \startbox@@YT#1\endbox@YT \nullfont } @@ -225,16 +254,33 @@ \dp\thisbox@YT=\dp\refhtdp@YT \fi \fcolorbox@YT{\thisboxcolor@YT}{% - \vbox to \boxdim@YT{\vss\box\thisbox@YT\vss}% + \vbox to \dimexpr\boxdim@YT + \fboxrule\relax{\vss\box\thisbox@YT\vss}% }% } \def\fcolorbox@YT#1#2{% - \compare@@YT{#1}{clear}% - \ifeq@YT - \fbox{#2}% - \else - \fcolorbox{.}{#1}{#2}% - \fi + \lower\fboxrule\vbox{% + \ifodd\fboxrule\kern1sp \fi + \kern0.5\fboxrule + \hbox{% + \kern\fboxrule + \compare@@YT{#1}{clear}% + \ifeq@YT + #2% + \else + \colorbox{#1}{#2}% + \fi + \rules@YT{v}% + }% + \kern-0.5\fboxrule + \rules@YT{h}% + }% +} +\def\rules@YT#1{% + \expandafter\let\expandafter\rule@YT\csname #1rule@YT\endcsname + \kern-\dimexpr\boxdim@YT + \fboxrule\relax + \rule@YT + \kern\boxdim@YT + \rule@YT } \newcommand{\ytableaushort}[2][]{% \toks@YT={}% -- cgit v1.2.3