% ----------------------------------------------------------------------
% aTableau manual - Andrew Mathas (C) 2022-2026
% Modified: 22:41 Tuesday, 02 June 2026
% Package meta data comes from atableau.ini via \aTableauMeta
% ----------------------------------------------------------------------
\documentclass{amsart}
\usepackage[svgnames,table]{xcolor}
\usepackage{atableau}

% fix lingering font warnings...
\usepackage[T1]{fontenc}
\usepackage{libertinus}

\usepackage{bbding}
\usepackage{bm}
\usepackage{booktabs}
\usepackage{cite}
\usepackage{cprotect}
\usepackage{longtable}
\usepackage{manfnt}
\usepackage{mathtools}
\usepackage{MnSymbol}
\usepackage{siunitx}
\usepackage{xltabular}
\usepackage{xspace}

% ----------------------------------------------------------------------
\usepackage{array}
\newcolumntype{L}{>{\sffamily\color{MidnightBlue}\textbackslash}l}
\newcolumntype{O}{>{\sffamily\color{aTableauInner}}l}

% ---------------------------------------------------------------------------
\usepackage{enumitem}
\setlist{itemsep=2mm, parsep=2mm}
\newlist{options}{description}{1}
% remove the colon from the description label by redefining \makelabel
\setlist[options]{
  before=\let\makelabel\optionlabel,
  labelwidth=\textwidth,
  nosep,
}

% ---------------------------------------------------------------------------
% the index
\usepackage{imakeidx}
\indexsetup{level=\section*, toclevel=section, noclearpage}
\makeindex[columns=3]
\renewcommand*{\seename}{see}

% ----------------------------------------------------------------------
\usepackage[a4paper,hmargin=24mm, vmargin=18mm, footskip=10mm]{geometry}
\synctex=1
\hfuzz=5pt
\parindent=0pt
\parskip=4mm

% ----------------------------------------------------------------------
% draw a little rectangle showing the corresponding aTableau colour
\newcommand\aTableauColour[1]{%
  \,\tikz[baseline={([yshift=0.5mm]current bounding box.south)}]\node[minimum width=3ex, minimum height=2ex,fill=aTableau#1]{};\,%
}

% ----------------------------------------------------------------------
\ExplSyntaxOn

% ----------------------------------------------------------------------
% In the table summarising the keys, \Yes and \No are used to add links
% for the section of the manual that describes the corresponding key,
% with the key-name given as an optional argument.  There is an extra
% caveat in that some keys have description in both the tableau and
% abacus sections of the manual, which is handled by a second optional
% argument of the form (section).

% the key applies to tableaux or abacuses (or both), with \Yes adding a
% hyperlink when it does.

\newcommand\No{\textcolor{red}{\XSolidBrush}}

% usage: \Yes[key](section)
\NewDocumentCommand\Yes{o d()}
{
  \IfNoValueTF{#1}
  {
    \IfNoValueTF{#2}
    { \hyperref[\g_lastlink_tl]{\textcolor{ForestGreen}{\CheckmarkBold}} }
    { \hyperref[Key:#2]{\textcolor{ForestGreen}{\CheckmarkBold}} }
  }
  {
    \hyperref[\g_lastlink_tl-\str_lowercase:f{#1}]{\textcolor{ForestGreen}{\CheckmarkBold}}
  }
}

% \optionlabel applies \option to the csv in #1 except in the case
% when #1 starts with a * when the rest of #1 is printed
% usage: \optionlabel{key}
\NewDocumentCommand\optionlabel{ m }
{
    \str_if_eq:eeTF { \str_head:n {#1} } {*}
    {
        \tl_set:Nx \l_tmpb_tl { \tl_tail:n {#1} }
        \tl_put_left:Nn \l_tmpb_tl {\sffamily\color{aTableauInner}}
    }
    {
        \tl_clear:N \l_tmpa_tl
        \tl_clear:N \l_tmpb_tl
        \clist_map_inline:nn {#1}
        {
            \tl_put_right:Ne \l_tmpb_tl { \l_tmpa_tl \exp_not:N\option{##1}}
            \tl_set:Nn \l_tmpa_tl {,~}
        }
    }
    \l_tmpb_tl\hss
}

% Add hyperlinks for (new displayed) options
\tl_new:N \g_lastlink_tl
\prop_new:N \l__aTableau_options_prop
\NewDocumentCommand\AddKeyLink{m}
{
   \tl_gset:Nx \g_lastlink_tl {Key:\str_lowercase:f{#1}}
   \prop_if_in:NVF \l__aTableau_options_prop \g_lastlink_tl
   {
      \phantomsection\exp_args:Nf\label{Key:\str_lowercase:f{#1}}% add a label for references
      \prop_put:NVn \l__aTableau_options_prop \g_lastlink_tl {}
   }
}

% Add an index entry for a key. The *-form underlines the page number,
% indicating that it is the definition of the key, and records this in
% \l__aTableau_index_prop. When the * is not present, we check to make
% sure that an underlined entry has not already been added for this
% page.
\prop_new:N \l__aTableau_index_prop
\NewDocumentCommand\AddIndexEntry{ sm }
{
    \tl_set:No \l_tmpc_tl {#2-\thepage}
    \IfBooleanTF{#1}
    {
        \prop_put:NVn \l__aTableau_index_prop \l_tmpc_tl {}
        \index{#2|underline}
    }
    { \prop_if_in:NVF \l__aTableau_index_prop \l_tmpc_tl { \index{#2} } }
}

% \option*[default value]{option name}[accepted values]<hyperlink context>(link name)
% The \option command is slightly overloaded, both in terms of arguments
% (there are five) and in terms of use.
% 1. If #2 is given then \option gives the syntax for the using this key:
%    - #1=* determines whether a \newline or \bigskip is inserted. The
%      *-version is used when a block of keys are listed together
%    - #2 gives the default options
%    - #3 is the key name and optionally may take the form key=value
%      to describe the allowed values. If the value is given then it is
%      printed in orange after the key inside \langle...\rangle. This is
%      intended for "generic values like 'value' or 'style'.
%      The key component of #2 is used to add a hyperlink to the current
%      location, which takes the form Key:<key>-<context>, where the
%      <context> is added only if #5 is supplied
%    - any accepted values in #3 are printed in the right-hand margin
% 2. When #2 (=default value) is omitted, this is an inline citation of
%    the key. A hyperlink is added

% The *-version does not do a \bigskip before the option. A hyperlink is
% added for new displayed options. If #2 is blank then the *-version
% puts (no) before the option key. If #5 is given then it is added to
% to the hyperlink.
\NewDocumentCommand\option{ somo d<> d()}
{%
  \seq_set_split:Nnn \l_tmpa_seq {=} {#3}%
  \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl%
  \seq_if_empty:NTF \l_tmpa_seq
  { \tl_clear:N \l_tmpb_tl }
  { \tl_set:No \l_tmpb_tl { \seq_use:Nn \l_tmpa_seq {=} } }
  \IfNoValueTF{#2}
  {%
    \IfNoValueTF{#6}
    {
      \tl_gset:Nx \g_lastlink_tl {Key:\str_lowercase:f{\l_tmpa_tl}}
      \IfNoValueF{#5} { \tl_gput_right:No \g_lastlink_tl {\str_lowercase:f{-#5}} }
    }
    { \tl_gset:Ne \g_lastlink_tl {Key:#6} }
    \hyperref[\g_lastlink_tl]{\textsf{\color{aTableauInner}\IfBooleanT{#1}{(no)~}\l_tmpa_tl}}
    \AddIndexEntry{\l_tmpa_tl}%
    \tl_if_empty:NF \l_tmpb_tl { \textsf{\,$=$}\textsf{\textcolor{orange}{\l_tmpb_tl}} }
  }
  {%
    % encourage page breaks *before* the option, rather than after it
    \IfBooleanTF{#1}{\newline}{\bigskip\pagebreak[0]}%
    % adjust #3 if it contains a *, when we add = <value>
    % add a label for references
    \IfNoValueTF{#5} { \AddKeyLink{\l_tmpa_tl} }{ \AddKeyLink{\l_tmpa_tl-#5} }
    \noindent\textsf
    {
        \textcolor{aTableauInner}{\l_tmpa_tl}
        \tl_if_empty:NF \l_tmpb_tl { \textcolor{orange}{$\,=\langle$\l_tmpb_tl$\rangle$} }
    }
    \tl_if_blank:nF {#2}
    { ~ \tl_if_eq:nnTF{#2} {-} {(default)} {(default:~\textcolor{DarkRed}{#2})} }%
    \hfill%
    \IfNoValueF{#4}{\textcolor{Grey}{[accepts:~#4]}}%
    \AddIndexEntry*{\l_tmpa_tl}%
    \nopagebreak[4]%
  }%
}

% index command ignoring the backslash and capitalisation
\cs_new_protected:Npn \__addto_index:nn #1#2 { \index{#2@\textbackslash #1} }
\cs_generate_variant:Nn \__addto_index:nn {nV}
\NewDocumentCommand\indexcmd{m}
{
    \tl_set:Nx \l_tmpa_tl { \str_lower_case:n {#1} }
    \__addto_index:nV {#1} \l_tmpa_tl
}

% ---------------------------------------------------------------------------

% heading lines in tabular environments
\newcommand\heading[1]{\textcolor{MidnightBlue}{\textsf{\large#1}}}

% set alternating row colours in tabular environments
\rowcolors{1}{}{LightSkyBlue!10}

% displaying a colour theme
\NewDocumentCommand\ColourTheme{ m }
{
  \begin{samepage}
    \option{colour~theme=#1}
    \aTabset{colour~theme=#1, align=top}
    \index{colour~theme!#1}
    \rowcolors{2}{}{LightSkyBlue!10}
    \par
    \begin{tabular}[t]{lll}
      \toprule
      \heading{Colour} & \heading{Name} & \heading{HTML}\\
       \midrule
       \aTableauColour{Main}  & aTableauMain  & \prop_item:Nn \l__aTableau_colour_theme_prop {#1_Main} \\
       \aTableauColour{Inner} & aTableauInner & \prop_item:Nn \l__aTableau_colour_theme_prop {#1_Inner}\\
       \aTableauColour{Star}  & aTableauStar  & \prop_item:Nn \l__aTableau_colour_theme_prop {#1_Star}\\
       \aTableauColour{Skew}  & aTableauSkew  & \prop_item:Nn \l__aTableau_colour_theme_prop {#1_Skew} \\
       \aTableauColour{Fill}  & aTableauFill  & \prop_item:Nn \l__aTableau_colour_theme_prop {#1_Fill}\\
       \aTableauColour{Rod}   & aTableauRod   & \prop_item:Nn \l__aTableau_colour_theme_prop {#1_Rod}\\
       \bottomrule
    \end{tabular}
    \hfill
    \Abacus{4}{4_u,4_a,4_e,4_l,4_b,4_a,4_T,0_a}\qquad
    \Abacus[traditional]{4}{2_a,[bead=aTableauFill]0^2|[bead=aTableauFill]1,1_b,1_a,1_T|1_u,1_a,1_e,1_l|[bead=aTableauFill]2^2,[bead=red]2} \qquad

    \par\vspace*{3mm}

    \hspace*{-3mm}
    \Tableau{1239,456{10},78}\quad
    \Tableau{ 1*2*3*4*5, 6*789, {10}*{11}{12} }\quad
    \Tabloid[skew={2,1}]{19{11},29{10},6} \quad
    \SkewTableau[skew~boxes, skew~border, cover=4^3] {2,1^2}{123,45,67} \quad
    \Multitableau[tabloid]{ 123,45 | 67,89, {10}} \quad

    \par\vspace*{4mm}
  \end{samepage}
}

% ---------------------------------------------------------------------------
% the testing framework

% \ifTesting is True when we are testing the examples against previous
% runs. This is used to define new versions of the example and Example
% environment that save the example to a file using \SaveExample
\newif\ifTesting

% Enable \ifTesting for atableau-testing.tex, which is a symbolic link
% to atableau.tex
\str_if_eq:VnT \jobname {atableau-examples} {\Testingtrue}

\iow_new:N \__aTableau_example_iow
\cs_generate_variant:Nn \str_replace_all:Nnn { Nnx }

% Usage: \SaveExample {filename} {example}
% Save an example to an external file in the testing directory so that
% we can check for changes in the output from the example code.
\NewDocumentCommand\SaveExample{m +m}
{
    \refstepcounter{example} % want to save the example number
    \iow_open:Nn \__aTableau_example_iow { #1.tex }
    % the examples are controlled by a custom document class
    \iow_now:Nn  \__aTableau_example_iow { \documentclass{atableau_example} }
    \iow_now:Nn  \__aTableau_example_iow { \begin{document} }
    % try and extract the page reference from the aux file
    \iow_now:Ne  \__aTableau_example_iow { \c_percent_str\space~Example~\theexample,~page~\getpagerefnumber{atab-Ex\c_colon_str#1} }
    \str_set:Ne  \l_tmpa_str { \tl_to_str:n{#2} }
    \str_replace_all:Nnx \l_tmpa_str { ## } { \c_hash_str }
    \iow_now:Ne  \__aTableau_example_iow { \l_tmpa_str }
    \iow_now:Nn  \__aTableau_example_iow { \end{document} }
    \iow_close:N \__aTableau_example_iow
}

\ExplSyntaxOff

% ---------------------------------------------------------------------------
% page headings
\makeatletter
\def\@evenhead{\hfill\aTableau\hfill}
\let\@oddhead\@evenhead
\def\@oddfoot {\color{aTableauMain} Version \aTableauMeta{version}~(\aTableauMeta{release_date})\hfill\thepage}
\def\@evenfoot{\color{aTableauMain} \thepage\hfill Version \aTableauMeta{version}~(\aTableauMeta{release_date})}

% streamline font warnings following David Carlisle https://tex.stackexchange.com/a/663843/234252
\let\old@font@info\@font@info
\def\@font@info#1{%
  \expandafter\ifx\csname\detokenize{#1}\endcsname\relax\old@font@info{#1}\fi%
  \expandafter\xdef\csname\detokenize{#1}\endcsname{}%
}

\makeatother

% ---------------------------------------------------------------------------
%\renewcommand\thesubsection{\thesection\Alph{subsection}}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\renewcommand\thesubsection{\thesection\Alph{subsection}}
\renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}}

\makeatletter
\def\l@subsection{\@tocline{2}{0pt}{2.5pc}{5pc}{}}
\def\l@subsubsection{\@tocline{2}{0pt}{3.5pc}{3pc}{}}
\makeatother

% warning environment to alert the reader to tricky points
\newenvironment{warning}{%
    \list{\raisebox{-2ex}[0pt][0pt]{\textcolor{red}{\textdbend}}}%
         {\leftmargin=3em}%
         \item%
}{\endlist}

% ---------------------------------------------------------------------------
\usepackage[skins]{tcolorbox}

% Improved paragraph breaks, removing overfull hbox warnings
% following https://tex.stackexchange.com/a/280881/234252
% Adds roughly 0.03 seconds per page when compiling
\usepackage[parfill]{parskip}

\tcbset{
  parskip/.style={
    before={\par\pagebreak[0]\parindent=0pt},
    after={\parfillskip=0pt\par},
  },
}

\parfillskip=0pt plus 1fil\relax

% ---------------------------------------------------------------------------
\tcbuselibrary{listings, breakable}

\DeclareTotalTCBox\keyword{ O{} v }
{
  bottom=0pt,
  colback  = Ivory,
  colupper = aTableauInner,
  fontupper= \bfseries,
  fontlower= \bfseries,
  left     = 0mm,
  right    = 0mm,
  size     = tight,
  skin     = tile,
  top      = 0pt,
  nobeforeafter,
  on line,
  verbatim,
  shrink tight,
  size=tight,
  #1}
{#2}

\NewTColorBox{slide}{ O{} }
{
  enhanced,
  skin=bicolor,
  before skip=-2mm,
  %after skip=2mm,
  attach boxed title to top left={xshift=0cm,yshift*=0mm-\tcboxedtitleheight},
  boxrule=0.6pt,
  boxed title style={
    size=small,
    sharp corners=uphill,
    boxrule=0.6pt,
  },
  arc is curved,
  arc = 1.5mm,
  height=0.25\linewidth,
  width=0.3\linewidth,
  after=\hfill,
  before=\hfill,
  fonttitle=\tiny\sffamily,
  colback=AliceBlue,
  colbacklower=OldLace,
  colframe=RoyalBlue!50,
  colbacktitle=RoyalBlue!70,
  #1
}

% ---------------------------------------------------------------------------
\newcommand\aTableau{\textcolor{aTableauMain}{\sffamily aTableau}\xspace}

% hyperref links to ctan
\newcommand\TeXLive{\href{https://www.tug.org/texlive/}{TeX~Live}\xspace}
\newcommand\TikZ{\href{https://www.ctan.org/pkg/tikz}{Ti\textit{k}Z}\xspace}
\newcommand\arXiv{\href{https://arxiv.org/}{arXiv}\xspace}
\newcommand\ctan[1]{\href{https://www.ctan.org/pkg/#1}{\texttt{#1}}}

\lstdefinestyle{aTableau}
{
  style=tcblatex,
  classoffset=0,
  texcsstyle=*\color{MediumBlue},%
  deletetexcs={begin, end},
  commentstyle=\color{Peru},
  moretexcs={,% aTableau package commands
    aTabset,
    Abacus,
    Diagram,
    Multidiagram,
    Multitableau,
    NewATableauCommand,
    RibbonTableau,
    ShiftedDiagram,
    ShiftedTableau,
    SkewTableau,
    SkewDiagram,
    Tableau,
    Tabloid,
  },%
% Highlighting of multi-word keys is not possible, so we do not highlight the keys
%  classoffset=1, % aTableau package options
%  keywordstyle=\color{aTableauInner},%
%  morekeywords={
%    Australian,
%    English,
%    French,
%    Russian,
%    align,
%    australian,
%    border,
%    box,
%    boxes,
%    color,
%    colour,
%    cols,
%    conjugate,
%    delimiter,
%    delimiters,
%    dotted,
%    e,
%    east,
%    english,
%    entries,
%    finite,
%    font,
%    french,
%    halign,
%    height,
%    infinite,
%    inner,
%    label,
%    left,
%    math,
%    no,
%    nodes,
%    north,
%    only,
%    ribbon,
%    ribbons,
%    right,
%    rows,
%    scale,
%    separator,
%    separators,
%    shape,
%    shifted,
%    skew,
%    snobs,
%    valign,
%    south,
%%   star,
%%   style,
%    tabloid,
%    text,
%    type,
%    russian,
%    wall,
%    west,
%    width,
%    xoffset,
%    xscale,
%    yoffset,
%    yscale,
%  },
%  classoffset=2, % aTableau values
%  keywordstyle=\color{orange},%
%  morekeywords={
%    A, C, DD, AA,
%    beta,
%    bottom,
%    center,
%    centre,
%    contents,
%    false,
%    first,
%    hooks,
%    last,
%    left,
%    residues,
%    right,
%    row,
%    top,
%    true,
%  },
%  classoffset=3, % TikZ and LaTeX commands
%  keywordstyle=\color{teal},%
%  morekeywords={
%    draw,
%    foreach,
%    node,
%    small,
%    tiny,
%    tikz,
%    tikzpicture,
%    tikzset,
%  },
%  classoffset=4,% TikZ keys
%  keywordstyle=\color{red},
%  morekeywords={
%    circle,
%    fill,
%    overlay,
%    picture,
%    radius,
%    remember,
%    style,
%  },
  classoffset=5,   % commands that we want to hide :)
  keywordstyle=\color{LightSkyBlue!10},
  morekeywords={
    bigskip,
    medskip,
    newline,
    par,
    qquad,
    quad,
    smallskip,
    space,
  },
}


\lstdefinestyle{aTableau_beamer}
{
  style=tcblatex,
  language=TeX,
  texcsstyle=*\color{MediumBlue},%
  deletetexcs={begin, end},
  texcsstyle=*\color{MediumBlue},%
  keywordstyle=\color{orange},
  morecomment=[is]{\%}{\^^M}
  }

% ---------------------------------------------------------------------------
\NewDocumentCommand\set{ O{} >{\SplitArgument{1}{|}}m }{#1\{\,\SetContents{#1}#2\,#1\}}
\NewDocumentCommand\SetContents{mmm}{\IfNoValueTF{#3}{#2}{#2\,#1|\,\mathopen{}#3}}

\newcommand\T{\mathsf{t}}
\newcommand\blam{{\bm{\lambda}}}

% ---------------------------------------------------------------------------
% manual title
\makeatletter
\author{ \aTableauMeta{authors} }
\usepackage{tikz}
\usetikzlibrary{
  arrows.meta,
  backgrounds,
  decorations.pathmorphing,
  matrix,
  patterns,
  shadows.blur,
  shapes.geometric,
}
\tikzset{
  shadowed/.style={
    blur shadow={shadow blur steps=5},
    bottom color=RoyalBlue,
    draw=NavyBlue!70,
    shade,
    font=\normalfont\Huge\bfseries\sffamily,
    %rounded corners=8pt,
    top color=LightSkyBlue!30,
  },
  boxes/.style={draw=RoyalBlue,
    fill=AliceBlue,
    font=\sffamily\small,
    inner sep=5pt,
    rectangle,
    rounded corners=8pt,
    text=MidnightBlue,
  }
}

% define the heading as a command because it contains \aTableauMeta{version}
\newcommand\aTableauHeader{%
  \begin{center}
    \begin{tikzpicture}
      \aTabset{border=false}
      \draw[shadowed, rounded corners](30mm,0) rectangle node[white]{ } (\paperwidth-30mm,22mm);
      \begin{scope}[shift={(2.6,-0.2)}]
        \aTabset{scale=0.5, ribbon style={fill=LightSkyBlue!10}, inner wall=MidnightBlue}
        \Diagram(4,2) [ribbons={11,12,13,21,23,31,32,33,41,43,51,53}]{}     % A
        \Diagram(5,2) [ribbons={11,12,13,22,32,42,52}]{}                    % T
        \Diagram(6,2) [ribbons={11,12,13,21,23,31,32,33,41,43,51,53}]{}     % A
        \Diagram(7,2) [ribbons={11,12,13,21,23,31,32,33,41,43,51,52,53}]{}  % B
        \Diagram(8,2) [ribbons={11,21,31,41,51,52,53}]{}                    % L
        \Diagram(9,2) [ribbons={11,12,13,21,31,32,33,41,51,52,53}]{}        % E
        \Diagram(10,2)[ribbons={11,12,13,21,23,31,32,33,41,43,51,53}]{}     % A
        \Diagram(11,2)[ribbons={11,13,21,23,31,33,41,43,51,52,53}]{}        % U
      \end{scope}
      \node[anchor=west,boxes] at (4cm,0cm) { \aTableauMeta{authors} };
      \node[anchor=east,boxes] at (\paperwidth-4cm,0) {Version \aTableauMeta{version}};
    \end{tikzpicture}
  \end{center}
}

% ----------------------------------------------------------------------
\usepackage{hyperref}
\hypersetup{
  pdfcreator={ Generated by pdfLaTeX },
  pdfinfo={
    Author  ={ \aTableauMeta{authors}     },
    Keywords={\aTableauMeta{keywords}},
    License ={ \aTableauMeta{license}     },
    Subject ={ \aTableauMeta{description} },
    Title   ={ aTableau manual - \aTableauMeta{version} },
    CreationDate={\aTableauMeta{release_date}},
    Copyright={\aTableauMeta{copyright} \aTableauMeta{authors}},
  },
  colorlinks=true,
  linkcolor=blue,
  citecolor=FireBrick,
  urlcolor=MediumBlue,
}

\ExplSyntaxOn
% define the authors, adding a URL if one is specified in the ini file
\prop_if_in:NnTF \l__aTableau_meta_prop {author_url}
{ \newcommand\aTableauAuthor{\href{https\c_colon_str//\aTableauMeta{author_url}}{\aTableauMeta{authors}}} }
{ \newcommand\aTableauAuthor{\aTableauMeta{authors}} }
\ExplSyntaxOff
\makeatother

% ----------------------------------------------------------------------
\numberwithin{equation}{subsection}
\def\equationautorefname~#1\null{(#1)\null}
\renewcommand\sectionautorefname{Chapter}
\renewcommand\subsectionautorefname{Section}
\def\subsubsectionautorefname~#1\null{\S#1\null}

% ----------------------------------------------------------------------
\newcounter{example}
\numberwithin{example}{subsection}
\newcommand\exampleautorefname{Example}

% Each of the example environments must have a label. In the manual,
% \autoref{Ex:<label>} is used to refer to specific examples. The python
% script test_atableau.py can be used to extract each example into a
% separate file, with filename given by the label. This file is used to
% check that the example has not changed during development.  The labels
% all take the form: <aTableau command><key..> to help identify the
% example and make it easier to test for changes in the output for
% particular commands. For example, some of the labels are:
%    abacusBeadPositions diagramRussian multiBoxFont
%    multiShifted ribbonEnhanced shiftedEntries
%    tableauConjugate tableauScaled traditionalTick
% The example files are stored by label, rather than by example number,
% because example numbers can change. The example number is stored in
% the LaTeX file, but only as a comment.

% The definitions of the example environments depend on \Testingtrue
\ifTesting

  % Save example to an external file in the testing directory so
  % that we can test for changes in their output

  % \begin{example}[ignored tcb settings]*{label}...\end{example}
  % The * indicates that the example should not be saved by \SaveExample when testing
  \NewDocumentEnvironment{example}{ O{} s m +b} { \IfBooleanF{#2}{ \SaveExample{#3}{#4} }}{}
  \NewDocumentEnvironment{Example}{ O{} s m +b} { \IfBooleanF{#2}{ \SaveExample{#3}{#4} }}{}

  % To write page references for the examples we first need to use xr to read ../atableau.aux
  % and then use refcount to write the page reference numbers as pageref is not expandable.
  % We cannot use the page nubers produced from atableau-examples.tex because this file
  % skips over the examples, so the page numbers do not match those in the manual.
  \nofiles
  \usepackage{refcount}
  \usepackage{xr}
  \externaldocument[atab-]{../atableau}
\else

  % compiling the manual normally with all examples intact

  % \begin{example}[tcb settings]*{label}...\end{example}
  % The * indicates that the example should not be saved by SaveExample when testing
  \NewTCBListing[use counter=example, number within=subsection]{example}{ O{} s m }
  {%
    label=Ex:#3,
    enhanced,
    skin=bicolor,
    colframe=RoyalBlue!70,
    colbacklower=OldLace,
    colback=LightSkyBlue!10,
    colbacktitle=RoyalBlue!70,
    attach boxed title to top right={xshift=0mm,yshift=-3.1mm},
    boxed title style={
      size=small,
      arc=1mm,
      bottom=-1mm,
      sharp corners=northwest,
      sharp corners=southeast,
    },
    title={\tiny\thetcbcounter},
    sharp corners=northeast,
    parbox=false,
    lefthand width=0.34\textwidth,
    listing style=aTableau,
    parbox=false,
    parskip=4mm
    sidebyside,
    sidebyside align=top seam,
    sidebyside gap=2mm,
    text and listing,
    text outside listing,
    parbox=false,
    boxsep = 0pt,
    left=0mm,
    #1
  }

  % \begin{Example}[tcb settings]*{label}...\end{Example}
  % The * indicates that the example should not be saved by SaveExample when testing
  \NewTCBListing[use counter=example, number within=subsection]{Example}{ O{} s m }
  {%
    label=Ex:#3,
    enhanced,
    skin=bicolor,
    colframe=RoyalBlue!50,
    colbacklower=OldLace,
    colback=LightSkyBlue!20,
    colbacktitle=RoyalBlue!70,
    breakable,
    width=\textwidth,
    attach boxed title to top right={xshift=0mm,yshift=-3.1mm},
    boxed title style={
      size=small,
      arc=1mm,
      bottom=-1mm,
      sharp corners=northwest,
      sharp corners=southeast,
    },
    title={\tiny\thetcbcounter},
    sharp corners=northeast,
    parbox=false,
    listing style=aTableau,
    text and listing,
    listing above text,
    center lower,
    #1
  }

\fi

\begin{document}

  % --------------------------------------------------------------
  % title page
  \begin{center}
    \renewcommand\footnoterule{}
    \aTableauHeader

    \kern-2mm
    \begin{quote}
      A \LaTeX\ package for symmetric group combinatorics, including
        abacuses,
        Young diagrams,
        tableaux,
        tabloids,
        skew tableaux,
        multitableaux,
        shifted tableaux,
      and
        ribbon tableaux.

      This package requires \TeXLive 2024 or later.
    \end{quote}

    \kern-2mm
    \aTabset{
      scale=0.6,
      box font=\scriptsize,
      styles = {
        B = {fill=blue!40, text=yellow},
        G = {fill=green!80!blue,circle,minimum size=3mm},
        R = {fill=red,text=white, font=\tiny},
        Y = {fill=yellow!20, text=blue},
        b = {ball color=blue},
        r = {ball color=red},
        w = {ball color=white},
      }
    }
    \begin{tikzpicture}
      \Tableau(0,0){[R]1[B]2,[G]3,[Y]4} \quad
      \Tableau(2.25,1)[australian]{[R]1[B]2,[G]3,[Y]4} \quad
      \Tableau(3.5,1.75)[skew={0,2}]{[Y]4[G]3[R]1,[B]2} \quad
      \Tableau(6,0)[russian,skew={0,1^2}]{[B]2[R]1,[G]3,[Y]4} \quad
      \Tableau(7.5,-1)[french,skew={0,1^2}]{[B]2[R]1,[G]3,[Y]4} \quad
      \Tableau(6.0,-2.25)[russian]{[R]1[G]3[Y]4,[B]2} \quad
      \Tableau(3.5,-3.0)[french]{[R]1[G]3[Y]4,[B]2} \quad
      \Tableau(2,-1)[australian]{[B]2,[R]1[G]3[Y]4} \quad
      \Abacus(4,0.5)[abacus ends=--,scale=1.4]{3}{[b]9,[w]8,[r]8,[b]6,[b]6,[r]2,[b]1}
    \end{tikzpicture}

    \bigskip

    \begin{minipage}{0.75\textwidth}
      \tableofcontents
      \footnotetext{\copyright\,Copyright \aTableauMeta{copyright}
        \quad\aTableauAuthor\\
        License: \href{https://\aTableauMeta{the README file}}{\aTableauMeta{license}}
      }
    \end{minipage}

    \vfill

  \end{center}

  % --------------------------------------------------------------
  \section{Introduction}

  The \aTableau package, which started as code for drawing tableaux in my
  research, provides commands for drawing common objects in
  algebraic combinatorics and representation theory, together with
  styling options and a key-value interface for additional
  customisation. Internally, everything is drawn using \TikZ (and
  \LaTeX3). \aTableau commands can be used either as standalone
  commands, or as part of a \keyword{tikzpicture} environment. It is
  designed to be both easy to use and easy to customise, so that it can
  draw the wide variety of tableaux and abacuses found in the
  literature.\footnote{In this manual, a ``picture'' is anything drawn
  by an \aTableau command, whereas a ``diagram'' means ``Young
  diagram''.}

  For the impatient, here is an example that shows how to use the
  two main commands provided by the \aTableau package:

  \begin{example}*{impatient}
  \Abacus{4}{4^3,2,1^2,0} \qquad
  \Tableau{1239,456{10},78}
  \end{example}

  If you already know what tableaux and abacuses are, then you can
  probably work out the (basic) syntax of these two commands from this
  example and start using the package. If you do not know what tableaux
  and abacuses are, then you probably do not need this package! In any
  case, you will not find the precise mathematical definitions of these
  objects in this manual, so please consult textbooks like
  \cite{Fulton:Tableaux,Macdonald,Mathas:ULect} if you need them. For
  more advanced usage, such as adding styling, I recommend skimming
  through the manual and looking at the many examples.  \autoref{S:keys}
  gives a summary of the \aTableau commands and their options.

  The \aTableau commands are intended to be easy to use and easy to
  customise. For example, partitions can be entered either as a weakly
  decreasing list of non-negative integers, or using exponential
  notation, or as a sequence of beta numbers (for the \keyword{\Abacus}
  command). Tableaux are entered as comma-separated words. The
  commands support the main conventions for drawing tableaux and
  diagrams.

  By way of example, the following table shows how to draw a
  tableau of shape $\lambda=(4,3^2,2)$ using the four tableau
  conventions supported by \aTableau:

  \begin{center}
      \aTabset{align=centre}
      \rowcolors{2}{}{LightSkyBlue!10}
      \begin{longtable}{lp{0.6\textwidth}l} \toprule % longtable allows footnotes
        \hiderowcolors
        \textcolor{aTableauMain}{Convention} &\textcolor{aTableauMain}{\aTableau command} & \textcolor{aTableauMain}{Picture} \\ \midrule
         \showrowcolors
          English    & \keyword{\Tableau[english]{1234,567,89{10},{11}{12}}}\newline(the default)
                     & \Tableau{1234,567,89{10},{11}{12}}\\[10mm]
          French     & \keyword{\Tableau[french]{1234,567,89{10},{11}{12}}}
                     & \Tableau[french]{1234,567,89{10},{11}{12}}\\[10mm]
          Russian
          \footnote{These tableaux were introduced by Kerov and Ver\v{s}ik \cite{KerovVershik}.
          Earlier versions of this package called these tableaux \textit{Ukrainian tableaux},
          in protest over the Russian invasion of Ukraine. It is unreasonable to punish
          these authors for their government's aggression, so the package now uses the
          more common, and historically accurate, nomenclature from the literature. The
          \option{ukrainian}(russian) option
          is still supported.}
                     & \keyword{\Tableau[russian]{1234,567,89{10},{11}{12}}}
                     & \Tableau[russian]{1234,567,89{10},{11}{12}}\\[10mm]
          Australian
          \footnote{I have not seen a name for this convention in the literature.
                    Calling it the \textit{Australian convention} seems apt.}
                     & \keyword{\Tableau[australian]{1234,567,89{10},{11}{12}}}
                     & \Tableau[australian]{1234,567,89{10},{11}{12}} \\[10mm]
          \bottomrule
      \end{longtable}
      \index{english@English}
      \index{french@French}
      \index{russian@Russian}
      \index{australian@Australian}
  \end{center}

  These examples show how the commands provided by \aTableau work: there
  are basic commands for drawing pictures, and these pictures can be
  embellished with optional arguments, using a key-value interface.
  As described below, it is also possible to apply \TikZ-styling to the different
  components of an \aTableau picture.

  The different conventions for diagrams and tableaux are listed in
  order of their popularity in the literature.  By
  default, the \textit{English} convention is used, so for the first
  tableau above the \emph{english} key can be omitted:
  \begin{example}[lefthand width=0.4\textwidth]{tableauEnglish}
  \Tableau{1234,567,89{10},{11}{12}}
  \end{example}
  These four conventions are used
  in exactly the same way with the \keyword{\Diagram} command:
  \begin{example}[lefthand width=0.4\textwidth]{diagramRussians}
  \Diagram{4,3,3,1} \qquad
  \Diagram[russian]{4,3^2,1}
  \end{example}
  As this example illustrates, partitions can either be typed as a
  comma-separated list of non-negative integers, or using exponential
  notation for the repeated parts, which is usually shorter and easier
  to proofread.

  To use the \aTableau package, add the following line to your document preamble:

  \indexcmd{usepackage}
  \begin{quote}
    \keyword{\usepackage[options]{atableau}}
  \end{quote}

  Here, the \textit{options} are a comma-separated list of
  \aTableau options, or keys, for the default settings. The possible
  options are described below. As an example, to make the tableaux and
  Young diagram commands use the \option{French} convention, by
  default, you could write:

  \begin{quote}
    \keyword{\usepackage[french]{atableau}}
  \end{quote}

  You can change the default options at any point in your document using
  the \keyword{\aTabset} command, and you can use custom options for any
  particular \aTableau picture. In addition, you can define customised
  \aTableau commands using \keyword{\NewATableauCommand}; see
  \autoref{SS:NewTableau}.
  \indexcmd{aTabset}

  Each \aTableau command is designed to be easy to use, easy to
  read, and easy to customise. Each command accepts an optional list of
  key-value specifications, which modify and embellish the picture drawn
  by the command. In addition, optional styling can be applied to entries
  of a tableau, and the beads on an abacus.  Each command can be used as
  a standalone object in a document, or it can be incorporated into a
  larger \keyword{tikzpicture} environment, making it easy to
  use \aTableau commands to create more complicated pictures.

  The general syntax of an \aTableau command is:
  \begin{quote}
    \keyword{\Command (x,y) [options] {...specifications...}}
  \end{quote}

  \index{coordinates}
  \index{coordinates!Cartesian coordinates}
  \index{coordinates!polar coordinates}
  \index{Cartesian coordinates}
  \index{polar coordinates}
  The $(x,y)$-coordinates are optional, being necessary if (and only if)
  the diagram is part of a~\keyword{tikzpicture} environment, as in
  \autoref{Ex:diagramCoordinates} below. Throughout the manual,
  coordinates are always specified as Cartesian coordinates. In fact,
  arbitrary \TikZ coordinates can be used to position \aTableau pictures
  inside a \texttt{tikzpicture} environment, including polar coordinates
  and named coordinates. See \autoref{SS:coordinates} and
  \autoref{SS:abcoordinates} for more detail about using these
  coordinates for tableaux and abacuses, respectively.

  The \aTableau package provides eleven commands for drawing
  pictures:
  \begin{center}
    \begin{tabular}{Lll}
      \toprule
      \heading{Command} & \heading{Picture}              & \heading{Section}\\
      \midrule
      Abacus         & An abacus for a partition         & \autoref{S:Abacus}\\
      Diagram        & A Young diagram for a partition   & \autoref{S:Diagram}\\
      Multidiagram   & An $\ell$-tuple of Young diagrams & \autoref{S:Multitableau} \\
      Multitableau   & An $\ell$-tuple of tableaux      & \autoref{S:Multitableau} \\
      RibbonTableau  & A ribbon tableau                  & \autoref{S:RibbonTableaux} \\
      ShiftedDiagram & A shifted Young diagram           & \autoref{S:Shifted} \\
      ShiftedTableau & A shifted tableau                 & \autoref{S:Shifted} \\
      SkewDiagram    & A skew Young diagram              & \autoref{S:Skew} \\
      SkewTableau    & A skew tableau                    & \autoref{S:Skew} \\
      Tableau        & A tableau                         & \autoref{S:Tableau} \\
      Tabloid        & A tabloid                         & \autoref{S:Tabloid} \\
      \bottomrule
    \end{tabular}
  \end{center}

  In addition to the picture commands, \aTableau provides the
  non-picture commands:
  \begin{itemize}[nosep,topsep=-4mm, after=\medskip]
    \item \keyword{\aTabset} for setting default values for \aTableau keys
    \item \keyword{\NewATableauCommand} for defining custom \aTableau commands;
    see \autoref{SS:NewTableau}
    \item \keyword{\shortminus} for shorter minus signs, which is used
    by \option{entries=contents} in to draw content
    tableaux.\cprotect\footnote{The \aTableau package only defines the
  \keyword{\shortminus} command if it does not already exist. When it
  does not exist, the \keyword{\shortminus} command is defined using
  \verb|\DeclareMathSymbol\shortminus{\mathbin}{AMSa}{"39}|.}
  \end{itemize}

  Key-value \emph{options}, or \emph{keys}, control the style and
  appearance of an \aTableau picture. The keys are optional. The main
  function of this manual is to describe these keys, with examples. This
  section emphasises only some of these options. Every key can be set
  ``globally'' using \keyword{\aTabset{...options...}}, which sets the
  keys in the current \LaTeX{} group. Alternatively, they can be set
  ``locally'' as an option for the current picture. As mentioned already,
  the default options for the document can also be set via
  \keyword{\usepackage[options]{atableau}}.\indexcmd{aTabset}

  Many of the \aTableau options are specific to the particular pictures
  being drawn. A concise list of the \aTableau commands and their options is
  given in \autoref{S:keys}, with the following sections giving more
  details and examples.

  The following keys\footnote{Throughout the manual, each key name is a
  hyperlink to the (first) description of the key in the manual.}
  can be used with all \aTableau commands:

  \begin{options}
    \item[align]\index{align}
    Sets the baseline for vertically aligning diagrams. Use
    \keyword{align=top}, \keyword{align=center}, and
    \keyword{align=bottom} to align the baseline of the diagram
    with the top, centre or bottom of the surrounding objects,
    respectively. By default, all \aTableau pictures are centred.

    \item[beamer]\index{beamer}
    Set the \ctan{beamer} overlay command. See \autoref{SS:Beamer} for details.

    \item[colour theme]
    The \aTableau pictures use a range of different colours for tableaux
    and abacuses, with the default theme using a midnight blue for the
    tableau border and abacus beads, and lighter shades of blue for
    other components. As described in \autoref{S:ColourTheme}, \aTableau
    provides three colour themes. It is also possible to customise
    the colours of \aTableau pictures using the key-value interface.

    \item[math boxes, text boxes]\index{math boxes}\index{text boxes}
    Determines whether tableaux entries, and bead labels, are typeset as
    mathematics or as text.

    \item[name]\index{name}
    Set the prefix for the \TikZ \emph{named coordinates} for the boxes and
    beads in \aTableau pictures.

    \item[rotate]\index{rotate}
    Rotate the coordinate axes for tableaux and abacuses through the specified number of
    \textit{degrees}.

    \item[scale, xscale, yscale, script, scriptscript]
    \index{scale}\index{xscale}\index{yscale}\index{script}\index{scriptscript}
    Use \option{scale} to rescale all \aTableau diagrams. Use
    \option{xscale} to rescale in the $x$-direction and \option{yscale}
    to rescale in the $y$-direction. The \option{script} and
    \option{scriptscript} keys can be used to fine-tune the size of
    \aTableau commands when used as subscripts (rare) and subsubscripts
    (unlikely).

    \item[styles]\index{styles}
    A shorthand for defining \TikZ-styles.

    \item[tikzpicture]\index{tikzpicture}
    When used without coordinates, \aTableau commands are
    implicitly drawn inside a \keyword{tikzpicture} environment.  Use
    \option{tikzpicture=keys} to set the optional argument of this
    environment. This is equivalent to writing:
    \keyword{\begin{tikzpicture}[ keys ]...\end{tikzpicture}}.

    \item[tikz before, tikz after]\index{tikz before}\index{tikz after}
    Use the \option{tikz before} and \option{tikz after} keys to inject
    \TikZ code into the underlying \keyword{tikzpicture} environment,
    \textit{before} and \textit{after} the picture drawn by \aTableau,
    respectively.

  \end{options}

  With boolean options, which take values \textcolor{orange}{true} or
  \textcolor{orange}{false}, the value can typically be omitted. For
  such keys, there is usually an \textit{inverse key}, which is given by
  adding a \textcolor{aTableauInner}{no}-prefix. For example, the
  \option{border} and \option{no border} keys are a pair of inverse
  keys. Using the \option{border} key is equivalent to
  \option{border=true} and \option{no border=false}. Similarly, the
  \option{no border} key is equivalent to \option{no border=true}, and
  \option{border=false}.

  \index{American dialect}
  The \aTableau keys tolerate American spelling variations. For example,
  in \aTableau keys you can use \emph{center} and \emph{color} instead
  of the correct spellings of \emph{centre} and \emph{colour}, respectively.
  \begin{warning}
    Unlike the egalitarian \aTableau-keys, \TikZ-keys
    \emph{do not} countenance English spelling of the English language!
  \end{warning}

  \vspace*{10mm}

  The next example contrasts using the \keyword{\Diagram} command both
  outside and inside a \keyword{tikzpicture} environment. More
  explicitly, the second \keyword{\Diagram} command uses
  coordinates to position the picture inside a \keyword{tikzpicture} environment.
  Otherwise, the two \keyword{\Diagram} commands in this example are identical, except
  that the second one is embellished with labels that are drawn by
  the other $\TikZ$-commands inside the \keyword{tikzpicture}
  environment.

  \begin{Example}{diagramCoordinates}
  % \usetikzlibrary{patterns}
  \tikzset{
    B/.style={pattern=north east lines, pattern color=blue},
    G/.style={pattern=north west lines, pattern color=ForestGreen},
  }
  \Diagram[ribbons={(G)16ccccrrr, (B)16crrcccr}]{6,5^2,2} % outside tikzpicture
  \qquad \qquad
  \begin{tikzpicture} % inside tikzpicture with labels
    \Diagram(0,0)[ribbons={(G)16ccccrrr, (B)16crrcccr}]{6,5^2,2}
    % add the labels
    \draw[<-](A-1-2.base) to[out=90, in=180] ++(0.8, 0.8)node[right]{$\alpha=(1,2)$};
    \draw[<-](A-4-2.base) to[out=270,in=180] ++(0.8,-0.8)node[right]{$f_\alpha=(4,2)$};
    \draw[red,<->]([xshift=-1mm]A-1-1.south west)
       --node[rotate=90,above]{$l_\alpha=3$}([xshift=-1mm]A-4-1.south west);
  \end{tikzpicture}
  \end{Example}

  From the viewpoint of \aTableau, the most important point of
  \autoref{Ex:diagramCoordinates} is that the first \keyword{\Diagram}
  command is a standalone diagram, whereas the second one is part of a
  \keyword{tikzpicture} environment because it comes equipped with the
  coordinate $(0,0)$.  Most of the right-hand picture is drawn
  by the~\keyword{\Diagram} command, which is exactly the same as the
  left-hand picture, even though most of the commands in the
  \keyword{tikzpicture} environment are \TikZ commands. In particular,
  the shading of the boxes in the \emph{$(1,2)$-hook} and the
  \emph{$(1,2)$-rim hook} is done by the \option{ribbons} key.

  Inside the \keyword{tikzpicture} environment, the Young diagram is
  placed at position $(0,0)$ by the \keyword{\Diagram} command. The
  three \keyword{\draw} commands are used to add the three labelled
  arrows to the picture. Please consult the very readable \TikZ manual
  for more information about the \TikZ-commands used in this example.
  (In fact, the right-hand picture could be drawn without using a
  \keyword{tikzpicture} environment by using the \option{tikz after} key
  to add the three \keyword{\draw}-commands.)

  \begin{warning}
     Unlike \TikZ-commands, you should \emph{not} put a semicolon after
     an \aTableau-command when it is used inside a \keyword{tikzpicture}
     environment.  If you accidentally add a semicolon, \TikZ\ will
     issue a warning. In most cases, extra semicolons have no
     visible effect, but they are unnecessary and are best omitted.
  \end{warning}

  At the top of the \autoref{Ex:diagramCoordinates}, two \TikZ-styles, \textsf{B}
  and \textsf{G}, are defined. These styles are used to add the \textsf{b}lue and
  \textsf{g}reen coloured hatchings to the two hooks.  As this suggests,
  \TikZ-styling can be applied to most of the components of the pictures
  produced by \aTableau commands.

  An important feature of \autoref{Ex:diagramCoordinates} is the use of four
  \emph{named coordinates}: (\textsf{A-1-1}), (\textsf{A-1-2}),
  (\textsf{A-4-1}), and (\textsf{A-4-2}). Whenever \aTableau draws a
  picture, it creates \TikZ named coordinates
  (\textsf{A-r-c}) for every box (or bead) in the diagram, where (\textsf{A-r-c})
  refers to the box (or bead), in row~\textsf{r} and column~\textsf{c}.%
  \footnote{In this manual, we normally refer to the entries of
    tableaux and diagrams as \textit{boxes}, rather than \textit{nodes}.
    This is to avoid any ambiguity with \TikZ-nodes. Similarly,
    \aTableau commands produce \textit{pictures}, to distinguish them
    from (Young) diagrams.}
  Giving finer control, the following standard \TikZ \textit{anchors}
  are available, depending on the tableau, or abacus, convention being used.

  \begin{equation}\label{E:NodeNames}
    \begin{tikzpicture}[every node/.style={font=\tiny, text=gray}]
        \Diagram(0,0)[scale=3]{1}
        \node[label={above:(A-r-c)}] at (A-1-1){$\color{red}\bullet$};
        \node[label={above:(A-r-c.north)}] at (A-1-1.north){$\color{red}\bullet$};
        \node[label={below:(A-r-c.south)}] at (A-1-1.south){$\color{red}\bullet$};
        \node[label={right:(A-r-c.east)}] at (A-1-1.east){$\color{red}\bullet$};
        \node[label={left:(A-r-c.west)}] at (A-1-1.west){$\color{red}\bullet$};
        \node[label={above right:(A-r-c.north east)}] at (A-1-1.north east){$\color{red}\bullet$};
        \node[label={above left:(A-r-c.north west)}] at (A-1-1.north west){$\color{red}\bullet$};
        \node[label={below right:(A-r-c.south east)}] at (A-1-1.south east){$\color{red}\bullet$};
        \node[label={below left:(A-r-c.south west)}] at (A-1-1.south west){$\color{red}\bullet$};
    \end{tikzpicture}
    \qquad
    \begin{tikzpicture}[every node/.style={font=\tiny, text=gray}]
        \Diagram(0,0)[russian, scale=3]{1}
        \node[label={above:(A-r-c)}] at (A-1-1){$\color{red}\bullet$};
        \node[label={above:(A-r-c.north)}] at (A-1-1.north){$\color{red}\bullet$};
        \node[label={below:(A-r-c.south)}] at (A-1-1.south){$\color{red}\bullet$};
        \node[label={right:(A-r-c.east)}] at (A-1-1.east){$\color{red}\bullet$};
        \node[label={left:(A-r-c.west)}] at (A-1-1.west){$\color{red}\bullet$};
        \node[label={above right:(A-r-c.north east)}] at (A-1-1.north east){$\color{red}\bullet$};
        \node[label={above left:(A-r-c.north west)}] at (A-1-1.north west){$\color{red}\bullet$};
        \node[label={below right:(A-r-c.south east)}] at (A-1-1.south east){$\color{red}\bullet$};
        \node[label={below left:(A-r-c.south west)}] at (A-1-1.south west){$\color{red}\bullet$};
    \end{tikzpicture}
  \end{equation}

  Similar named coordinates are created for abacus beads. You can change the
  prefix \textsf{A} in these named coordinates using the \option{name} key. Such
  coordinates are a standard part of \TikZ. If you change the
  shape of the node, then the available anchors may change; for more
  information, see the \TikZ manual.

  The coordinate $(0,0)$ is needed in the last example because the
  \keyword{\Diagram} command is used in a \keyword{tikzpicture}
  environment. Rather than (0,0), any \TikZ coordinate could have been
  used. (As this example uses relative coordinates, a different choice of coordinate
  will not actually change the picture.) The use of coordinates become more
  meaningful when the \keyword{tikzpicture} environment has more
  components. In the next example, the key \option{name=B} makes the
  named coordinates for the second diagram take the form
  (\textsf{B-r-c}), instead of the default named coordinates
  (\textsf{A-r-c}), which are used in the first diagram. This makes it
  easy to draw lines between boxes in the two tableaux.

  \begin{example}[lefthand width=0.14\textwidth, sidebyside gap=0mm]{diagramNames}
  % \usetikzlibrary{decorations.pathmorphing}
  \begin{tikzpicture}[wave/.style={thick,red,->,decorate,decoration=snake}]
    \aTabset{ribbon style={fill=blue!20, opacity=0.4}}
    \Diagram(0,2.2)[e=2,entries=residues,ribbons={13crc}]{3,2}
    \Diagram(0,0)[e=2,entries=residues,ribbons={12rcr},name=B]{2^2,1}
    \draw[wave](A-2-1.south east)--(B-1-1.north east);
  \end{tikzpicture}
  \end{example}

  In this example, the entries in the two tableaux are added by the key
  \option{entries=residues}, which adds the \option{e}-residue of each
  box to these tableaux. The shading is done by the \option{ribbons}
  commands.  Notice that \option{ribbon style}, which sets the
  \TikZ-style of the ribbons, includes \keyword{opacity=0.4}.  This
  is necessary because the ribbons are drawn \textit{after} the tableau
  entries; see \autoref{SS:order}.  Alternatively, the tableau entries
  can be included in the ribbon specifications, as described in
  \autoref{S:RibbonTableaux}.

  The final example in the introduction uses \keyword{\ShiftedTableau}
  inside a \emph{matrix of nodes} to produce the following lattice of
  shifted tableaux:

  % The picture is above the code because this avoids a bad page break
  \begin{Example}[text above listing]{skewLattice}
  % \usetikzlibrary{matrix}
  \begin{tikzpicture}[scale=0.8, arr/.style={->,blue!50!black, thick}]
    \matrix (M)[matrix of nodes,row sep=4mm,column sep=4mm]{
        &    &    & \ShiftedTableau{1234,567} \\
        &    & \ShiftedTableau{1235,467}
        &    & \ShiftedTableau{1243,567}\\
        & \ShiftedTableau{1236,457}
        &    & \ShiftedTableau{1245,367}
        &    & \ShiftedTableau{1253,467}\\
      \ShiftedTableau{1237,456}
        &    & \ShiftedTableau{1246,357}
        &    & \ShiftedTableau{1254,367}\\
        & \ShiftedTableau{1247,356}\\
     };
     \draw[arr](M-1-4)--node[above]{$\sigma_4$}(M-2-3);
     \draw[arr](M-1-4)--node[above]{$\sigma_3$}(M-2-5);
     \draw[arr](M-2-3)--node[above]{$\sigma_5$}(M-3-2);
     \draw[arr](M-2-3)--node[above]{$\sigma_3$}(M-3-4);
     \draw[arr](M-2-5)--node[above]{$\sigma_4$}(M-3-6);
     \draw[arr](M-3-2)--node[above]{$\sigma_6$}(M-4-1);
     \draw[arr](M-3-2)--node[above]{$\sigma_3$}(M-4-3);
     \draw[arr](M-3-4)--node[above]{$\sigma_5$}(M-4-3);
     \draw[arr](M-3-4)--node[above]{$\sigma_4$}(M-4-5);
     \draw[arr](M-3-6)--node[above]{$\sigma_3$}(M-4-5);
     \draw[arr](M-4-1)--node[above]{$\sigma_3$}(M-5-2);
     \draw[arr](M-4-3)--node[above]{$\sigma_6$}(M-5-2);
  \end{tikzpicture}
  \end{Example}

  Notice that even though the \keyword{\ShiftedTableau} commands are being
  used inside a \keyword{tikzpicture} environment, they do not need
  coordinates because the shifted tableaux are being positioned by the \TikZ
  \keyword{\matrix} command. That is, the \keyword{\ShiftedTableau}
  commands are not explicit components of the \keyword{tikzpicture}
  environment because they are all (implicitly) inside \TikZ-nodes.

  The following sections describe the commands defined by the \aTableau
  package and how to use them.  We start with the \keyword{\Tableau}
  command because it is the basis for all \aTableau Young diagram and
  tableau commands.


  \begin{warning}
    The \aTableau package requires an up-to-date version of \LaTeX\
    because it relies heavily on recent advances in \ctan{LaTeX3}. You
    will need to update your \LaTeX\ installation if it is older than
    \TeXLive 2024. Ideally, you should use the latest release of your
    preferred \LaTeX\ distribution.
  \end{warning}

  % --------------------------------------------------------------
  \section{Tableaux and Young diagrams}

    \emph{Partitions} are weakly decreasing sequences of non-negative
    integers. They are fundamental objects in algebraic combinatorics
    and representation theory.\index{partition} For example,
    $\lambda=(4,3,3,2,0,0,\dots)$ is a partition of $12$, since the
    entries sum to~$12$. It is customary to omit the zeros when writing
    partitions and to use exponents for repeated parts, so we can write
    this partition in \emph{exponential notation} as
    $\lambda=(4,3^2,2)$.

    Many authors identify a partition~$\lambda=(\lambda_1,\lambda_2,\dots)$ with its
    \emph{Young diagram}, which is the set
    \[
        [\lambda] = \set{(r,c)|1\le c\le\lambda_r\text{ for }r\ge1}.
    \]
    The (Young) diagram is usually visualised as an array of
    \emph{boxes}, or \emph{nodes}, in the plane.  A \emph{tableau} is a
    diagram where the boxes are labelled using some alphabet.
    Equivalently, a diagram is a tableau with empty labels.
    \index{young diagram@Young diagram|see{diagram}}
    \index{diagram}
    \index{tableau}
    \index{box}
    \index{node}
    \index{node|see{box}}
    \index{exponential notation}
    \index{partition!exponential notation}

    When using the \emph{English convention}, the diagram of the
    partition~$\lambda$ is visualised as a left justified array of boxes
    in the plane, where the first row has~$4$ boxes, the next two lower
    rows have~$3$ boxes and the last row has~$2$ boxes. The \emph{shape}
    of a diagram is the partition that gives the number of boxes in each
    row. Diagrams and tableaux drawn using the \emph{French} convention
    are given by reflecting in a horizontal line above the diagrams,
    whereas the \emph{Russian} and \emph{Australian} conventions are
    given by appropriate rotations of these diagrams. All of these
    conventions are used in the literature, with some papers using more
    than one convention in different parts of the manuscript.

  % --------------------------------------------------------------
    \subsection{Tableaux}
    \indexcmd{Tableau}
    \label{S:Tableau}
    This section describes the \keyword{\Tableau} command, which draws
    tableaux or labelled diagrams. The syntax of this command is:

    \keyword{\Tableau (x,y) [options] {tableau entries}}

    where:

    \begin{options}
      \item[*$(x,y)$]\index{xy@$(x,y)$} The  $(x,y)$-coordinates
      are needed only if the tableau is part of a \keyword{tikzpicture} environment.
      \item[*options] Optional arguments, or keys, which are described below, with examples.
      \item[*tableau entries]\index{tableau entries} The
      \keyword{tableau entries} are given as a comma-separated list, with commas
      separating rows and each \textit{token}, or braced-group of
      tokens, being in a separate column. As explained below, each
      tableau entry can be prefixed by (optional) \TikZ-styling
      specifications to change their appearance.
    \end{options}

    We show, using examples, how to use the \keyword{\Tableau} command,
    starting with basic usage and finishing with style. Inside
    \keyword{\Tableau}\!, the rows are separated by commas, with the
    columns given by the ``letters'' in the word for each row:

  \begin{example}{tableauWords}
  \Tableau{ 1234, 56, 7, 8 }       \qquad
  \Tableau{ \alpha\gamma\delta q,
            xy\eta,
            \lambda\mu,
            \pi\sum }
  \end{example}

  The tableau specifications can be put on a single line, without any
  spaces. Alternatively, as shown here, spaces and line breaks can be
  added to improve readability. The one restriction is that you cannot
  have blank lines inside a \keyword{\Tableau} command. As this example
  suggests, by default, the entries in a tableau are typeset in
  mathematics-mode, but this can be changed using the
  \option{text boxes} key, described below.

  The tableau entries can be individual characters, or they can be \TeX\
  commands. Tableaux frequently contain entries that are not single
  characters, or given by commands. In true \TeX-style, such entries are
  added to a tableau by enclosing them in braces:

  \begin{example}{tableauBraces}
    \Tableau{ 13{10}{11}{2x}, 2{y^3}, {r_1} }
  \end{example}

  % --------------------------------------------------------------
  \subsubsection{Adding style}
  \index{tableau star}
  \index{*|see{abacus star and tableau star}}
  \index{tableau entries!tableau star}

  The \aTableau package provides several different ways to add
  \TikZ~style specifications to the boxes in diagrams and tableaux.
  This is done by adding style prefixes to the tableau entries.  To take
  advantage of these styles you need to have at least rudimentary
  knowledge of \TikZ-styling. The examples in this manual might be
  enough to get you started, as they give a good indication of what is
  possible. For anything more exotic, please consult the \TikZ manual.

  The simplest way to change the style of an entry in a tableau is to
  add a $*$-prefix to the entry:

  \begin{example}{tableauStar}
  \Tableau{ 1*2*3*4*5, 6*789, {10}*{11}{12}, {13} }
  \end{example}

  In this tableau, there is an asterisk before each of the entries $2$,
  $3$, $4$, $5$, $7$, and $11$, which gives the corresponding boxes the
  \option{tableau star}.  By default, boxes marked with a~$*$ are given the
  \TikZ-styling \keyword{fill=}\aTableauColour{Star}. You can
  change the default $*$-style using the \option{tableau star} key:

  \begin{example}{tableauStarStyle}
  \Tableau[tableau star={fill=red!20,draw=red,thick}]
          { 1*2*3*4*5, 6*789, {10}*{11}{12}, {13} }
  \end{example}

  Note that the $*$-styling overrides the default styling of the
  surrounding boxes, such as their borders. This is because the boxes
  with the default styling are placed first, in the order that they are
  entered, after which the boxes that have custom styles are placed.
  (This is discussed in more detail in \autoref{SS:order}.)

  The $*$-syntax is a quick shorthand for adding emphasis to some boxes
  in a tableau, but all of the $*$-entries are given the same style.
  It is possible to give every box in the tableau different styling by
  putting \TikZ-styling specifications inside square brackets,
  \keyword{[...]}, before the corresponding letter in the tableau
  specification.  You can mix the $*$-syntax and the
  \keyword{[...]}-style syntax for different entries, although only one
  of these style settings can be applied to any given box.

  \begin{example}{tableauFrench}
  \Tableau[french]{
      1 [blue!20]2 [circle]3 [fill=red]4 [draw=cyan]5,
      6 *7 8 9,
      {10} *{11} {12},
      {13} }
  \end{example}

  We emphasise that it is not necessary to add spaces between the
  entries, in the way that this example does. This is done only to make
  it clearer how the style specifications are applied to the different
  entries in the tableau.

  Omitting some technicalities, each box in a tableau is constructed as
  a \TikZ node, so any \TikZ-style specifications for a \TikZ node can be
  used.  This example shows that some care is needed when changing the
  style because simply giving a colour changes both the colour used to
  \textit{fill} the box and the \textit{text colour}, which is why some
  of the tableau entries in the last example appear to be blank.  If you are
  already familiar with \TikZ then you probably already know what to do.
  If not, here is a short list of useful style specifications for
  \TikZ nodes:
  \begin{center}\index{fill}\index{text}\index{draw}\index{font}
     \rowcolors{2}{}{LightSkyBlue!10}
     \begin{tabular}{ll}\toprule
       Style & Meaning \\\midrule
       \keyword{draw}\textcolor{orange}{$=\langle\text{colour}\rangle$}
            & Sets the boundary colour of the node\\
       \keyword{fill}\textcolor{orange}{$=\langle\text{colour}\rangle$}
            & Sets the fill, or background, colour of the node\\
       \keyword{font}\textcolor{orange}{$=\langle\text{font commands}\rangle$}
            & Sets the font \\
       \keyword{opacity}\textcolor{orange}{$=\langle\text{value}\rangle$}
            & Sets both the drawing and filling opacity to $\langle\text{value}\rangle$\\
       \keyword{text}\textcolor{orange}{$=\langle\text{colour}\rangle$}
            & Sets the text colour in the node \\
       \bottomrule
     \end{tabular}
  \end{center}
  In the style settings, any valid \LaTeX\ colour name can be used; see, for
  example, the \ctan{xcolor} manual. In addition, the style specifications
  \keyword{thin}\!,
  \keyword{thick}\!,
  \keyword{very thick}\!,
  \keyword{ultra thick}\!,
  \keyword{dashed}\!,
  \keyword{dotted}\!, $\dots$.
  change the line thickness, and its properties.
  See \autoref{SS:TableauOptions} below for more detail on using these options
  to customise the tableau style.

  You can apply ``complicated'' style settings, such as
  \keyword{draw=cyan,ultra thick}, which consists of a comma-separated
  list of \TikZ-style settings, by putting the style setting
  inside matching square brackets%
  \footnote{In particular, even though commas are used to separate the
  rows of the tableau, you do not need to enclose the style
  specifications inside both square brackets and braces, [\{...\}],
  because \aTableau matches the square brackets when reading style.}.
  If you use a style more than once, then a better approach is to
  define a \TikZ-style for ``complicated'' styles because they are
  easier to read, proofread, and type.

  \begin{example}{tableauAustralian}
  \Tableau[australian]{
      1 [fill=blue!20]2 3 [text=red]4 5,
      [circle,fill=orange]6 *7 8 9,
      [draw=cyan,ultra thick]{10} *{11} {12},
      [dashed,draw=red,ultra thick]{13} }
  \end{example}

  % The last example shows that it is not necessary to double-brace
  % singleton entries when they have a style specification.

  This example demonstrates that modifying the borders of a box is
  problematic because boxes placed later are likely to overwrite the new
  border style (see \autoref{SS:order}). As a result, modifying the borders
  of individual boxes is often not a good way to add emphasis to the boxes
  in a tableau,  so use this sparingly. In addition, the orange circle
  in this example is too big, but it is what we asked for because the
  diameter of the circle is the horizontal width of the box. The next
  example shows that we get a better result using
  \textit{minimum size=5mm} when using the \option{australian} and
  \option{russian} conventions for tableaux.

  For complex or frequently used styles, we recommend using the
  \keyword{\tikzset} command to define the style outside of the
  \keyword{\Tableau} command. This makes your code both easier to read
  and easier to change. If you need to define a style for a single
  picture, then you can also use the \option{styles} key.

  \begin{example}[lefthand width=0.3\textwidth]{tableauStyles}
  \tikzset{
     B/.style={fill=blue!40, text=yellow},
     G/.style={fill=green!80!blue,circle,minimum size=5mm},
     R/.style={fill=red,text=white, font=\tiny},
     Y/.style={fill=yellow!20, text=blue}
  }
  \Tableau[french]{[R]1[B]2,[G]3,[Y]4} \quad
  \Tableau[russian]{[R]1[B]2,[G]3,[Y]4} \newline
  \Tableau[english]{[R]1[B]2,[G]3,[Y]4} \quad
  \Tableau[australian]{[R]1[B]2,[G]3,[Y]4}
  \end{example}

  In this example, the \TikZ-styles \textsf{B}, \textsf{G}, \textsf{R},
  and \textsf{Y} are applied to the tableaux entries labelled $1$, $2$,
  $3$, and~$4$, respectively. Note the use of \emph{minimum size} to
  control the size of the circle, which is advised when using the
  \textit{Russian} or \textit{Australian} conventions. The colours
  used here, and throughout this manual, are for demonstration purposes
  only.  Such vibrant colour choices are generally not recommended for
  self-respecting documents!

  % --------------------------------------------------------------
  \subsubsection{Tableau coordinates}\label{SS:coordinates}
  \index{xy@$(x,y)$}
  \index{coordinates!tableau}

  The $(x,y)$-coordinates are required if, and only if, the
  \keyword{\Tableau} command is used inside a \keyword{tikzpicture}
  environment, in which case $(x,y)$ gives the coordinates of the
  ``outside corner'' of the box in row~$1$ and column~$1$ of the
  tableau. The following example shows how tableaux are placed using
  $(x,y)$-coordinates inside a \keyword{tikzpicture} environment. This
  example also shows that, by default, the tableau boxes are square with
  side lengths of half a unit.

  \tikzset{
    add grid/.code = {
      % draw coordinate axes
      \draw[help lines, step=0.5,thin, LightGrey](-0.5,-1.5) grid (4,2.5);
      \draw[help lines, step=1,thin, Grey](-0.5,-1.5) grid (4,2.5);
      \foreach \pt in {0,...,3} {
        \node[below,font=\tiny] at (\pt,-1.5){$\pt$};
      }
      \foreach \pt in {-1,...,2} {
        \node[left, font=\tiny] at (-0.5,\pt){$\pt$};
      }
    }
  }

  \begin{example}{tableauLabels}
  \begin{tikzpicture}[add grid]
    \aTabset{label style={red, font=\tiny}}
    \Tableau(0,0)    [english,   label=1]{123,45}
    \Tableau(0,0.5)  [french,    label=2]{123,45}
    \Tableau(2.5,0.5)[russian,   label=3]{123,45}
    \Tableau(2.5,0)  [australian,label=4]{123,45}
  \end{tikzpicture}
  \end{example}

  The \option{label} keys in this example should help in matching the tableaux
  on the left with the corresponding commands on the right.

  % --------------------------------------------------------------
  \subsubsection{Tableau keys}
  \label{SS:TableauOptions}

  The optional $*$-styles and $[\ldots]$-styles are the main mechanism
  for styling individual boxes in a tableau. Using a key-value
  syntax, you can change the appearance of the tableau produced by the
  \keyword{\Tableau} command.  The rest of this section describes these
  keys, their default values, and gives examples of their usage.  Keys
  are mostly, listed in alphabetical order except that some related keys
  are discussed together.

  The options, or keys, below can be applied to the \keyword{\Tableau}
  command by giving them as a comma-separated list inside square
  brackets:
  \begin{center}
    \keyword{\Tableau [options] {tableau entries}}\quad or \quad
    \keyword{\Tableau (x,y) [options] {tableau entries}}.
  \end{center}
  The options can appear in any order, with later options having
  precedence over earlier ones.

  When used inside a \keyword{\Tableau} command, the options only affect
  that particular tableau. Most of these options, or keys, can also be
  used in the \keyword{\aTabset} command, to change the default settings
  of all subsequent tableaux in the same \LaTeX\ group, or as optional arguments in
  \keyword{\usepackage[..]{atableau}}, to change the default settings
  for the entire document.  For example, if you put the command
  \keyword{\aTabset{russian}} in the preamble of your document then,
  by default, all tableaux and Young diagrams will be drawn
  using the Russian convention.

  \option[-]{english}
  \option*[]{french}
  \option*[]{russian}
  \option*[]{australian}

  \index{tableau!english}
  \index{tableau!french}
  \index{tableau!russian}
  \index{tableau!australian}

  These four (mutually exclusive) options change the convention, or
  orientation, that is used when drawing tableaux. Rather than defining
  these conventions precisely, we use the tried-and-true method in
  combinatorics of defining by example.

  \begin{example}[lefthand width=0.3\textwidth]{tableauAustralianFill}
  \Tableau[australian, styles={B={fill=brown!20, text=red}}]
    {12[B]3,45}
  \end{example}

  \begin{example}[lefthand width=0.3\textwidth]{tableauEnglishBlue}
  \tikzset{B/.style={fill=blue!20, dashed, thick}}
  \Tableau[english]{12[B]3,45}
  \end{example}

  \begin{example}[lefthand width=0.3\textwidth]{tableauFrenchRed}
  \tikzset{R/.style={fill=red!20, circle, draw=red,
            ultra thick}}
  \Tableau[french]{12[R]3,45}
  \end{example}

  \begin{example}[lefthand width=0.3\textwidth]{tableauRussian}
  \Tableau[russian, styles={R={fill=red!20,draw=red}}]
    {12[R]3,45}
  \end{example}

  By default, the \option{english} convention is used to draw tableaux
  and Young diagrams. The default convention can be changed using
  \keyword{\aTabset}. Capitalised names, \keyword{Australian}\!,
  \keyword{English}\!, \keyword{French}\!, and \keyword{Russian}\!, are also
  recognised. If, for example, your document is only going to draw
  \option{french} tableaux and diagrams, then you can specify this when
  you load the package using \keyword{\usepackage[french]{atableau}}\!,
  or by adding \keyword{\aTabset{french}} to your document preamble.

  \option[centre]{align=value}[centre/bottom/top]

  By default, the baseline of a tableau is its centre. This can be
  changed using the \option{align} key.

  \begin{example}{tableauAlignCentre}
  % the default
  Some \Tableau[align=centre]{124,357,68} words
  \end{example}

  \begin{example}{tableauAlignTop}
  Some \Tableau[align=top]{124,357,68} words
  \end{example}

  \begin{example}{tableauAlignBottom}
  Some \Tableau[align=bottom]{124,357,68} words
  \end{example}

  Similarly, use \option{align} to control how tableaux are aligned
  in displayed equations.

  \begin{example}{tableauAlignBottomEquation}
  \aTabset{align=bottom}
  \Tableau{124,357,68}\qquad
  \Tableau{124,35}
  \end{example}

  \begin{example}{tableauAlignCentreEquation}
  % the default: align=centre
  \Tableau{124,357,68}\qquad
  \Tableau{124,35}
  \end{example}

  \begin{example}{tableauAlignTopEquation}
  \aTabset{align=top}
  \Tableau{124,357,68}\qquad
  \Tableau{124,35}
  \end{example}

  \option[true]{border}[true/false] \newline
  \option[false]{no border}[false/true]

  The \option{border} and \option{no border} keys enable and disable
  the drawing of the (thick) border wall around a tableau.
  The \option{no border} key is inverse to \option{border}, so
  \option{no border} is equivalent to
  \option{border=false}, and to \option{no border=true}.

  \begin{example}{tableauBorder}
  \Tableau[russian, border=false]{123,455,674} \qquad
  \Tableau[french, no border]{123,455,674} \qquad
  \end{example}

  \option[\aTableauColour{Main}]{border colour=colour}[a \LaTeX~colour]
  \option*[thick, line~cap=rect]{border style=style}[\TikZ-styling]

  The \option{border colour} option sets the colour of the border wall,
  whereas \option{border style} sets the \TikZ-styling of the border wall.
  (So, \option{border style} can override \option{border colour}.)

  \begin{example}{tableauBorderStyle}
  \Tableau[russian, border colour=red]{123,455,674} \qquad
  \Tableau[french, border style={dashed,orange}]{123,455}
  \end{example}

  The \option{border style} key \emph{appends} any \TikZ-styles to the
  current styling of the wall.

  % nodes
  \option[none]{box fill=colour}[a \LaTeX~colour]

  The \option{box fill} option sets the background colour of a box in a
  tableau, which is used in exactly the same way as the \textsf{fill} key
  for a \TikZ-node. If you use a dark fill colour, then you will almost
  certainly want to change the text colour using the \option{box text}
  key -- and you may also want to change the colours of the border walls
  and inner walls using \option{border colour} and \option{inner wall},
  respectively.

  \begin{example}{tableauBoxFill}
  \Tableau[box fill=blue, box text=yellow]{123,455,674} \qquad
  \Tableau[box fill=red!10]{123,455}
  \end{example}

  The \option{box fill} key cannot be used in the same picture as the
  \option{colours} key. The \option{colours} key applies a list of fill
  colours to the boxes in a tableau or diagram that are placed using a
  residue pattern.

  \option[]{box font=font command}[\LaTeX\ font command]

  The \option{box font} key sets the font used to type the entries of a
  tableau.  By default, tableau entries are typeset as mathematics, so
  this is mainly useful for changing the font size (because, for
  example, \keyword{\bfseries $1$} does not make the $1$ bold). It is
  only when you are using \option{text boxes} that font commands like
  \keyword{\itshape} and \keyword{\bfseries} will have any effect.

  \begin{example}{tableauBoxFont}
  \Tableau[box font=\tiny]{123,455,674} \qquad
  \Tableau[text boxes, box font=\bfseries]{123,455}
  \end{example}

  \option[0.5]{box height=number}[a decimal giving the height in \unit{cm}]
  \option*[0.5]{box width=number}[a decimal giving the width in \unit{cm}]


  Changing the convention also sets the \option{box height} and \option{box
  width}, relative to the current \option{scale}. If you want to use a
  custom box height and box width, then you need to set them
  \emph{after} specifying the convention.

  The default height and width of the boxes is \qty{0.5}{cm} when using
  the \option{english} and \option{french} conventions and
  \qty{0.7012}{cm}, which is approximately
  $\qty[parse-numbers=false]{1/\sqrt{2}}{cm}$, when using the
  \option{russian} and \option{australian} conventions. (In all cases,
  the default side length of the boxes is \qty{0.5}{cm}.)

  \begin{example}{tableauBoxHeight}
  \aTabset{align=top}
  \Tableau[box height=0.8]{123,455,674} \qquad
  \Tableau[box width=0.2, russian]{123,455}
  \end{example}

  The \option{box height} and \option{box width} keys need to be set
  \emph{after} changing the tableau convention using
  \option{australian}, \option{english}, \option{french}, or
  \option{russian} because the conventions change the height and width
  of the tableau boxes (and later keys override earlier ones). In
  particular, in the last example, \option{box width=0.2} has no effect
  because the \option{russian} key, which comes later, sets the box
  width to \qty{0.7012}{cm}.

  \begin{example}{tableauBoxWidth}
  \aTabset{align=top}
  \Tableau[box height=0.3]{123,455,674} \qquad
  \Tableau[russian, box width=0.3]{123,455}
  \end{example}

  See also the \option{scale}, \option{xscale}, and \option{yscale}
  options.

  \option[\aTableauColour{Main}]{box text=colour}[a \LaTeX~colour]

  As with \TikZ-nodes, use \option{box text} to set the default text
  colour for the entries of the tableau boxes.

  \begin{example}{tableauBoxText}
  \Tableau[box text=red]{123,45} \qquad
  \Tableau[box text=blue, french]{123,45}
  \end{example}

  \option[]{box style=style}[\TikZ~styling]

  Many of the preceding keys for tableau boxes can be overridden using
  the \option{box style} key to set the style of the tableau boxes
  directly.

  \begin{example}{tableauBoxStyle}
  \Tableau[box style={text=red,draw=teal,shape=circle}]
    {123,45} \qquad
  \Tableau[box style={font=\small}, french]{123,45}
  \end{example}

  \option[]{colours}[list of \LaTeX\ colours]

  Use the \option{colours} key to assign a cyclic list of background
  colours to the boxes in a tableau. The colours are specified as
  a comma-separated list of valid \LaTeX\ colour names.  The
  \option{colours} key overrides the \option{box fill} key, so these two
  keys should not be used in the same picture.

  By default, the colours are applied using the type~$A$ residue pattern.
  This means that colours are assigned cyclically:
  \begin{itemize}[nosep]
    \item in increasing order of row index
    \item in decreasing order of column index.
  \end{itemize}
  People working in representation theory may recognise this pattern
  as coming from \emph{residues} in Type~A.

  \begin{example}{tableauColours}
  \Tableau[colours={red,green!70!blue,blue!80},
      box text=white]{12345,67,9,{10}}    \qquad
  \Diagram[colours={black,white}]{4^4}    \qquad
  \end{example}

  Rather than placing the colours using the Type~A residue patterns,
  other residue patterns can be used by setting the \option{cartan}
  type. To use other Cartan types, set the \option{cartan} type
  \textit{before} setting the \option{colours}~(or set the quantum
  characteristic \option{e} manually).

  \begin{example}{tableauColourCartan}
  \Diagram[cartan=C, entries=residues,
    colours={yellow,white,white,yellow},
  ]{8,5,4}
  \end{example}

  For more information about residues see the description of
  \option{entries=residues}.

  \option[false]{conjugate}[false/true]

  Draws the \emph{conjugate} tableau, where the rows and columns are
  swapped.

  \begin{example}{tableauConjugate}
  \Tableau{123,45,67}    \qquad
  \Tableau[conjugate]{123,45,67}
  \end{example}

  \option[]{cover=partition}[a partition]
  \option*[]{skew=partition}[a partition]
  \index{partition!cover}
  \index{partition!skew}
  \index{tableau!cover}
  \index{tableau!skew}

  If $\lambda$ and $\mu$ are partitions, then $\mu$ \emph{covers}
  $\lambda$ if $\lambda\subseteq\mu$. Equivalently, $\nu$ is
  \emph{contained} in $\lambda$ if $\nu\subseteq\lambda$.  The
  \option{cover} and \option{skew} keys provide a mechanism for drawing
  tableaux and diagrams of shapes $\nu\subseteq\lambda$,
  $\lambda\subseteq\mu$ and $\nu\subseteq\lambda\subseteq\mu$. For skew
  shapes, the more standard notation is $\lambda/\nu$, so perhaps the
  two other shapes should be written as $\mu{\setminus}\lambda$ and
  $\mu{\setminus}\lambda/\nu$, respectively. Irrespective of the
  notation, \aTableau can draw each of these shapes.

  \begin{example}{tableauCover}
  \Tableau[cover={4^2,3}]{123,45,67} \qquad
  \Tableau[skew={2,1}]{123,45,67}
  \end{example}

  The covering and skew partitions can be given as a comma-separated
  list of positive integers, or using exponential notation. As covering
  partitions are a type of dual \emph{skew shapes}, there are similar
  keys that control how these pictures are drawn. It is possible to
  combine these keys to display covered skew shapes.

  \begin{example}{tableauSkew}
  \Tableau[skew={2,1}, skew boxes,
    cover={4^2,3},cover boxes]{123,45,67}
  \end{example}

  Skew tableaux and skew diagrams are common in the literature, so
  \aTableau provides dedicated commands, \keyword{\SkewDiagram} and
  \keyword{\SkewTableau}, for drawing them. These commands, and the
  options for covered and skew shapes, are described in
  \autoref{S:Skew}.

  \option[centre]{halign=value}[centre, left, right]
  \option*[centre]{valign=value}[bottom, centre, top]

  By default, the entries in tableaux are centred, both horizontally
  and vertically, and it is your responsibility to ensure that the
  entries fit inside the tableau boxes (you can change the box
  dimensions using the \option{box height}, \option{box width}, and
  \option{scale} keys). The \option{halign} and \option{valign} keys
  provide a crude way to change the horizontal and vertical alignment of
  the box entries.

  \begin{example}{tableauhAlign}
  \Tableau[halign=left]{1{11}{11},{11}1} \quad
  \Tableau[halign=centre]{1{11}{11},{11}1} \quad
  \Tableau[halign=right]{1{11}{11},{11}1}
  \end{example}

  \begin{example}{tableauValign}
  \Tableau[valign=bottom]{qf,gpt,jb} \quad
  \Tableau[valign=centre]{qf,gpt,jb} \quad
  \Tableau[valign=top]{qf,gpt,jb}
  \end{example}

  These keys are provided for completeness only.  Their use is generally
  not recommended.

  \option[\aTableauColour{Inner}]{inner wall=colour}[\LaTeX~colour]
  \option*[thin, line cap=rect]{inner style=style}[\TikZ-styling]

  The \option{inner wall} option sets the colour of the inner wall,
  whereas \option{inner style} sets the \TikZ-styling of the inner wall.
  (In particular, \option{inner style} can override \option{inner wall}.)

  \begin{example}[label=Ex:dashed]{tableauInnerWall}
  \Tableau[australian, inner wall=red]{123,455,674} \qquad
  \Tableau[inner style=dashed]{123,455}
  \end{example}


  \index{dashed}
  \index{style!dashed}
  If you look closely at the second tableau in \autoref{Ex:dashed}, you will
  notice that the dashes are not very clean. This is because, for
  example, the dashes on the bottom of one box do not coincide with
  the dashes on the top of the adjacent box below it. Rather than
  using \option{inner style=dashed} it is better to use something like
  \option{inner style=\{dash pattern=on 1pt off 2pt\}}.

  \begin{example}{tableauInnerStyle}
  \Tableau[inner style={dash pattern=on 1pt off 2pt}]
    {123,455}
  \end{example}

  Use \option{inner wall=none} to remove the inner tableau walls. Alternatively, use
  the \option{no boxes} key.

  \begin{example}{tableauInnerWallNone}
  \Tableau[russian, inner wall=none]{123,45,67} \qquad
  \Tableau[russian, no boxes]{123,45,67}
  \end{example}

  \option[none]{label=text}[any character/text]
  \option*[font=\textbackslash scriptsize, text=\aTableauColour{Inner}]{label style=style}[\TikZ-styling]

  The \option{label} key adds a label to a tableau next to the
  $(1,1)$-box. The style of the label can
  be changed using the \option{label style} key.

  \begin{example}{tableauLabel}
  \Tableau[russian, label={\mathtt{t}}]{13,25,4} \quad
  \Tableau[french, label=0, label style={red}]{13,5} \quad
  \Tableau[label style={draw=orange,circle, inner sep=0pt,
    minimum size=2mm}, label=1] {12,35,5}
  \end{example}

  Like tableau entries, the \option{label} is typeset in mathematics
  mode.

  \option[true]{math boxes}[true/false]
  \option*[false]{text boxes}[true/false]

  Use the \option{math boxes} and \option{text boxes} keys to have
  the tableau entries typeset in either mathematics mode or text mode,
  respectively. By default, the entries of a tableau are typeset in
  mathematics mode.

  \begin{example}{tableauMathBoxes}
  \Tableau[math boxes]{ABCD, efg, HI}\qquad% the default
  \Tableau[text boxes]{ABCD, efg, HI}
  \end{example}

  \option[A]{name=text}[string]

  By default, the boxes can be referenced using the named coordinates
  \textsf{(A-1-1)}, \textsf{(A-1-2)}, \textsf{(A-1-3)}, \dots, with
  \textsf{(A-$r$-$c$)} referring to the box in row~$r$ and column~$c$.
  Use \option{name} to change the \emph{prefix} \textsf{A} to anything
  that you like.  This feature is most useful when you have several
  tableaux inside a \keyword{tikzpicture} environment because you can
  refer to boxes in the different diagrams by giving each tableau a
  different \option{name}. If you only have one tableau, then you do
  not normally need to change the default prefix for the named coordinates.
  See \autoref{E:NodeNames} for a description of the extended anchor names.
  For other examples using named coordinates and anchors see \autoref{Ex:diagramNames},
  \autoref{Ex:tableauTikzpicture}, \autoref{Ex:tableauUpDown} and \autoref{Ex:multiKLRW}.

  \option[]{paths=ribbon specifications}[list of paths]
  \option*[]{path style=style}[\TikZ-styling]

  Use the \option{paths} key to add a comma-separated list of
  \emph{ribbon paths} to the tableau. This allows you to draw certain
  types of paths inside your tableaux and diagrams.

  Ribbon paths are specified using the \keyword{\RibbonTableau} syntax.
  You first specify the row and column indices of the \emph{head}
  of the ribbon, which is the unique node of maximal content in the
  ribbon, and then give a sequence of \textsf{r}'s and \textsf{c}'s
  depending on whether the row index increases or the column index
  decreases, respectively.  As always, you have the option of adding
  style --- and you can also specify the contents of each box in the
  ribbon.  For more details about the ribbon specifications, with
  examples, see \autoref{S:RibbonTableaux}, which describes the
  \keyword{\RibbonTableau} command.

  \begin{example}{tableauPaths}
  \Tableau[styles={R={red,thick}, C={cyan,thick}},
     paths={(R)14ccrc,(C)23rcc}]{1234,567,89{10}}
  \end{example}

  The \option{path style} key changes the default style of the path:

  \begin{example}{tableauPathsStyle}
  \Tableau[styles={R={red,thick}, C={cyan,thick}},
     paths={(R)14ccrc,(C)23rcc},
     path style={rounded corners}]{1234,567,89{10}}
  \end{example}

  \option[]{path box=text}[a node entry]
  \option*[]{path box style=style}[\TikZ-styling]

  The \option{path box} sets the default entry for every box on a path.
  The \option{path box} is only used if you have not specified a box
  entry as a subscript in the path/ribbon specification.  This key is
  useful if you want to mark all of the boxes in every path with the
  same symbol.

  \begin{example}{tableauPathBox}
  % \usepackage{MnSymbol}
  \aTabset{styles={R={red,text=red,thick},
    C={cyan,text=cyan,thick}}}
  \Tableau[path box=\bigcircle,
    paths={(R)14ccrc,(C)23rcc},
  ]{1234,567,89{10}}
  \end{example}

  Use \option{path box style} to change the style of the boxes in
  the path.

  \begin{example}{tableauPathBoxStyle}
  \Tableau[styles={R={red,thick}, C={cyan,thick}},
    paths={(R)14ccrc,(C)23rcc},
    path box style={draw,circle, minimum size=4mm}
  ]{1234,567,89{10}}
  \end{example}

  By combining \option{path box style} and \option{path style}, you can
  ``decorate'' the boxes on a path.

  \begin{example}{tableauPathBoxStyleCircle}
  \Tableau[styles={R={red,thick}, C={cyan,thick}},
    paths={(R)14ccrc,(C)23rcc},
    path box style={draw,circle, minimum size=4mm},
    path style={draw=none},
  ]{1234,567,89{10}}
  \end{example}

  Another way to do this is to change the style of the individual paths,
  which gives more control because different paths can be given
  different styling.

  \begin{example}{tableauPathsBoxStyle}
  \Tableau[styles={R={draw=none,text=red,thick},
                   C={cyan,thick}},
    paths={(R)14ccrc,(C)23rcc},
    path box style={draw,circle, minimum size=4mm},
  ]{1234,567,89{10}}
  \end{example}

  \option[]{ribbons=ribbon specifications}[list of ribbons]
  \option*[]{ribbon box=text}[A node entry]
  \option*[]{ribbon box style=style}[\TikZ-styling]
  \option*[draw=\aTableauColour{Inner}, thin]{ribbon style=style}[\TikZ-styling]

  Use the \option{ribbons} key to add a comma-separated list of
  \emph{ribbons} to a tableau.  The ribbon specifications are identical
  to those used for \option{paths}.  For more details, see
  \autoref{S:RibbonTableaux}, which describes the
  \keyword{\RibbonTableau} command.

  The \option{ribbons} key works in almost exactly the same way
  as the \option{paths} key, with the difference being that we are
  adding ribbons to the tableau rather than lines. The
  \option{ribbon style} key controls the default ribbon style. The
  \option{ribbon box} and \option{ribbon box style} keys work in the
  same way as \option{path box} and \option{path box style},
  respectively.

  \TikZ-styling can be added to ribbons using \option{ribbon style} and
  \option{ribbon box style}. The \option{ribbon style} changes the
  default style of the entire ribbon, whereas \option{ribbon box style}
  changes the default style of the individual boxes in the ribbon.

  \begin{example}{tableauRibbons}
  \Tableau[ribbon style={fill=blue!20,opacity=0.4},
    ribbons={22rc}]{123,45,67}
  \end{example}

  Use \option{ribbon box style} to change the default style of the boxes
  in a ribbon. For example, the following code uses ribbons of
  length~$1$ (that is, boxes), to highlight the addable boxes of this
  tableau.

  \begin{example}{tableauRibbonStyle}
  \Tableau[tableau star={fill=green!80!blue,text=white},
    ribbon style={fill=yellow,text=red},
    ribbons={15_A,24_B,42_C,51_D},
  ]{123*4,567,89*{10},*{11}}
  \end{example}

  As this example indicates, ribbons are assumed to be contained inside
  the diagram of the tableau, so they do not change the border of a
  tableau.

  \option[]{snobs=ribbon specifications}[list snobs]
  \option*[]{snob box=text}[A node entry]
  \option*[]{snob box style=style}[\TikZ-styling]
  \option*[draw=\aTableauColour{Inner}, thin]{snob style=style}[\TikZ-styling]

  Use \option{snobs} to add ribbons to the tableau, which are ribbons
  that are placed \textit{after} the border of the diagram is drawn.
  (Writing \textit{ribbons} backwards gives \textit{snob}bir.) The
  \option{snob style} key controls the default style of snobs.

  \begin{example}{tableauSnobs}
  \Tableau[tableau star={fill=green!80!blue, text=white},
    snob style={fill=yellow, text=red},
    snobs={15_A,24_B,42_C,51_D},
  ]{123*4,567,89*{10},*{11}}
  \end{example}

  The difference between this picture and the one given above using
  \option{ribbons} is that \option{snobs} are drawn \textit{after}
  the tableau border, which causes the border to disappear for these
  nodes.  For this reason, in most cases you should normally avoid
  \option{snobs} and use \option{ribbons}. This said, \option{snobs} are
  exactly what are needed in \autoref{Ex:multiGarnir}.

  Since snobs are placed after the tableau is drawn, they provide a way
  to add content outside of the tableau or diagram, as shown by the
  following picture.

  \begin{example}{diagramSnobBox}
  \Diagram[entries=contents, snob style={draw=none},
    snob box=\hspace*{3mm}\cdots,
    snobs={16, 26, 36, 61_\vdots, 62_\vdots, 63_\vdots}
  ] {5^5}
  \end{example}

  The \option{snob box} and \option{snob box style} keys work in the
  same way as the \option{path box} and \option{ribbon box}, and
  \option{path box style} and \option{ribbon box style}, keys.

  \option[0]{rotate=angle}[angle in degrees]

  The \option{rotate} key rotates the tableau (diagram, or abacus),
  through the specified number of \textit{degrees} in an anti-clockwise
  direction around the outside vertex of the box in row~$1$ and
  column~$1$.

  \begin{example}{tableauRotate}
  \Tableau[rotate=0]{123,45} \quad
  \Tableau[rotate=45]{123,45} \space
  \Tableau[rotate=160]{123,45}
  \end{example}

  Only the boxes in the tableau, not their entries, are rotated.  Only
  one \option{rotate} key should be used in any given picture. For
  efficiency reasons, the tableau conventions, such as
  \option{russian} and \option{australian}, should be used in
  preference to the \option{rotate} key.

  \option[1]{scale=number}[a decimal number]
  \option*[1]{xscale=number}[a decimal number]
  \option*[1]{yscale=number}[a decimal number]

  By design, boxes in tableaux do not automatically resize to fit
  their contents. For example, consider:

  \begin{example}{tableauNotScaled}
  \Tableau{ 13{10}{11}{1+x}, 2{1+x} }
  \end{example}

  This is unlikely to be the desired output! The options \option{scale},
  \option{xscale}, and \option{yscale} can be used to rescale the boxes
  in tableaux and diagrams. The names are slightly misleading because
  \option{xscale} rescales in the direction of increasing column index
  and \option{yscale} rescales in the direction of increasing row index.

  \begin{example}{tableauScaled}
  \Tableau[scale=2]{ 13{10}{11}{1+x}, 2{1+x} }
  \end{example}

  \begin{example}{tableauXScale}
  \Tableau[xscale=2]{ 13{10}{11}{1+x}, 2{1+x} }
  \end{example}

  When using the \textsf{australian} and \textsf{russian} conventions,
  \option{xscale} and \option{yscale} scale in both the \textsf{x}
  direction and the \textsf{y}-direction, reflecting how these tableaux
  grow with increasing column and row index, respectively.

  \begin{example}{tableauXScaleRussian}
  \Tableau[russian, xscale=2]{ 13{10}{11}{1+x}, 2{1+x} }
  \end{example}

  \begin{example}{tableauXScaleFrench}
  \Tableau[french, xscale=2]{ 13{10}{11}{1+x},2{1+x} }
  \end{example}

  \begin{warning}
    When used with \keyword{\aTabset}, \option{scale}, \option{xscale},
    and \option{yscale}, affect all \aTableau pictures, including
    abacuses. For this reason, it is better to use \keyword{\aTabset} to
    set the \option{box height} and \option{box width} sizes if you only
    want to change the default sizes of the diagrams and tableaux in
    your document.
  \end{warning}

  \begin{warning}
    If you use an \aTableau command inside a \textit{scaled} \keyword{tikzpicture}
    environment of the form:
    \begin{quote}
    \keyword{\begin{tikzpicture}[scale=?]...\end{tikzpicture}} ,
    \end{quote}
    then you will almost certainly need to use the same \option{scale}
    key with the \aTableau command because the \TikZ \keyword{scale} key
    does not scale individual objects in the environment.
    Another alternative is to use \keyword{transform canvas={scale=?}} in the
    \keyword{tikzpicture}.
  \end{warning}

  \option[0.5]{script=value}[decimal number]
  \option*[0.4]{scriptscript=value}[decimal number]

  Even though this is rarely needed, tableaux and diagrams can be used
  as subscripts and superscripts, in which case they are automatically rescaled
  to slightly smaller sizes. The \option{script} and \option{scriptscript}
  keys give finer control over the sizes of subscripts and subsubscripts,
  respectively, which can be used in conjunction with the \option{scale},
  \option{xscale} and \option{yscale} keys.

  \begin{example}{tableauSubscript}
  $v_{\Tableau{123,45}}$ \qquad% the default
  $v_{\Tableau[script=0.3, xscale=2]{123,45}}$
  \end{example}

  \option[false]{shifted}[true/false]

  Set \option{shifted} to \textsf{true} for a shifted tableau or shifted
  diagram. Shifted tableaux, and shifted diagrams, are discussed in more
  detail in \autoref{S:Shifted}, which describes the \keyword{\ShiftedDiagram}
  and \keyword{\ShiftedTableau} commands, which produce pictures like the
  following:

  \begin{example}{tableauShifted}
  \Tableau[shifted]{123,45} \qquad
  \Diagram[shifted]{3,2^2}
  \end{example}

  Equivalently, the commands \keyword{\ShiftedTableau{123,45}} and
  \keyword{\ShiftedDiagram{2^2,1}{3,2^2}}, respectively, can be used for
  these two pictures. See \autoref{S:Shifted} for the options specific
  to shifted tableaux and shifted diagrams.

  \option[fill=\aTableauColour{Star}]{tableau star=style}[\TikZ-styling]

  Use \option{tableau star} to change the style of the starred entries
  of a tableau. (In \TikZ parlance, \option{tableau star} \emph{appends}
  these styles to the default \option{tableau star}.)

  \begin{example}{tableauStarStyleText}
  \Tableau[tableau star={text=magenta, draw=cyan, thick}]
    {1*2*3,4*5} \qquad
  \Tableau[tableau star={fill=orange!50}]{1*2*3,4*5}
  \end{example}

  Note that the tableau border is drawn \textit{after} the
  \option{tableau star} is applied. You can use \option{snobs} to draw
  over the top of the border.

  \option[]{styles=\TikZ-styles}[List of styles]

  The \option{styles} key is a shorthand for defining \TikZ-styles
  for the current picture. For example, instead of writing

  \begin{example}{tableauFrenchStyle}
  \tikzset{
     B/.style={fill=blue!40, text=yellow},
     G/.style={fill=green!80!blue,circle,minimum size=5mm},
     R/.style={fill=red,text=white, font=\tiny},
     Y/.style={fill=yellow!20, text=blue}
  }
  \Tableau[french]{[R]1[B]2,[G]3,[Y]4}
  \end{example}

  you can save a little bit of typing using the \option{styles} key:

  \begin{example}{tableauFrenchStyles}
  \Tableau[french, styles={
     B={fill=blue!40, text=yellow},
     G={fill=green!80!blue,circle,minimum size=5mm},
     R={fill=red,text=white, font=\tiny},
     Y={fill=yellow!20, text=blue},
  }]{[R]1[B]2,[G]3,[Y]4}
  \end{example}

  Styles defined this way will only be available in the current picture.
  Use \keyword{\tikzset} to define styles that are likely to be used
  more than once. Alternatively, you can use \keyword{\aTabset{styles={...}}}
  to define styles that can be used from this point in the document
  onwards. (Notice the use of \keyword{\aTabset} here. Using \keyword{\tikzset{styles={...}}}
  will result in an error.)

  \option[false]{tabloid}[true/false]

  Use the \option{tabloid} key to draw a tabloid. This key is discussed in
  more detail in \autoref{S:Tabloid}, which describes the
  \keyword{\Tabloid} command.

  \begin{example}{tableauTabloid}
  \Tableau[tabloid]{123,45} \qquad
  \Diagram[tabloid]{3,2^2}
  \end{example}

  Equivalently, the command \keyword{\Tabloid{123,45}} can be used for
  the first of these pictures.  See \autoref{S:Tabloid} for the options
  specific to tabloids.

  \option[]{tikzpicture=keys}[\TikZ-keys]

  This command adds an optional argument to the underlying
  \keyword{tikzpicture} environment, which contains the tableau. The
  \option{tikzpicture} option is ignored  when the \keyword{\Tableau}
  command is equipped with $(x,y)$-coordinates.

  An interesting application of the \option{tikzpicture} key is for
  annotating a tableau. Consider:

  \begin{example}[lefthand width=0.3\textwidth]{tableauTikzpicture}
  \Tableau[russian, tikzpicture={remember picture}]
  { 1[fill=blue!20]23[text=red]45,
    6*78[draw=cyan,ultra thick]9,
    [circle,fill=orange]{10}*{11}{12},
    [dashed,draw=red,ultra thick]{13}
  }
  \end{example}

  Recalling the \option{name} key, the nodes in this tableau are
  referenced as \textsf{(A-1-1)}, \textsf{(A-1-2)}, \textsf{(A-1-3)},
  \dots. Since \autoref{Ex:tableauTikzpicture} uses \textit{remember picture}, other
  \keyword{tikzpicture} environments can reference the named coordinates in the
  last tableau, which allows us to refer back to the tableau above using:

  \vspace*{3mm}

  \begin{example}[lefthand width=0.3\textwidth]*{tableauOverlay}
  \tikz[remember picture, overlay]
  \draw[very thick, ->, red]
     (0,0) node[right,align=left]
        {This circle is too big!\\Use minimum size=5mm}
     to [out=135, in=225](A-3-1);
  \end{example}

  (See the \ctan{tikzmark} package for extensions of this idea.)

  \option[]{tikz before=\TikZ commands}[\TikZ commands]
  \option*[]{tikz after=\TikZ commands}[\TikZ commands]

  These keys inject \TikZ code into the underlying \keyword{tikzpicture}
  environment, where the tableau is constructed, before and after the
  \keyword{\Tableau} command, respectively.

  \begin{example}[lefthand width=0.24\textwidth]{tableauTikzBefore}
  \Tableau[
    tikz before={\draw[help lines, step=0.5](-0.5,-2)grid(2,0.5);},
    tikz after={
      \draw[ultra thick, red](A-1-3.north east)--(A-1-3.south east)
               --(A-2-1.north east)--(A-3-1.south east)
               --(A-3-1.south west);
   }]{134,567,89}
  \end{example}

  Both before and after hooks are provided because later \TikZ commands are
  drawn over the top of earlier ones, so the order matters. Note that the
  \emph{before} code cannot use the named coordinates \textsf{A-r-c}
  because this code is executed before these nodes are constructed,
  which happens when the tableau is drawn. For more information about
  the drawing order used for tableaux, see \autoref{SS:order}.

  % --------------------------------------------------------------
  \subsubsection{Compositions}
  \index{composition}

  As we have defined them, tableaux are always of \textit{partition}
  shape, in the sense that the lengths of the rows form a weakly
  decreasing sequence. In fact, the \aTableau commands also
  accept diagrams and tableaux of \emph{composition} shape, where the lengths of the
  rows are not necessarily in decreasing order. Diagrams and tableaux of
  composition shape are drawn in exactly the same way as those of
  partition shape.

  \begin{Example}{tableauCompositions}
  \Tableau{45,2751,31 }  \qquad \SkewTableau{1,2}{45,27,31}   \qquad
  \Diagram{1,2,4,1}      \qquad \SkewDiagram{1,2,2,1}{1,2^2,1}
  \end{Example}

  Even though it is possible to draw compositions and tableaux of composition
  shape, compositions are not fully supported in the sense that many of the
  options/keys assume that the diagrams are of partition shape. In addition,
  some options assume that tableaux and diagrams do not contain empty rows
  and that the diagrams are \textit{connected}, in the sense that their
  boundary can be drawn without lifting the pen off the page.  (For
  disconnected tableaux and diagrams, see the \keyword{\Multidiagram}
  and \keyword{\Multitableau} commands in \autoref{S:Multitableau}.)

  % --------------------------------------------------------------
  \subsubsection{Tableaux drawing order}
  \label{SS:order}
  \index{tableau!drawing order}

  When \TikZ constructs a picture, later objects are drawn over the top
  of earlier ones, which can obscure earlier features. Consequently,
  for more complicated diagrams and tableaux it helps to know the order
  in which the different parts of these diagrams are drawn, which is the
  following:
  \begin{itemize}[nosep]
    \item First, the tableau entries that use the default styling are
    placed in the order that they appear in the \textit{tableau
    specifications}.
    \item Secondly, the styled tableau entries are placed in the order
    that they appear in the \textit{tableau specifications}.
    \item Next, the nodes in any \option{ribbons} and ribbon
    \option{paths} are placed, again in the order that the ribbons are
    listed. For each ribbon, first the border of the ribbon is drawn,
    together with any styling for the ribbon, and then the boxes in the
    ribbon, together with any styling, are added.
    \item The border of the tableau is drawn, including the cover and
    skew borders when they are enabled by \option{cover border} and
    \option{skew border}, respectively.
    \item The \option{dotted rows} and \option{dotted cols} keys
    replace the specified rows and columns with dots.
    \item Finally, any \option{snobs} are drawn in the order that they are listed.
  \end{itemize}

  All of the tableau and Young diagram commands use this drawing order.

  % --------------------------------------------------------------
  \subsubsection{Special characters}
  \index{tableau!special characters}
  \index{tableau!comma}
  \index{tableau!*}
  \index{tableau![}

  The three characters\space
  \keyword[width=1.5em,height=1em]{,} \space
  \keyword[width=1.5em,height=1em]{*} \space
  \keyword[width=1.5em,height=1em]{[} \space
  each has a special meanings in the \textit{tableau specifications}.
  Enclose these characters in braces if you want to use these characters as
  entries in a tableau:

  \begin{example}{tableauSpecial}
  \Tableau{ 13{,}5], 8{[}, {*} }
  \end{example}

  There is no need to enclose~\keyword{]} in braces because it only
  becomes special when there is a matching~\keyword{[}, which is
  not surrounded by braces.

  % --------------------------------------------------------------
  \subsection{Young diagrams}
  \label{S:Diagram}
  \indexcmd{Diagram}
  \index{young diagram@Young diagram|see{diagram}}
  \index{diagram}
  \index{diagram}
  \index{partition!diagram}

  A \emph{Young diagram}, or simply a \emph{diagram}, is an unlabelled
  tableau. Diagrams can be drawn using the \keyword{\Tableau} command:

  \begin{example}{tableauDiagram}
  \Tableau{~~~,~~~,~~,~}
  \end{example}

  This approach works, but it is cumbersome, hard to proofread, and easy
  to get wrong.  For this reason, \aTableau provides the
  \keyword{\Diagram} command.  The \keyword{\Diagram} command uses
  almost exactly the same syntax as the \keyword{\Tableau} command:

  \keyword{\Diagram (x,y) [options] {partition}}

  Like the \keyword{\Tableau} command, the $(x,y)$-coordinates are
  needed only if the diagram is inside a \keyword{tikzpicture}
  environment.  The \keyword{\Diagram} command allows the
  \emph{partition} to be specified as either a comma-separated list of
  \emph{weakly decreasing positive integers}, or using \emph{exponential
  notation}:
  \index{exponential notation}
  \index{partition!exponential notation}
  \index{diagram!exponential notation}

  \begin{example}{diagram}
  \Diagram{4,3^2,1^3} \qquad
  \Diagram{4,3,3,1^2}
  \end{example}

  Internally, \keyword{\Diagram} actually does something like the first
  example in this section, so all of the options for the
  \keyword{\Tableau} command can be used with \keyword{\Diagram}. Rather
  than repeating all of the \keyword{\Tableau} options in this section,
  we highlight the keys that are more interesting for diagrams, together with
  some new, diagram-specific, keys.

  \begin{samepage}
  Just like the \keyword{\Tableau} command, \keyword{\Diagram} supports the
  four different conventions for diagrams, with the \option{english}
  convention being the default:

  \option[-]{english}
  \option*[]{french}
  \option*[]{russian}
  \option*[]{australian}
  \end{samepage}

  \begin{example}{diagramAustralian}
  \Diagram[australian]{3,2,1} \qquad
  \Diagram[australian]{3,1^3}
  \end{example}

  \begin{example}{diagramEnglish}
  % English is the default convention
  \Diagram[english]{3,2,1} \qquad
  \Diagram{3,1^3}
  \end{example}

  \begin{example}{diagramFrench}
  \Diagram[french]{3,2,1} \qquad
  \Diagram[french]{3,1^3}
  \end{example}

  \begin{example}{diagramRussian}
  \Diagram[russian]{3,2,1} \qquad
  \Diagram[russian]{3,1^3}
  \end{example}

  \option[true]{border}[true/false]
  \option*[false]{no border}[false/true]

  If \option{border} is true, which it is by default, then the border of
  the tableau is drawn using slightly thicker lines than the internal
  walls of the diagram. If \option{border} is false, then the border of
  the tableau is not drawn. Notice that the border refers only to the
  outside border of the diagram and not to the internal borders of the
  boxes on the diagram, which can be disabled using \option{no boxes}.

  \begin{example}{diagramNoBorder}
  \Diagram[border=false]{3,2,1} \qquad
  \Diagram[no border, french]{3^2,1}
  \end{example}

  The \option{no border} option, and similar options, are provided only
  for completeness because it is the inverse of \option{border}. That
  is, \option{no border} is equivalent to \option{border=false}, and
  \option{no border=false} is equivalent to \option{border=true}.

  \option[true]{boxes}[true/false]
  \option*[false]{no boxes}[false/true]

  The \option{boxes} and \option{no boxes} keys control whether or not
  the internal walls around the boxes are drawn, with these two keys
  being inverses of each other. By default, \option{boxes} is true, so
  the internal boxes are drawn.  When \option{no boxes} is in force
  (equivalently, \option{boxes} is false), the internal walls around
  boxes are not drawn.

  \begin{example}{diagramNoBoxes}
  \Diagram[no boxes]{3,2,1} \qquad
  \Tableau[french, no boxes, no border]{123,45}
  \end{example}

  \option[false]{conjugate}[false/true]

  Draws the conjugate diagram, which has the rows and columns
  interchanged.

  \begin{example}{diagramConjugate}
  \Diagram[conjugate]{3,2,2} \qquad
  \Diagram[russian, conjugate]{2,1^3}
  \end{example}

  \option[]{dotted cols=column indices}[comma-separated list of columns]
  \option*[]{dotted rows=row indices}[comma-separated list of rows]

  The \option{dotted rows} and \option{dotted cols} keys draw diagrams
  where the specified rows and columns are replaced with dots. This
  makes it possible to draw \emph{generic} diagrams, where the number of
  rows and columns are not specified completely.

  \begin{example}{diagramDottedRows}
  \aTabset{scale=0.7}
  \Diagram[dotted rows={2,4,5}]{4^2,2^2,1^3} \qquad
  \Diagram[dotted cols={5,3,4},
    no boxes] {6,5,4,3,2,1}
  \end{example}

  As this example suggests, if the row and column indices are in increasing
  \textit{consecutive} order, then the corresponding rows or columns are
  replaced as a block. Non-consecutive indices are treated separately.

  \begin{example}{diagramDottedCols}
  \aTabset{scale=0.7, no boxes}
  \Diagram[dotted rows={4,5,3}] {6,5,5,5,2,1} \qquad
  \Diagram[dotted cols={5,3,4}] {6,5,5,5,2,1}
  \end{example}

  \index{tableau!dotted rows}
  \index{tableau!dotted cols}
  The \option{dotted rows} and \option{dotted cols} keys work by
  overwriting the content on the specified rows and columns, so
  anything that was drawn in these rows and columns will disappear.  The
  \option{dotted rows} and \option{dotted cols} keys can be used with
  the \keyword{\Tableau} command, with the caveat that this will remove
  all boxes, with their contents, in the specified rows and columns.

  When the \option{dotted rows} and \option{dotted cols} keys are
  used together, the \option{dotted rows} are applied first.

  \begin{example}{diagramDotted}
  \Diagram[scale=0.7, no boxes,
    dotted rows={4,5},
    dotted cols={4,5},
  ] {6,5,5,5,2,1}
  \end{example}

  When using these two keys together, you need to be careful when
  choosing which rows and columns to remove because, sometimes,
  artefacts can remain. Ideally, the endpoints of the rows and columns
  being removed should not overlap. For example, consider the two
  pictures:

  \begin{example}{diagramDottedColsTikz}
  \aTabset{scale=0.7, no boxes}
  \Diagram[dotted cols={3}]{6,5,5,5,2,1}\qquad
  \Diagram[dotted cols={4,5,3}, dotted rows={4,5,3},
    tikz after={ \draw[red](0.9,-1.4)circle(0.2); }
  ]{6,5,5,5,2,1}
  \end{example}

  The circled horizontal dots in the right-hand diagram are a ``user
  error'', not a bug. The left-hand diagram shows that these dots come
  from removing column~$3$, using the $3$ in \option{dotted cols}, because
  this is done \emph{after} first removing rows 4--5 with
  \option{dotted rows}.

  The \option{dotted rows} and \option{dotted cols} keys are not
  designed to be used with the \option{conjugate} key.

  \option[]{ribbons=ribbon specifications}[list of ribbon specifications]
  \option*[]{paths=ribbon specifications}[list of ribbon specifications]
  \option*[]{snobs=ribbon specifications}[list of ribbon specifications]

  Use \option{ribbons}, \option{paths} and \option{snobs} to add
  ribbons, ribbon paths and snobs to a diagram, respectively. The
  \option{paths} and \option{ribbons} are drawn before the border of the
  diagram is drawn, whereas the \option{snobs} are drawn after the border.

  \begin{example}{diagramRibbons}
  \Diagram[french, ribbons={*22*c_4*r*r}]{3,2^2,1} \qquad
  \end{example}

  As described in \autoref{S:Tabloid}, there are additional keys that
  control the behaviour of \option{paths}, \option{ribbons} and
  \option{snobs}. For example, the keys \option{path style},
  \option{path box} and \option{path box style} are associated to
  \option{paths}.

  \begin{example}{diagramPaths}
  \Diagram[russian, inner style=dotted,
    styles={b={fill=blue!20,opacity=0.4},
            R={red,text=red,thick},
            B={blue,text=blue,thick},
    }, path style={thick},
    path box=\bullet,
    paths={(R)15rccrc[b]rc,(B)43[b]rcc}
  ]{5^2,3^3}
  \end{example}

  The ribbon specifications are described in
  \autoref{S:RibbonTableaux}, which documents the
  \keyword{\RibbonTableau} command.

  % --------------------------------------------------------------
  \subsubsection{Diagrams with entries}\label{SS:entries}
  \index{contents}
  \index{first tableau}
  \index{hooks}
  \index{last tableau}
  \index{residues}
  \index{first tableau}
  \index{tableau!contents}
  \index{tableau!first}
  \index{tableau!hooks}
  \index{tableau!last}
  \index{tableau!residues}

  The \option{entries} key provides a shortcut for drawing some common
  tableaux of a specified shape, where the entries follow a common
  pattern.

  \option[]{entries=value}[columns, contents, first, hooks, last, residues, rows]

  In each case, use \option{charge} to offset the generated entries. The
  possible choices for \option{entries} are:

  \begin{itemize}

  \item\option{entries=columns}: Prints the diagram where each box is
    labelled by its column index.

  \begin{example}{diagramEntriesColumns}
  \Diagram[entries=columns]{3,2,2} \qquad
  \Diagram[french, entries=columns]{2^2,1} \qquad
  \Diagram[entries=columns,charge=3]{2,1^2}
  \end{example}
  \index{tableau!columns}

  \item\option{entries=contents}: Prints the diagram where each box is
    labelled by its \emph{content}, which is the row index minus the
    column index.

  \begin{example}{diagramEntriesContents}
  \Diagram[entries=contents]{2^3} \qquad
  \Diagram[french, entries=contents]{2^2,1}\qquad
  \Diagram[entries=contents,charge=-3]{2,1^2}
  \end{example}
  \AddKeyLink{contents}
  \AddKeyLink{residues}
  \AddKeyLink{charge}
  \index{tableau!contents}
  \index{contents}
  \index{entries!contents}

  In mathematics-mode, \LaTeX{} typesets minus signs as operators, which
  makes the minus sign for negative contents too wide when they appear inside a
  tableau. To correct for this, \aTableau uses the
  \keyword{\shortminus} command for negative content
  values.
  More explicitly, when using \option{entries=contents}, a content of
  minus one inside a tableau is typeset using \keyword{\shortminus1},
  which looks like~$\shortminus1$ instead of~$-1$.

  \item\option{entries=first}: Prints the \emph{first}
    \textbf{standard} tableau of this shape, with respect to the Bruhat
    order. This is the tableau that has the numbers $1,2\dots,n$ entered
    in order along the rows by reading left to right along each row, with the
    rows read in order from top to bottom. (That is, the boxes are
    labelled using the total order where $(r,c)<(r',c')$ if $r<r'$ or
    $r=r'$ and $c<c'$.)

  \begin{example}{diagramEntriesFirst}
  \Diagram[entries=first]{3,2,2} \qquad
  \Diagram[russian, entries=first,charge=2]{3^2,2}
  \end{example}
  \index{first tableau}
  \index{tableau!first}
  \index{entries!first}

  \item\option{entries=hooks}: Prints the diagram where each box is
    labelled by the corresponding \emph{hook length}. If $\lambda$ is a
    partition and $\lambda'$ is its conjugate partition, then the hook
    length of the box in row~$i$ and column~$j$ is
    $\lambda_i-i+\lambda'_j-j+1$.

    \index{tableau!hook lengths}
    \index{hook lengths}
    \index{entries!hook lengths}

  \begin{example}{diagramEntriesHooks}
  \Diagram[entries=hooks]{3,2,2} \qquad
  \Diagram[russian, entries=hooks]{2^2,1}
  \end{example}

  \item\option{entries=last}: Prints the \emph{last} \textbf{standard}
    tableau of this shape, with respect to the Bruhat order. This is the
    tableau that has the numbers $1,2\dots,n$ entered in order along the
    columns by reading top to bottom down each column, with the columns
    read in order from left to right. (That is, the boxes are labelled
    using the total order where $(r,c)<(r',c')$ if $c<c'$ or $c=c'$ and
    $r<r'$.)

  \begin{example}{diagramEntrieslast}
  \Diagram[entries=last]{3,2,2} \qquad
  \Diagram[australian, entries=last]{2^2,1}
  \end{example}
  \index{last tableau}
  \index{tableau!last}
  \index{entries!last}

  \item\option{entries=residues}: Prints the diagram where each box is
  labelled by its \emph{residue}, which is the row index minus the
  column index modulo an integer~$e\ge2$, which must also be supplied.

  \index{residue}
  \index{tableau!residues}
  \index{affine quiver}
  \begin{example}{diagramEntriesResidues}
  \Diagram[entries=residues, e=2]{3,2,1} \qquad
  \Diagram[french, entries=residues, e=3]{3,2,1}
  \end{example}

  \noindent\AddKeyLink{cartan}\AddKeyLink{e}% By default, residue
  sequences for affine type $A^{(1)}_{e-1}$, which correspond to the
  symmetric group and friends, are used. Residues in affine types
  $C^{(1)}_e$, $A^{(2)}_{2e}$ and $D^{(2)}_e$ are available
  via \option{cartan=C}, \option{cartan=AA}, and \option{cartan=DD},
  respectively, where we (almost) follow the residue conventions from
  \cite{MathasTubbenhauer:BAD}.

    \smallskip
    \begin{example}{diagramEntriesResiduesC}
  % affine type C : C^{(1)}_{e-1}
  \Diagram[french, entries=residues,
    e=2, cartan=C] {8,4,2}
  \end{example}

  \begin{example}{diagramEntriesResiduesAA}
  % twisted affine type A : A^{(2)}_{2e}
  \Diagram[russian, entries=residues,
     e=2, cartan=AA] {8,4,2}
  \end{example}

  \begin{example}{diagramEntriesResiduesDD}
  % twisted affine type D : D^{(2)}_e
  \Diagram[entries=residues, e=2, cartan=DD] {8,4,2}
  \end{example}

  Use \option{colours} for residue-compatible shadings:

  \begin{example}{diagramEntriesResiduesColours}
  \Diagram[entries=residues, charge=1,
      colours={white,cyan!50,teal!50}]{3,2,1}
  \end{example}

  \item\option{entries=rows}: Prints the diagram where each box is
    labelled by its row index.

  \begin{example}{diagramEntriesRows}
  \Diagram[australian, entries=rows]{2^2,1} \qquad
  \Diagram[entries=rows,charge=2]{3,2,2}
  \end{example}
  \index{tableau!rows}

  \end{itemize}

  % --------------------------------------------------------------
  \subsection{Skew tableaux and skew diagrams}
  \label{S:Skew}
  \indexcmd{SkewTableau}
  \indexcmd{SkewDiagram}
  \index{diagram!skew}
  \index{partition!skew}
  \index{tableau!skew}

  A partition $\nu$ is \emph{contained} in another partition $\lambda$,
  written as~$\nu\subseteq\lambda$, if $\nu_k\le\lambda_k$, for
  $k\ge0$. If $\nu\subseteq\lambda$ then the \emph{skew partition}
  $\lambda/\nu=\set{(r,c)\in\lambda|(r,c)\notin\nu}$ is the set of nodes
  that are in~$\lambda$ and not in~$\nu$. In this manual, $\nu$ is
  the \emph{inner shape} and $\lambda$ is the \emph{outer shape}. A
  \emph{skew tableau} is a labelling of the nodes in the diagram of a
  skew partition. Skew partitions and skew tableaux can be drawn using
  the commands:

  \keyword{\SkewDiagram (x,y) [options] {inner shape} {outer shape}}\newline
  \keyword{\SkewTableau (x,y) [options] {inner shape} {skew tableau specifications}}

  \index{exponential notation}
  As with the previous commands, the $(x,y)$--coordinates should be
  given if, and only if, the picture is inside a \keyword{tikzpicture}
  environment.  The partitions for the inner and outer shapes can either
  be given as a comma-separated list of non-negative integers, or using
  exponential notation for repeated parts.

  Skew tableaux and skew diagrams should always be connected. Use
  \keyword{\Multidiagram} and \keyword{\Multitableau} to draw
  disconnected diagrams.

  In fact, the \keyword{\SkewTableau} is just an alias for the
  \keyword{\Tableau} command used with the \option{skew} key to set the inner
  shape. For this reason, almost all of the options for the \keyword{\Tableau}
  command can be used with \keyword{\SkewTableau}. The entries in a
  \keyword{\SkewTableau} are specified in exactly the same way as in the
  \keyword{\Tableau} command. In particular, the entries of skew
  tableaux can, optionally, be given style prefixes, by either using a~$*$ to
  add the current \option{tableau star}, or   \keyword{[...]} to add
  arbitrary \TikZ-styling.

  \begin{example}{skewTableau}
  \tikzset{R/.style={fill=red!20,text=red}}
  \SkewTableau[french]{1^2}{13,5*7,[R]79} \qquad
  \Tableau[french, skew={1^2}]{13,5*7,[R]79}
  \end{example}

  Similarly, the \keyword{\SkewDiagram} command is an alias for the
  \keyword{\Diagram} command, with the \option{skew} key.

  \begin{example}{skewDiagram}
  \SkewDiagram[french]{1^2}{2^3} \qquad
  \Diagram[french, skew={1^2}]{2^3}
  \end{example}

  As the \keyword{\SkewTableau} and \keyword{\SkewDiagram} commands
  are shortcuts, all of the options for the \keyword{\Tableau} and
  \keyword{\Diagram} commands can be used with the
  \keyword{\SkewTableau} and \keyword{\SkewDiagram} commands,
  respectively. In addition, the following options are supported:

  \option[false]{skew border}[true/false]
  \option*[true]{no skew border}[false/true]

  These two keys are inverse to each other.  When
  \option{skew border} is \textsf{true}, the border of the (inner) skew
  shape is drawn.

  \begin{example}{skewBorder}
  \tikzset{R/.style={fill=red!20,circle}}
  \SkewTableau[skew border]{2,1^2}{12[R]3,45,67}
  \SkewTableau[french, skew border]{2,1^2}{12[R]3,45,67}
  \end{example}

  Note that \option{skew border} only draws the border of the skew shape
  and not the boxes inside the inner skew shape. Use \option{skew boxes}
  to draw the interior walls of the boxes in the skew shape.

  \option[draw=\aTableauColour{Skew}, fill=\aTableauColour{Fill}, thick]{skew border style=style}[\TikZ-styling]

  Use \option{skew border style} to change the style of the skew border.
  Since the skew border is only drawn when \option{skew border} is set,
  the \option{skew border style} does not have any effect unless
  \option{skew border} has been set to \textsf{true}.

  \begin{example}{skewBorderStyle}
  \SkewTableau[skew border style={draw=brown},
      skew border]{2,1^2}{123,45,67} \qquad
  \SkewDiagram[skew border style={dashed,fill=red!10},
      skew border]{1^2}{2^3}
  \end{example}

  \option[false]{skew boxes}[false/true]
  \option*[true]{no skew boxes}[true/false]
  \option*[thin, fill=\aTableauColour{Fill}]{skew box style=style}[\TikZ-styling]

  The \option{skew boxes} key adds walls to the boxes inside the inner
  partition of a skew shape. Use \option{skew box style} to change the
  default shading of these boxes.

  \begin{example}{skewBoxes}
  \SkewTableau[skew boxes] {2,1^2}{12,345,67} \qquad
  \SkewTableau[skew boxes,
    skew box style={dash pattern=on 1pt off 2pt}
  ] {2,1^2}{12,345,67,89}
  \end{example}

  Using the options \option{skew border} and the \option{skew boxes}
  together gives the skew (inner) shape both inner and outer borders.

  \begin{example}{skewBorderBoxes}
  \SkewTableau[skew border, skew boxes] {2^2,1}{123,45,67}
  \end{example}

  \index{entries!skew tableaux}
  The \option{entries} key can be used with skew tableaux, except that
  \option{entries=hooks} produces uncertain results because hook lengths
  are not defined for skew shapes.

\begin{Example}{skewEntries}
\SkewDiagram[entries=columns]{2,1}{2^2,1}\qquad\SkewDiagram[entries=contents]{2,1}{2^2,1}\quad
\SkewDiagram[entries=first]{2,1}{2,2,1}\quad\SkewDiagram[entries=last]{2,1}{2^2,1}\quad
\SkewDiagram[entries=residues,e=3]{2,1}{2^2,1}\quad\SkewDiagram[entries=rows]{2,1}{2,2,1}
\end{Example}

  As implied in \autoref{SS:TableauOptions}, skew tableaux and skew
  diagrams can also be drawn using the \keyword{\Tableau} and
  \keyword{\Diagram} commands, together with the \option{skew} key:

  \begin{example}{skewEntriesBoxes}
  \Tableau[skew boxes, skew={2,1^2}]{12,35,6} \qquad
  \Diagram[entries=first, skew={2,1}]{2^2,1}
  \end{example}

  \index{cover}
  \index{partition!cover}
  \index{tableau!cover}
  The \option{cover} key works in exactly the same way as the
  \option{skew} key. In particular, as we now describe, there are
  identical keys for controlling the pictures that use the
  \option{cover} and \option{skew} keys.

  \option[true]{cover border}[true/false]
  \option*[false]{no cover border}[false/true]
  \option*[draw=\aTableauColour{Skew}, fill=\aTableauColour{Fill}, thick]{cover border style=style}[\TikZ-styling]

  These two keys are inverse to each other.  When \option{cover border}
  is \textsf{true}, the border of the outside covering shape is drawn.
  By default, \option{cover border} is \textsf{true}, so that the
  covering shape is drawn. In contrast, by default, \option{skew border}
  is false.

  \begin{example}{coverTableau}
  \tikzset{R/.style={fill=red!20,circle}}
  \Tableau[cover={3^3}, cover border]{12[R]3,45,67} \qquad
  \Tableau[cover={3^3}, french, cover border]
    {12[R]3,45,67}
  \end{example}

  The \option{cover border style} key changes the style of the cover border.

  \begin{example}{tableauCoverBorder}
  \Tableau[cover border style={draw=brown,thick},
    cover={3^2}]{123,45,67} \qquad
  \Diagram[cover border style={dashed,fill=red!10},
    cover={3,2}]{2^3}
  \end{example}

  \option[true]{cover boxes}[true/false]
  \option*[false]{no cover boxes}[false/true]
  \option*[thin, fill=\aTableauColour{Fill}]{cover box style=style}[\TikZ-styling]

  The \option{cover boxes} key adds walls to the boxes for the covering
  partition. Use \option{cover box style} to change the
  default shading of these boxes.

  \begin{example}{tableauCoverBoxes}
  \Tableau[cover={3^4}, no cover boxes]{123,45,67} \qquad
  \Tableau[cover={4^4}, cover boxes,
    cover box style={dash pattern=on 1pt off 2pt}
  ]{123,45,67,89}
  \end{example}

  By default, \option{cover border} is true, so if you want walls for
  the boxes in the covering partition and border walls, you only need to
  set \option{cover boxes}.

  \begin{example}{tableauCoverBorderBoxes}
  \Tableau[cover={4^2,3^2}, cover border, cover boxes]{123,45,67}
  \end{example}

  The \option{cover} and \option{skew} keys can be used together.
  Equivalently, you can use \option{cover} with the
  \keyword{\SkewDiagram} and \keyword{\SkewTableau} commands.

  \begin{example}{tableauSkewBorderCover}
  \Tableau[skew={2,1}, cover={6^4}, cover boxes,
    cover box style={fill=yellow!20, draw=brown},
    skew border, skew boxes ]{123,45,67}
  \end{example}

  Finally, we note that the \option{cover} and \option{skew} keys do not
  provide a mechanism to put entries inside the skew and cover shapes.
  Use the \option{paths}, \option{ribbons} and \option{snobs} keys when
  you need to do this.

  % --------------------------------------------------------------
  \subsection{Shifted tableaux and shifted diagrams}
  \label{S:Shifted}
  \indexcmd{ShiftedTableau}
  \indexcmd{ShiftedDiagram}
  \index{diagram!shifted}
  \index{strict partition}
  \index{partition!strict}
  \index{shifted tableau}
  \index{tableau!shifted }

  \emph{Strict partitions}, which have strictly decreasing parts, and
  \emph{shifted tableaux}, which are of strict partition shape, appear
  in several places in representation theory, such as in the study of
  projective representations of the symmetric groups. These tableaux and
  diagrams are drawn with row~$r$ shifted by $(r-1)$-units along the
  row, so that the first box in each row has content~$0$. These diagrams
  and tableaux can be drawn using the following commands:

  \keyword{\ShiftedDiagram (x,y) [options] {partition }}\newline
  \keyword{\ShiftedTableau (x,y) [options] {tableau specification}}

  As usual, the $(x,y)$-coordinates are necessary if, and only if, these
  commands are used inside a \keyword{tikzpicture} environment. The
  partition in a~\keyword{\ShiftedDiagram} can be given using
  exponential notation and the tableau specification for a
  \keyword{\ShiftedTableau} can include the usual optional style
  prefixes.

  \begin{example}{shiftedTableau}
  \tikzset{R/.style={fill=red!20,circle}}
  \ShiftedTableau{12[R]3,45,*6}  \qquad
  \ShiftedDiagram[french]{3,2,1}
  \end{example}

  In the literature,  shifted tableaux and shifted diagrams almost
  always have strict partition shape, however, this is not enforced by
  these commands. Under the hood, the \keyword{\ShiftedTableau} is the
  \keyword{\Tableau} command with the \option{shifted} option set to
  true. Similarly, \keyword{\ShiftedDiagram} is the same as using the
  \keyword{\Diagram} command with the \option{shifted} option.
  Consequently, all of the options for the \keyword{\Tableau} and
  \keyword{\Diagram} commands can be used with \keyword{\ShiftedTableau}
  and \keyword{\ShiftedDiagram}, respectively. Shifted tableaux and
  shifted diagrams can also be drawn using the \keyword{\SkewTableau} and
  \keyword{\SkewDiagram} commands, together with appropriate shifts.

  The \option{skew boxes} key can be used to highlight
  the shifted part of a shifted tableau or diagram:

  \begin{example}{shiftedDiagram}
  \ShiftedTableau[skew boxes]{1*23,4*5,6} \qquad
  \ShiftedDiagram[skew border]{3,2}
  \end{example}

  \index{entries!shifted tableaux}
  The \option{entries} key works as expected for shifted diagrams:

  \begin{Example}{shiftedEntries}
  \ShiftedDiagram[entries=contents]{4,2,1} \qquad
  \ShiftedDiagram[entries=first]{4,2,1} \qquad
  \ShiftedDiagram[entries=hooks]{4,2,1} \qquad
  \ShiftedDiagram[entries=last]{4,2,1} \qquad
  \ShiftedDiagram[entries=residues, e=2, cartan=DD]{4,2,1}
  \end{Example}

  The definition of hook lengths for shifted diagrams can be found, for
  example, in \cite{Konvalinka:ShiftedHookLengths}.

  % --------------------------------------------------------------
  \subsection{Tabloids}
  \label{S:Tabloid}
  \indexcmd{Tabloid}

  For most authors, a \emph{tabloid} is an equivalence class of
  tableaux, where two tableaux are equivalent if they have the same set
  of entries in each row. In the literature, tabloids are usually drawn
  with lines above and below each row, and without side borders.
  Tabloids can be drawn with the \keyword{\Tabloid} command.

  \keyword{\Tabloid (x,y) [options] {partition }}

  The \keyword{\Tabloid} command functions in the same way as the
  \keyword{\Tableau} command, except that it draws tabloids. In fact,
  the \keyword{\Tabloid} is a special case of the \keyword{\Tableau}
  command with the \option{tabloid} option set.

  \begin{example}{tabloid}
  \tikzset{R/.style={fill=red!20,circle,minimum size=5mm}}
  \Tabloid[russian]{12[R]3,45}\quad
  \Tabloid[english]{1[R]2,34}\quad
  \Tabloid[french] {12[R]3,45}
  \end{example}

  The \aTableau package does not provide a dedicated command for tabloid
  diagrams, however, they can be drawn using the \keyword{\Diagram}
  command together with the \option{tabloid} option:

  \begin{example}{tabloidFrench}
  \Diagram[tabloid]{3^2,1} \qquad
  \Diagram[tabloid, french]{3,1^2}
  \end{example}

  Some authors work with \emph{column tabloids}. Such tableaux do not
  have a dedicated \aTableau command, however, they can be drawn using the
  \option{conjugate} option:  \index{tabloid!column}

  \begin{example}{tabloidConjugate}
  \Tabloid[conjugate]{123,4} \qquad
  \Diagram[conjugate, tabloid]{3,1} \qquad
  \end{example}

  Similarly, skew tabloids and shifted tabloids can be drawn using the
  \option{skew} and \option{shifted} options.
  \label{tabloids!skew}

  \begin{example}{tabloidSkew}
  \Tabloid[skew={2,1}]{19{11},29{10},6} \qquad
  \Tabloid[conjugate, shifted]{19{11}7,29{10},6}
  \end{example}


  % --------------------------------------------------------------
  \subsection{Ribbon tableaux}\label{S:RibbonTableaux}
  \indexcmd{RibbonTableau}
  \index{ribbon!head}
  \index{tableau!ribbon tableau}

  A \emph{ribbon} in a tableau, or a diagram, is a connected strip of
  boxes~$R$ that are totally ordered by their contents. (Recall from
  \autoref{SS:entries} that the content of the box in row~$a$ and
  column~$b$ is~$b-a$.) In particular, a ribbon does not contain a
  \Diagram[scale=0.3, border=false, align=bottom]{2^2}-square, and if
  $(a,b)\in R$ then at most one of $(a+1,b)$ and $(a,b-1)$ belongs
  to~$R$.  The \emph{head} of a ribbon~$R$ is the unique node of maximal
  content.  A \emph{ribbon tableau} is a tableau that is tiled by
  ribbons. A box is a ribbon of length~$1$, so every tableau is a ribbon
  tableau.

  Ribbon tableaux can be drawn with the command:

  \keyword{\RibbonTableau (x,y) [options] {ribbon specifications}}

  Like the other \aTableau commands, the $(x,y)$-coordinates are
  optional and are required if, and only if, the diagram is part of a
  \keyword{tikzpicture} environment. All of the keys for the
  \keyword{\Tableau} command can be used with \keyword{\RibbonTableau}, so we
  refer to \autoref{S:Tableau} for a description of the available
  keys.

  % --------------------------------------------------------------
  \subsubsection{Ribbon specifications}
  Unlike the \keyword{\Tableau} command, the entries of a ribbon tableau
  are given by ribbon specifications, rather than tableau
  specifications. Ribbon specifications are also used by the three keys
  \option{paths}, \option{ribbons}, and \option{snobs}, which were
  introduced in \autoref{SS:TableauOptions}.

  To understand the ribbon specifications, observe that if $(a,b)$ is
  the head of a ribbon, which is the unique node of maximal content,
  then we can walk along the ribbon by specifying whether the
  \textsf{r}ow index increases, or the \textsf{c}olumn index decreases.
  That is, a ribbon is uniquely determined by specifying its head
  $(a,b)$ together with a sequence of $\textsf{r}$'s and \textsf{c}'s to
  indicate when the row index increases, or the column index decreases,
  respectively. For example, vertical and horizontal ribbons are given
  by a sequence of \textsf{r}'s and \textsf{c}'s, respectively:

  \begin{example}{ribbon}
  \aTabset{align=top, no border}
  \RibbonTableau{11rrrr} \qquad
  \RibbonTableau{16ccccc}
  \end{example}

  By default, the border of a ribbon tableau is the smallest (skew)
  partition that contains all of its ribbons (it is also possible to set
  the border with the \option{shape} key). In the last example, the
  \option{no border} key is used to disable the ribbon tableau border to
  highlight the ribbon, because in these examples the ribbon and tableaux
  borders coincide.

  The following diagram shows a see-sawing ribbon with head in row~$1$
  and column~10, and tail in row~$5$ and column~$1$.

  \begin{example}{RibbonTableau}
  \RibbonTableau{1{10}crcrcrcrccccc}
  \end{example}

  Like tableau entries, each box in a ribbon can be preceded with a
  style specification, either using \keyword{*}, for the
  \option{tableau star}, or using \keyword{[...]}, for customised style
  specifications. Here is a more complicated example:

  \begin{example}{ribbonStarred}
  \RibbonTableau{
      *1{10}c*rc*rc*rc*rc*cc*cc,
      *18c[fill=red]rc[fill=blue]rc*rc*cc[fill=teal]c,
      [fill=green]16c*rc*rc*cc,
      *14c[draw=purple,ultra thick]cc[fill=orange]r,
      [fill=yellow,draw=red,ultra thick]23
  }
  \end{example}

  This ribbon tableau is built from five ribbons, each of which is given
  on a separate line inside the \keyword{\RibbonTableau} command. Except
  for the last ribbon, all of these ribbons start in row one. The yellow
  box is drawn by the last ribbon, which consists of a single box in row
  $2$ and column~$3$.

  Often you want to style the entire ribbon, instead of styling
  the individual boxes in the ribbon. The (optional) style for an
  entire ribbon is given inside parentheses $(...)$ at the
  \textit{beginning} of the ribbon specification. The ribbons in the
  last example are much easier to see if we add some \keyword{(...)}-styling:

  \begin{example}{ribbonFilled}
  \RibbonTableau{
      (fill=red)1{10}crcrcrcrccc_Ccc,
      (fill=orange)18crcrc*rcc_Bcc,
      (fill=yellow)16crcr[fill=cyan]c_Acc,
      (fill=green)14cccr,
      (fill=blue)23
  }
  \end{example}

  Unlike the other style specifications, the $*$-shorthand for the
  \option{tableau star} cannot be applied to an entire ribbon.

  The \keyword{(...)}-style of a ribbon is applied to the region bounded
  by the closed path given by the border of the ribbon and to each box
  in the ribbon. The ribbon style is applied first, after which any
  boxes in the ribbon are drawn.  As the orange and yellow ribbons in
  the example illustrate, the style of an individual box in the ribbon
  takes precedence over the \keyword{(...)}-style of the entire ribbon.

  It is often useful to label some of the boxes in a ribbon, which can
  be done by specifying the content of a box as a \textit{subscript} of
  the corresponding entry in the ribbon specification:

  \begin{example}{ribbonTableauFrench}
  \RibbonTableau[french]    { 12_1 c_2 r_3 } \quad
  \RibbonTableau[russian] { 12_a c_b r_c } \quad
  \RibbonTableau[australian]{ 12_{1_a} c_{2_b} r_{3_c} }
  \end{example}

  Here we have put spaces between the entries for the different boxes
  in the ribbon for clarity. There are often many ways to draw the same
  ribbon tableau:

  \begin{example}{ribbonTableauStyle}
  \tikzset{Fill/.style={fill=#1!20!white},
    B/.style={Fill=blue}, R/.style={Fill=red}, Y/.style={Fill=yellow}}
  \RibbonTableau{ [B]12_1  [R]c_2   [Y]r_3} \qquad
  \RibbonTableau{ [B]12_1, [R]11_2, [Y]21_3 } \qquad
  \Tableau{       [B]2     [R]1,    [Y]3 }
  \end{example}

  As shown, the easiest way to draw this particular tableau is using the \keyword{\Tableau} command.

  There is no dedicated syntax for putting a label on the boundary
  between two boxes in a diagram, but this can be done using the named
  coordinates of~\autoref{E:NodeNames}.

  \begin{example}{ribbonTableauLabel}
  \RibbonTableau[shifted, tikz after={
      \node at (A-1-2.east){$1$};
      \node at (A-2-2.east){$2$};
  }]{ 14c, 12c, 23c }
  \end{example}

  Here is an example of a $3$-ribbon skew tableau, which is a skew tableau
  that is tiled by ribbons of length~$3$.

  \begin{example}{ribbonTableauSkew}
  \RibbonTableau[skew={2^2,1^2}, skew border]{
     14c_0r,15r_1c, 18c_7c,26r_9r,
     34c_2c,35r_8r,42r_3c, 44c_4r,
     54r_6c,62c_5r
  }
  \end{example}

  The ribbon specifications described already are sufficient for drawing
  arbitrary ribbons. To allow more general regions to be drawn inside
  diagrams and tableaux, the ribbon specifications also accept
  \textsf{R}'s' and~\textsf{C}'s, which \textit{decrease the row index} and
  \textit{increase the column index}, respectively. That is, when using
  the English convention, the ribbon specifications \textsf{c}, \textsf{C},
  \textsf{r} and \textsf{R} move the (generalised) ribbon in the following directions:

  \begin{center}
  \Diagram[styles={A={thick,red,->},L={text=aTableauMain}},
    scale=1.5,
    tikz after={
      \draw[A](A-1-1)--+(-0.8,0)node[L,left=0.1]{$c$};
      \draw[A](A-1-1)--+(0.8,0)node[L,right=0.1]{$C$};
      \draw[A](A-1-1)--+(0,0.8)node[L,above=0.1]{$R$};
      \draw[A](A-1-1)--+(0,-0.8)node[L,below=0.1]{$r$};
  }]{1}
  \end{center}

  Using this enhanced syntax, it is possible, for example, to draw fancy
  pictures like the following:

  \begin{Example}{ribbonEnhanced}
  \RibbonTableau[shape=5^5]{23rcCrRC}  \quad\RibbonTableau[shape=5^5]{24rrccRRCr}\quad
  \RibbonTableau[shape=5^5]{24rrccRRCC}\quad\RibbonTableau[shape=7^5]{23crrCCCCRRccr}
  \end{Example}

  Topologically, the boundary of a generalised ribbon is a union of (oriented) circles.

  We have now seen the full ribbon specifications. To summarise:
  \begin{itemize}[nosep]
    \item The ribbon specification starts with optional \TikZ-styling
    for the ribbon (or path), enclosed in~\keyword{(...)}.
    \item The first entry in the ribbon is given as
    \textsf{a}\textsf{b} if the head of the ribbon is in row \textsf{a}
    and column \textsf{b}. (Enclose \textsf{a} and \textsf{b} in braces,
    \keyword{{a}} and \keyword{{b}}, whenever they are  greater than
    $9$, or less than $0$.)
    \item The remaining
    entries in the ribbon are specified by a sequence of \textsf{r}'s, \textsf{R}'s,
    \textsf{c}'s and \textsf{C}'s, where:
    \begin{itemize}[nosep]
      \item\textsf{c} decreases the column index by $1$
      \item\textsf{r} increases the row index by $1$
      \item\textsf{C} increases the column index by $1$.
      \item\textsf{R} decreases the row index by $1$
    \end{itemize}
    \item Each box in the ribbon, including the head, can be given
    \TikZ-styling by prefixing it with a~$*$, which gives the box the
    current \option{tableau star}, or by putting \TikZ-styling keys
    inside square brackets~\keyword{[...]}.
    \item Add an entry to a box in the ribbon by adding it as a
    subscript, \textunderscore\texttt{\{entry\}}, to the corresponding
    ribbon specification for the box.
  \end{itemize}

  When drawing the tableau border, all ribbons in a
  \keyword{\RibbonTableau} are assumed to be contained in the smallest
  Young diagram that contains the ribbons. That said, it is up to you to
  ensure that the boxes in the ribbon are contained inside a tableau.
  Inside a \keyword{\Diagram} or \keyword{\Tableau} command,
  any ribbons added using \option{paths}, \option{ribbons}, or
  \option{snobs} do not affect the border of the diagram or tableau. You
  can draw paths, ribbons, and snobs so that their boxes are either
  inside or outside the border of the diagram or tableau. As shown
  below, this allows you to place boxes outside of the tableau. You can
  also specify the shape of the ribbon tableau using the \option{shape}
  key.

  \option[]{paths=ribbon specifications}[comma-separated ribbon specifications]<ribbons>
  \option*[]{ribbons=ribbon specifications}[comma-separated ribbon specifications]<ribbons>
  \option*[]{snobs=ribbon specifications}[comma-separated ribbon specifications]<ribbons>

  You can add \option{ribbons}<ribbons>, \option{paths}<ribbons> and
  \option{snobs}<ribbons> to a \keyword{\RibbonTableau} in exactly the
  same way that you add them to \keyword{\Tableau}. At first sight, it
  seems unnecessary to add \option{ribbons}<ribbons> and
  \option{snobs}<ribbons> because ribbon tableaux are composed of
  ribbons. The point is that any ribbons added to a tableau using
  \option{ribbons}<ribbons> or \option{snobs}<ribbons> are not required
  to be inside the border of the tableau --- and
  \option{snobs}<ribbons> are added last.

  \begin{example}{ribbonTableaStyled}
  \RibbonTableau[
    styles={A={fill=green!10, text=teal}, R={fill=yellow!10, text=red}},
    ribbons={[A]15_A,[A]24_A,[A]41_A, [R]14_R,[R]33_R}
  ]{11, (fill=blue!10)12rc, 14crrcc}
  \end{example}

  Here is a cute use of \option{paths} to add arrows to a skew
  $2$-ribbon tableau:

  \begin{example}[lefthand width=0.35\textwidth]{ribbonTableauCute}
  \RibbonTableau[skew={4,3,2,1},
    styles={L={red,semithick,->}, R={red,semithick,<-}},
    paths ={ (L)15c, (L)17c, (L)24c, (L)26c,
             (R)32r,(R)41r,(R)52r,(R)61r, (R)34c},
    tikz after = { % node labels: row/col/label
      \foreach \r/\c/\l in {1/6/0,1/8/6,2/5/3,2/7/8}
        { \node at (A-\r-\c.west){\l};}
      \foreach \r/\c/\l in {5/1/1,4/2/2,3/3/5,7/1/4,6/2/7}
        { \node at (A-\r-\c.south){\l};}
    }
  ]{ 16c,18c, 25c, 27c, 33r, 42r, 51r, 62r,71r }
  \end{example}

  The arrows are added by the \option{paths} key using the two styles
  \textsf{L} and \textsf{R}, which draw ``left'' and ``right'' arrows
  between the two boxes, where left and right is with respect to the
  line-order of the two boxes in the corresponding draw command.  The
  two \keyword{\foreach}-statements might look complicated, but they are
  just loops that add the entries to the tableau. These loops set
  \keyword{\r}, \keyword{\c} and \keyword{\l} equal to the row index,
  column index and label, respectively, using the two lists of
  \keyword{\r}\!/\!\keyword{\c}\!/\!\keyword{\l} triples given above.
  For any given triple (\keyword{\r},\keyword{\c},\keyword{\l}), the
  label is drawn using the TikZ command
  \keyword{\node at (A-\r-\c.south){\l}}, which is placed using the named
  coordinate \keywords{(A-\r-\c)}.

  \option[draw=\aTableauColour{Inner}, thin]{ribbon style=style}[\TikZ-styling]
  \option*[]{ribbon box style=style}[\TikZ-styling]

  Use the \option{ribbon style} and \option{ribbon box} keys to
  append to the default styling of the ribbons, and the boxes in the
  ribbons, respectively. By default, the full ribbon has inner wall
  styling, but the boxes in ribbons have no styling. If you want inner
  walls, then they can be added using the \option{ribbon box style} key.

  \begin{example}{ribbonTableauRibbon}
  \RibbonTableau[ribbon style={draw=red, thick,
    fill=orange!20}]{13_1r_2c_6r_7c_8} \qquad
  \RibbonTableau[ribbon box style={fill=orange!20,
    draw=magenta}]{13_1r_2c_6r_7c_8}
  \end{example}

  Ribbons are drawn by first drawing the full ribbon, applying
  \option{ribbon style}, then the empty boxes in the ribbon are drawn,
  and, finally, any boxes in the ribbon that have styling or an entry
  are added. In particular, if the style \option{ribbon box} draws an
  outline around a box then this has precedence over any outline added
  by \option{ribbon style} since \option{ribbon box} is applied last.

  \option[]{ribbon box=text}[default box contents]

  You can add content to the boxes in a ribbon using subscripts in
  the ribbon specifications. Alternatively, you can use
  \option{ribbon box} if you want to add the same
  content to each box in the ribbon.

  \begin{example}{ribbonBox}
  \RibbonTableau[ribbon box=\times]{14rccrc}\qquad
  \RibbonTableau[ribbon box=\bullet]{14_1rc_2cr_3c}
  \end{example}

  As shown, whenever a box entry is given as a subscript it is used
  instead of the value of \option{ribbon box}. If a ribbon tableau
  contains multiple ribbons, then the same value of \option{ribbon box}
  is used for all ribbons.

  Similarly, there are keys \option{path style}, \option{path box},
  \option{path box style}, \option{snob style}, \option{snob box} and
  \option{snob box style} that work in exactly the same way. Most of the
  \keyword{\Tableau} keys work as expected for ribbon tableaux.


  \option[]{shape=partition}[a partition]

  By default, the border of a ribbon tableau is automatically computed
  to be the smallest partition that contains all of the ribbons. Use the
  \option{shape} key to directly set the border of the ribbon tableau.
  The partition \option{shape} can be given either as a comma
  separated list of using exponential notation.

  \begin{example}{RibbonShape}
  \RibbonTableau[shape={8^2,6^2}]{26crcc}
  \end{example}

  This picture could also be drawn using \keyword{\Diagram[ribbons={26crcc}]{8^2,6^2}}.

  % --------------------------------------------------------------
  \subsection{Multidiagrams and multitableaux}\label{S:Multitableau}
  \indexcmd{Multidiagram}
  \indexcmd{Multitableau}
  \index{diagram!multidiagram}
  \index{tableau!multitableau}

  Multitableaux and multidiagrams are $\ell$-tuples of tableaux and
  diagrams, respectively, for $\ell\ge1$. Such diagrams are ubiquitous
  in representation theory, such as when considering representations of
  wreath products or cyclotomic Hecke algebras. For convenience,
  \aTableau provides the \keyword{\Multidiagram} and
  \keyword{\Multitableau} commands for drawing these diagrams.

  \keyword{\Multidiagram (x,y) [options] {multipartition specifications} }\newline
  \keyword{\Multitableau (x,y) [options] {multitableau specifications}   }

  \index{components}
  \index{multidiagram!components}
  \index{multitableau!components}
  Our preferred notation is to write the multipartition $\blam$ as
  $\blam=(\lambda^{(1)}|\lambda^{(2)}|\dots|\lambda^{(\ell)})$, where
  $\ell\ge1$ is the \emph{level} and the partitions
  $\lambda^{(1)},\dots,\lambda^{(\ell)}$ are the \emph{components}
  of~$\blam$. Similarly, a multitableau is written as
  $\T=(\T^{(1)}|\dots|\T^{(\ell)})$, where the tableaux
  $\T^{(1)},\dots,\T^{(\ell)}$ are the \emph{components} of~$\T$.
  Accordingly, in the \keyword{\Multidiagram} and
  \keyword{\Multitableau} commands, the pipe symbol \keyword{|} is used
  to separate components:

  \begin{example}{multi}
  \aTabset{scale=0.7}
  \Multidiagram{3,2^2|2,1,1|1}  \smallskip
  \Multitableau[box font=\tiny]
    { 123,45,67 | 89,{10},{11} | {12}{13}{14} }
  \end{example}

  As shown, the \keyword{\Multidiagram} command accepts exponential
  notation for multipartitions. Styling can be added to the entries in
  a \keyword{\Multitableau} in exactly the same way that style
  is added when using the \keyword{\Tableau} command.

  \begin{example}{multiStar}
  \tikzset{R/.style={fill=red!10,text=magenta}}
  \Multitableau{1*24,*68 | [R]9{10},{11}}
  \end{example}

  Multitableaux and multidiagrams can, in principle, have arbitrary
  level. In practice, the level is constrained by the page width.

  \begin{example}{multiFrench}
  \Multitableau[french]{1,2 | 3,4 | 5,6 | 7,8 | 9,{10}}
  \end{example}

  Both the \keyword{\Multitableau} and \keyword{\Multidiagram} commands
  accept a special component, \keyword{...}, that is used to add dots between the
  separators:

  \begin{example}{multiBoxFont}
  \aTabset{scale=0.7}
  \Multidiagram{3,2^2|...|1}
  \Multitableau[box font=\tiny]
    {123,45,67 | ... | {12}{13}{14}}
  \end{example}

  \bigskip

  The \keyword{\Multitableau} and \keyword{\Multidiagram} commands
  accept most of the options of the \keyword{\Tableau} and
  \keyword{\Diagram} commands, together with a few options that are
  specific to multitableaux and multidiagrams.  This section describes
  the new options, and highlights how some of the other options are
  used.  In many cases, the values of multitableaux and
  multidiagrams keys can be separated by the pipe symbol \keyword{|} to
  give the corresponding key values for the component tableaux and
  diagrams.

  \option[-]{english}<multitableau>
  \option*[]{french}<multitableau>
  \option*[]{russian}<multitableau>
  \option*[]{australian}<multitableau>

  All four tableau conventions are supported for multitableaux and
  multidiagrams, with the caveat that all component diagrams must use
  the same convention.

  \begin{example}{multiFrenchBoxFont}
  \aTabset{scale=0.7}
  \Multidiagram[french]{3,2^2|...|1}
  \Multitableau[russian, box font=\tiny]
    {123,45,67 | ... | {12}{13}{14}}
  \end{example}

  \option[]{conjugate}<multitableau>
  \index{conjugate!multidiagram}
  \index{conjugate!multitableau}
  \index{multidiagram!conjugate}
  \index{multitableau!conjugate}

  The \option{conjugate} option prints the conjugate multitableaux and
  multidiagrams. Conjugation for multitableaux and multidiagrams reverses
  the order of the components and then conjugates the component
  diagrams.

  \begin{example}{multiConjugate}
  \aTabset{scale=0.6, box font=\scriptsize}
  \Multitableau[conjugate]{ 123,45 | 67,89} \quad
  \Multidiagram[conjugate]{ 3,2 | 1^2 }
  \end{example}

  \option[()]{delimiters}[pair of \LaTeX{} delimiters]
  \option*[(]{left delimiter}[a \LaTeX{} delimiter]
  \option*[)]{right delimiter}[a \LaTeX{} delimiter]

  The delimiter options control the delimiters that are put on the left
  and right of multitableaux and multidiagrams. These options accept any
  \LaTeX{} delimiter.

  \begin{example}{multiDelimiter}
  \aTabset{scale=0.7}
  \Multidiagram[left delimiter=\langle,
      right delimiter={]}]{2,1|1} \quad
  \Multidiagram[delimiters={\|}{\}} ]{1^2|2}
  \end{example}

  To remove a delimiter, set \option{left delimiter} or
  \option{right delimiter} to nothing.

  \begin{example}{multiDelimiters}
  \Multitableau[left delimiter=, right delimiter=]
    {123,45,67|{12}{14}}
  \end{example}

  See also the \option{no separators} key.

  \option[]{dotted cols=|-separated column indices}[$|$ and comma-separated list of columns]<multitableau>
  \option*[]{dotted rows=|-separated row indices}[$|$ and comma-separated list of rows]<multitableau>

  Dotted rows and columns for multidiagrams (and multitableaux) can be
  added using $|$-separated lists of row and column indices in each
  component. This makes it possible to draw multidiagrams,
  where the number of rows and columns are not specified completely.

  \begin{example}{multiDottedRows}
  \Multidiagram[scale=0.9,
    dotted rows=2||2, dotted cols=||2
  ]{ 3,2^2 | | 4,3^2 }
  \end{example}

  The \option{dotted rows} and \option{dotted cols} keys for
  multidiagrams work in exactly the same way as they do for diagrams.

  \option[$-$]{empty}[any \LaTeX{}]

  The \option{empty} option determines what is printed when a component
  diagram is empty. By default, a minus sign~$-$ is used.

  \begin{example}{multiEmpty}
  \Multitableau{ 123,45 | | 67,89} \par
  \Multidiagram[empty=\emptyset]{ 3,2 | | 2^2 }
  \end{example}

  The \option{empty} key is printed in mathematics-mode (or text mode if
  \option{text boxes} is true). To add text for empty components, use
  \option{empty=\textbackslash text\{...\}}, or equivalent if you are
  not using \ctan{amsmath}.

  \option[]{entries=value}[columns, contents, first, hooks, last, residues, rows]<multitableau>
  \option*[]{charge=offsets}[$|$-separated list of charges]<multitableau>

  \index{contents}
  \index{residues}
  \index{contents!multitableau}
  \index{first tableau!multitableau}
  \index{hooks!multitableau}
  \index{last tableau!multitableau}
  \index{residues!multitableau}
  \index{entries!multitableau}
  \index{multidiagram!show}
  \index{multitableau!contents}
  \index{multitableau!first}
  \index{multitableau!hooks}
  \index{multitableau!last}
  \index{multitableau!residue}

  The \option{entries} key automatically adds particular types of
  entries to a tableau of the specified shape.  Use \option{charge} to
  provide offsets in each component when using \option{entries=contents}
  and \option{entries=residues} {(}the \option{charge} is ignored by other
  values for \option{entries}).

  \nopagebreak[0]
  The possible choices are:
  \begin{itemize}

    \item\option{entries=columns}: Prints the tableau that has each box
      labelled by its column index in each component.

  \begin{example}{multiEntriesColumns}
  \Multidiagram[entries=columns]{3,1^2|2^2,1}
  \end{example}

  Use \option{charge}, with a $|$-separated list of entries, to
  offset the column indices in each component.

  \begin{example}{multiEntriesChargedColumns}
  \Multidiagram[entries=columns, charge=0|3]{3,1^2|2^2,1}
  \end{example}

    \item\option{entries=contents}: Prints the tableau where each box is
    labelled by its \emph{content}, which is the row index minus the
    column index.

    \begin{example}{multiEntriesContents}
  \Multidiagram[entries=contents, charge=0|2]
    {3,2,1|2^2}
  \end{example}

    As shown, the \option{charge} offsets the contents in each
    \textit{component}. Use \keyword{|} to separate the charges for the
    different components.

    \item\option{entries=first}: Prints the \emph{first} \textbf{standard} tableau of this
    shape, which has the numbers $1,2\dots,n$ entered in order along the
    rows, working left to right along components, and then reading the
    rows top to bottom in each component, and left to right along each
    row.

  \begin{example}{multiEntriesFirst}
  \Multidiagram[entries=first]{3,1^2|2^2,1}
  \end{example}

    \item\option{entries=last}: Prints the \emph{last} \textbf{standard}
    tableau of this shape, which has the numbers $1,2\dots,n$ entered in
    order down the columns, working right to left along components, and
    then reading the columns left to right in each component, and top to
    bottom down each column.

    \begin{example}{multiEntriesLast}
  \Multidiagram[entries=last]{3,2,2|2^2}
  \end{example}

    \item\option{entries=hooks}: Prints the diagram where each box in each
    component is labelled by the corresponding \emph{hook length}.

    \begin{example}{multiEntriesHooks}
  \Multidiagram[entries=hooks]{3,1^2|3^3}
  \end{example}

    \item\option{entries=residues}: Prints the diagram where each box is
    labelled by its \emph{residue}, which is the row index minus the
    column index modulo some integer~$e$, which must also be supplied.

    \index{residues}
    \index{tableau!residues}
  \begin{example}{multiEntriesResidues}
  \Multidiagram[entries=residues, e=2]{3,2,1|1^3}
  \end{example}

    \item\option{entries=rows}: Prints the tableau in which each box is
      replaced by its row index in each component. As with
      \option{entries=columns}, use \option{charge} with a $|$-separated
      list entries to offset the row indices in each component.

  \begin{example}{multiEntriesRows}
  \Multidiagram[entries=rows]{3,1^2|2^2,1}
  \end{example}

  Specifying the \option{charge} offsets the residues in each component.

  \begin{example}{multiEntriesCharge}
  \Multidiagram[french, entries=residues, e=3,
    charge=1|2]{3,2,1|1^2}
  \end{example}

  \medskip\noindent
  As in \autoref{SS:entries}, residues for the other affine Cartan types
  can be specified using \option{cartan=value}.

  \end{itemize}

  \option[]{label=labels}[a $|$-separated list of labels]
  \index{multidiagram!label}

  Use \option{label} to add labels to the component diagrams.

  \begin{example}{multiLabels}
  \Multitableau[label=1|2]{123,45,67|{12}{14}}
  \end{example}

  No extra space is allowed for the labels. Use the
  \option{separation} key, or \option{xoffsets} and \option{yoffsets},
  to adjust for wide labels.

  \option[A]{name=text}[a character]<multi>

  The \option{name} option is used to change the default prefix for the
  box named coordinates. In a tableau, or diagram, the box names depend on the
  \emph{row} and \emph{column} indices. In a multitableau, or
  multidiagram, the box names depend on the \emph{component}, \emph{row}
  and \emph{column} indices. Explicitly, by default, in multitableaux
  and multidiagrams the box names take the form \textsf{A-k-r-c},
  where~\textsf{k} is the component index,~\textsf{r} is the row index,
  and~\textsf{c} is the column index of the box%
  \footnote{This follows the convention for nodes in multidiagrams
  from~\cite{EvseevMathas:DeformedKLR}, rather than the somewhat misguided
  convention that the author introduced in~\cite{DJM:cyc}.}.
  The prefix \textsf{A} can be changed using the \option{name} key.

  \begin{example}{multiName}
  \Multitableau[name=C, tikz after = {
    \draw[red, thick,<->](C-1-2-2.south east) to
         [out=315,in=225] (C-2-2-1.south west);
    }] { 123,4*5 | 67,*89}
  \end{example}

  \option[]{paths=ribbon specifications}[a $|$-separated list of ribbon specifications]<multi>
  \option*[]{ribbons=ribbon specifications}[a $|$-separated list of ribbon specifications]<multi>
  \option*[]{snobs=ribbon specifications}[a $|$-separated list of ribbon specifications]<multi>

  The \option{paths}<multi>, \option{ribbons}<multi>,  and
  \option{snobs}<multi> keys work in exactly the same way for
  multitableaux and multidiagrams as they do for tableaux and diagrams,
  except that the ribbons for different components are separated by the
  pipe symbol~$|$.

  \begin{example}{multiRibbons}
  \Multitableau[ribbons={(R)11*r | (Y)12rc},
    styles={R={fill=red!10, opacity=0.2},
            Y={fill=yellow!20, opacity=0.2}
  }] { 123,45 | 67,89}
  \end{example}

  \option[]{rows=number}[a decimal number]

  The \option{rows} option sets the number of rows covered by the
  delimiters in multitableaux and multidiagrams.  By default, the
  \keyword{\Multitableau} and \keyword{\Multidiagram} set
  the size of the delimiters so that they match the component diagrams, which may
  not be what you want, especially when using the \option{australian} and
  \option{russian} conventions. The value of \option{rows} can be a
  decimal number.

  \begin{example}{multiScale}
  \Multidiagram[russian, scale=0.5]{3,2^2|...|2,1^2}
  \end{example}

  \begin{example}{multiRows}
  \Multitableau[rows=3, scale=0.8, box font=\tiny]
       { {1_1}{1_1}{1_1}{2_1},{2_1}{2_1}{2_1} |
         {1_2}{3_3},{2_2}                     |
         {1_3}{1_3},{2_3}                     }
  \end{example}

  \begin{example}{multiFrenchRows}
    \Multitableau[french,rows=2.5,scale=0.8,box font=\tiny]
    { {1_1}{1_1}{1_1}{2_1},{2_1}{2_1}{2_1} |
      {1_2}{3_3},{2_2}                     |
      {1_3}{1_3},{2_3}                     }
  \end{example}

  \option[true]{separators}[true/false]
  \option*[false]{no separators}[false/true]

  When \option{separators} is true, delimiters are drawn around the
  component diagrams in a multitableau and a multidiagram and
  separators are drawn between the component shapes. The
  \option{no separators} key is the inverse option. By default, both
  separators and delimiters are drawn.

  \begin{example}{multiNoSeparators}
  \Multitableau[separators, scale=0.8]
    {123,45,67 | 89,{10}{11}}  \par
  \Multidiagram[no separators, scale=0.7]
    {3,2^2|2,1^2} \par
  \end{example}

  \option[$|$]{separator=text}[character]

  The \option{separator} determines what is printed between the
  component diagrams in multitableaux and multipartitions. By default,
  \option{separator=$|$}, which draws a straight line between the
  components, but any character can be used.

  \begin{example}{multiSeparators}
  \Multitableau[separator={,}]{ 123,45 | 67,89} \par
  \Multidiagram[separator=:]{ 3,2 | 2^2 }
  \end{example}

  \option[\aTableauColour{Main}]{separator colour=colour}[a \LaTeX{} colour]

  The \option{separator colour} sets the colour of the delimiters and
  the separator between component diagrams. By default, the separators
  are the same colour as the diagram border.

  \begin{example}{mutitabColouredSeps}
  \Multitableau[separator colour=red]{123,45 | 67,89} \par
  \Multidiagram[separator color=brown, separator=:]
    {3,2 | 2^2 }
  \end{example}

  \option[0.3]{separation=number}[a decimal number (the distance in \unit{cm})]

  The \option{separation} key sets the distance between the separators
  and the component tableaux and diagrams.

  \begin{example}{mutitabSmallSep}
  \Multitableau[separation=0.1]{123,45 | 67,89} \par
  \Multidiagram[separation=0.8]{3,2 | 2^2}
  \end{example}

  \option[]{shifted}[true/false]

  Use the \option{shifted} key to draw shifted multitableaux and multidiagrams.

  \begin{example}{multiShifted}
  \Multitableau[shifted]{ 1236,45 | 7{10}{11},89} \par
  \Multidiagram[shifted]{ 3,2 | 3,1 }

  \end{example}

  \option[]{skew=partitions}[a $|$-separated list of partitions]<multitableau>
  \option*[]{cover=partitions}[a $|$-separated list of partitions]<multitableau>

  Skew multishapes can be drawn using the \option{skew} option to
  specify a $|$-separated list of inner shapes.

  \begin{example}{multiSkew}
  \Multitableau[skew={2,1|1}]{ 123,45 | 7{10},89} \par
  \Multidiagram[skew={1|2,1}, skew boxes]{ 3,2 | 2^2 }
  \end{example}

  In the same way, use the \option{skew} key to draw multitableaux and
  multidiagrams with components that are a mixture of non-skew, skew and
  shifted shapes, and use \option{cover} for covering partitions.

  \begin{example}{multiSkewCover}
  \Multitableau[cover={3^3|4,3,2}]{123,45|67,89,{10}} \par
  \Multidiagram[skew={|0,1}, cover={|4,3}]{ 3,2 | 3,1 }
  \end{example}

  As this example shows, a covering partition specified by
  \option{cover} is not changed if \option{shifted} or \option{skew}
  are also used.

  \option[true]{tabloid}[true/false]

  Use the \option{tabloid} key for multitabloid diagrams and tableaux.

  \begin{example}{multiTabloid}
  \Multitableau[tabloid]{ 123,45 | 67,89} \par
  \Multidiagram[tabloid]{ 4,2 | 2^2 }
  \end{example}

  \option[0]{xoffsets=offsets}[$|$-separated list of $x$-offsets]
  \option*[0]{yoffsets=offsets}[$|$-separated list of $y$-offsets]

  The \keyword{\Multitableau} and \keyword{\Multidiagram} commands try
  to draw the diagrams as compactly as possible with their first rows
  aligned, and the distance between the separators given by the value of
  \option{separation}. Use \option{xoffsets} to offset the
  $x$-coordinates of the component diagrams and \option{yoffsets} to
  offset their $y$-coordinates.

  \begin{example}{multiOffsets}
  \Multitableau[xoffsets={0.5|0.2}]{ 123,45 | 67,89} \par
  \Multidiagram[yoffsets={0|1.5}]{ 4,2 | 2^2 }
  \end{example}

  When using \option{xoffsets} or \option{yoffsets}, you may want to use
  \option{no separators} to disable the separators between component
  shapes. For example, here is a homogeneous Garnir tableau drawn using
  the style of~\cite{KMR:UniversalSpecht}, where the component tableaux
  are stacked vertically and no separators are used.

  \begin{example}{multiGarnir}
  \Multidiagram[entries=first, no separators,
    xoffsets={0|-1.1}, yoffsets={0|-1},
    styles={O={fill=orange!50}, P={fill=purple!50}},
    snob style={draw=red,double,thick,fill=white},
    snobs={|(O)24_{15}c_{14}, (P)26_{17}c_{16},
            27_{18}, 31_{11}, (P)33_{13}c_{12}}
  ]{1|7^2,4,1}
  \end{example}

  This is a slightly lazy way of drawing this multitableau because
  \option{entries=first} is used to populate most of the tableau
  entries, after which \option{snobs=...} is used to rewrite the
  ``bricks'' in the homogeneous Garnir belt.

  % --------------------------------------------------------------
  \section{Abacuses} \label{S:Abacus} \index{abacus} \indexcmd{Abacus}

  In the representation theory of the symmetric groups, Gordon
  James~\cite{James:YoungD} introduced the abacus, with beads and
  runners, as another way to represent a partition. The abacus is
  particularly useful in modular representation theory, where the number
  of runners is the (quantum) characteristic. Abacus combinatorics is
  now used in the representation theory of many algebras, with their use
  now extending far beyond the symmetric groups.

  The partition corresponding to an abacus is given by counting the
  number of empty bead positions before each bead on the abacus. The
  \keyword{\Abacus} command, which draws an abacus representation of a
  partition, has a similar syntax to the \keyword{\Tableau} and
  \keyword{\Diagram} commands:

  \keyword{\Abacus (x,y) [options] {number of runners} {bead specifications}}

  As with other \aTableau commands, the $(x,y)$-coordinates are
  necessary if, and only if, the abacus is part of a
  \keyword{tikzpicture} environment.  The number of runners is a
  positive integer that specifies the number of runners, or vertical
  lines, in the abacus.

  % --------------------------------------------------------------
  \subsection{Bead specifications}

  In their simplest form, the bead specifications are given as a
  partition, which can be given as a list of non-negative integers
  or by using exponential notation. The full bead specifications allow
  you to add styling and labels to each bead.

  Here are some examples showing basic usage of the \keyword{\Abacus}
  command:

  \begin{Example}{abacus}
  \aTabset{align=top}
  \Abacus{1}{2,1}       \qquad \Abacus{2}{2,1^2,0^3} \qquad \Abacus{3}{2,1^2,0^5} \qquad
  \Abacus{4}{2,1^2,0^5} \qquad \Abacus{5}{2,1^2,0^5} \qquad \Abacus{6}{2,1^2,0^5}
  \end{Example}

  The beads in an abacus correspond to the parts of the partition. Just
  as with the \keyword{\Tableau} command, each of the beads can be given
  optional styling, which can either be given by prepending a
  \keyword{*}, which applies the \option{abacus star}, or by
  giving \TikZ style-keys inside square brackets \keyword{[...]}.
  When exponential notation is used, the styles are applied to all of the
  associated beads.

  \begin{example}{abacusStyled}
  \aTabset{align=top}
  \Abacus{3}{3,*2^3,1}  \qquad
  \Abacus{4}{2,*1,[ball color=red]1^2, *1,
    [ball color=orange]1,[bead=brown]0}
  \end{example}

  In particular, in the right-hand abacus, the two beads corresponding
  to \keyword{1^2} are coloured red, whereas the other three beads that
  correspond to a~$1$ are either orange or an off-white colour, which is
  the default \option{abacus star}. As with the tableau commands,
  we recommend using \keyword{\tikzset} to define more complicated bead styles.

  In addition to applying style to the individual beads on the abacus,
  \emph{labels} for any bead can (optionally) be given as a subscript in the
  bead specifications. Again, the same labels are applied to all of the
  corresponding beads when exponential notation is used.

  \begin{example}{abacusText}
  \Abacus{2}{5_5, 4_4, 3_3, 2_2,0_0} \qquad
  \Abacus[styles={R={ball color=red, text=yellow}}]
    {3}{*5^2_5, [R]4^3_4, 3, 2_2,*0^2_{oo}} \qquad
  \Abacus{4}{8^2_-,7_+,5_a,4^2_b,1_\times^3,1_d}
  \end{example}

  The bead labels are arbitrary, however, anything wider than the bead
  will spill into the abacus. Traditionally, abacus beads are not labelled,
  but you can give labels to as many beads as you like.

  You can remove beads that you have placed on the abacus using the \emph{unshaded} style%
  \footnote{The \emph{unshaded} style disables an existing
  \TikZ-shading on a node. Out of the box, \TikZ \emph{does not} provide
  a way to do this. The \emph{unshaded} style, which is based on a
  \href{https://tex.stackexchange.com/a/85750/234252}{stack exchange post},
  is available whenever the \aTableau package is loaded.}.
  The point of being able to remove beads in this way is that this
  allows you to put something else in this bead position using the bead
  label.  In such cases, you probably want to change the text colour
  because this is white by default.

  \begin{example}{abacusNoShade}
  \Abacus[styles={C={unshaded,text=red}}]
    {5}{8^2_-,7_+,5_a,4^2_b,[C]1_\bullet^3,1_d}
  \end{example}
  \index{unshaded}

  As with tableau boxes, the bead labels are typeset in
  mathematics~mode by default. This can be changed using
  \option{math boxes} and \option{text boxes}.
  \index{math boxes!abacus}
  \index{text boxes!abacus}
  Finally, we note that a more traditional abacus display is drawn when
  the \option{traditional} key is used.

  \begin{example}{abacusBall}
  \Abacus[traditional]{5}
    {8^2_\bullet,7_+,5_a,[ball color=red]4^2_b,1^3,1_d}
  \end{example}

  See \autoref{SS:Traditional} for more details.

  % --------------------------------------------------------------
  \subsection{Abacuses and quotients}\label{SS:quotients}
  \index{quotient}
  \index{beta numbers!quotient}
  \index{abacus!quotient}
  \index{partition!quotient}

  Rather than specifying a partition, or beta numbers, for an abacus it
  is also possible to give a $|$-separated list of partitions, or beta
  numbers, for the corresponding (core and) quotient partition, which
  corresponds to the partitions obtained by reading the beta numbers
  down each runner. The quotients can be given as either partitions, or as beta
  numbers with the \option{beta numbers} key. The syntax is
  exactly the same as described in the previous section except that the
  different components of the quotient are separated by a pipe
  symbol~\keyword{|}. The number of components in the quotient must be less
  than or equal to the number of runners. Any omitted components in
  the quotient are assumed to be empty.

  \begin{example}{abacusBeta}
  \Abacus{4}{1,0||2,1} \qquad
  \Abacus[beta numbers]{4}{[ball color=red]1,0||2,1|1}
  \end{example}

  % --------------------------------------------------------------
  \subsection{Abacus coordinates}\label{SS:abcoordinates}
  \index{xy@$(x,y)$}
  \index{coordinates!abacus}

  The $(x,y)$-coordinates are required if, and only if, the
  \keyword{\Abacus} command is used inside a \keyword{tikzpicture}
  environment, in which case $(x,y)$ gives the coordinates of the
  ``outside corner'' of the bead in row~$0$ and column~$0$ of the abacus
  (unlike tableaux, both the row and column indices start from~$0$). The
  following example demonstrates how abacuses are placed using
  $(x,y)$-coordinates inside a \keyword{tikzpicture} environment. The
  example also shows that, by default, the beads and runners in an
  abacus are half a unit apart.

  \begin{example}{abacusCoords}
  \begin{tikzpicture}[add grid]
    \aTabset{abacus ends=_|, entries=beads}
    \Abacus(0,0) [south]              {3}{2,1^2}
    \Abacus(0,2) [east,  bead=red]    {3}{2,1^2}
    \Abacus(2,-1)[north, bead=orange] {3}{2,1^2}
    \Abacus(3,1) [west,  bead=brown]  {3}{2,1^2}
  \end{tikzpicture}
  \end{example}

  As described below, using \option{entries=beads}<abacus> labels each bead with the corresponding
  \emph{beta number}.

  % --------------------------------------------------------------
  \subsection{Abacus keys}

  The abacus keys, or options, control the general appearance of the
  abacuses drawn by the \keyword{\Abacus} command. Many of the options,
  or keys, for tableaux and diagrams can be applied in exactly the same
  way to abacuses, so we do not discuss all of these options here. For
  example, the \keyword{\Abacus} command accepts the following keys:
  \option{align}, \AddKeyLink{align-abacus}\AddKeyLink{halign-abacus}\AddKeyLink{valign-abacus}
  \option{math boxes}, \AddKeyLink{math boxes-abacus}
  \option{text boxes}, \AddKeyLink{text boxes-abacus}
  \option{name}, \AddKeyLink{name-abacus}
  \option{scale}, \AddKeyLink{scale-abacus}\AddKeyLink{xscale-abacus}\AddKeyLink{yscale-abacus}
  \option{styles}, \AddKeyLink{styles-abacus}
  \option{tikz after}, \AddKeyLink{tikz after-abacus}
  \option{tikz before}, and \AddKeyLink{tikz before-abacus}
  \option{tikzpicture}. \AddKeyLink{tikzpicture-abacus}
  See \autoref{S:keys} for the complete list.

  \option[-]{south}
  \option*[]{east}
  \option*[]{north}
  \option*[]{west}

  Just like tableaux, abacuses have four different conventions.  By
  default, abacuses are drawn with the runners pointing to the south,
  from top to bottom, and runners increasing from left to right. Similar
  to tableaux, we number the rows $0,1,\dots$, and we number the
  runners, or columns, $0,1,\dots,e-1$, from left to right (when using
  \option{south}). If there are $e$ runners, then the bead in row~$r$
  and column~$c$ is in position $er+c$. See \autoref{Ex:abacusBeadPositions}
  for an example.

  Using the keys \option{east}, \option{north} and \option{west},
  abacuses can be drawn so that the row index increases to the east,
  north, and west, respectively.

  \begin{Example}{abacusConventions}
\Abacus[south,entries=beads]{2}{4^2,2,1}\qquad\Abacus[east,entries=beads]{2}{4^2,2,1}\qquad
\Abacus[north,entries=beads]{2}{4^2,2,1}\qquad\Abacus[west,entries=beads]{2}{4^2,2,1}
  \end{Example}

  To make these conventions clearer, we have used
  \option{entries=beads}<abacus> to label the beads in these abacuses by
  their bead positions, or \emph{beta numbers}.

  \option[$-|$]{abacus ends}[any pair of: $-$  \_\!\_  .  *  $|$  \textgreater]
  \option*[very thick, draw=\aTableauColour{Inner}]{abacus ends style=style}[\TikZ-styling]

  The \option{abacus ends} key sets the style of the top and
  bottom of the abacus. The meaning of these six symbols is the
  following:

  \begin{quote}
    \rowcolors{2}{}{LightSkyBlue!10}
    \begin{tabular}{Oll} \toprule
      \multicolumn1l{\textsf{Character}} & \textsf{Symbol} & \textsf{Meaning} \\ \midrule
      $-$    & dash         & Draw a horizontal line that extends slightly past the first and last runners\\
      \_\!\_ & underscore   & Draw a horizontal line between the first and last runners\\
      .      & dot          & Draw dots at the end of the runners\\
      *      & asterisk     & Draw dots and arrows at the end of the runners\\
      $|$    & pipe         & No additional decoration\\
      $>$    & greater than & Draw arrows at the end of the runners\\
      \bottomrule
    \end{tabular}
  \end{quote}

  Exactly two of these styling characters must be given when setting
  \option{abacus ends}. There are six options for the top of the abacus,
  and six options for the bottom, so there are 36 possible
  configurations (most of which will never be used...). We do not list
  all possibilities, but here are some examples.

  \begin{Example}{abacusEnds}
  \aTabset{align=top}
  \Abacus[abacus ends=-|]{3}{2,1^2,0^3}\quad\Abacus[abacus ends=-_]{3}{2,1^2,0^3}\quad
  \Abacus[abacus ends=_.]{3}{2,1^2,0^3}\quad\Abacus[abacus ends=>>]{3}{2,1^2,0^3}\quad
  \Abacus[abacus ends=>|]{3}{2,1^2,0^3}\quad\Abacus[abacus ends=_-]{3}{2,1^2,0^3}\quad
  \Abacus[abacus ends=>-]{3}{2,1^2,0^3}\quad\Abacus[abacus ends=-*]{3}{2,1^2,0^3}
  \end{Example}

 As one more example, \emph{beta numbers} can be displayed on a single,
 horizontal, runner using:

 \begin{example}{abacusEndsEast}
  \Abacus[abacus ends=**, east, rows=7]{1}{2,1^2,*0^2}
  \end{example}

  The \option{abacus ends style} key changes the \TikZ-styling of the
  ends of the abacus. By default, this styling is the same as the
  styling for the abacus runners, which is set using
  \option{runner style}. Changes to \option{runner style} also change
  the style of the abacus ends, but \option{abacus ends style} overrules
  the \option{runner style}.

  \begin{example}{abacusEndsStyle}
  \Abacus[abacus ends style={aTableauMain,
      ultra thick}]{3}{2,1^2,0^3}\qquad
  \Abacus[runner style=cyan]{3}{2,1^2,0^3}\qquad
  \Abacus[abacus ends style=aTableauMain,
      runner style=cyan] {3}{2,1^2,0^3}
  \end{example}

  The \option{traditional} abacus style only supports the $-$
  and~\_\!\_ settings for \option{abacus ends}. There is also a
  \option{framed} key, which works better with the
  \option{traditional} style, that is discussed below.

  \option[ball color=\aTableauColour{Star}, text=\aTableauColour{Main}]{abacus star=style}
     [\TikZ-styling]
  \index{tableau star!abacus star}

  The \option{abacus star} key appends \TikZ-style keys to the
  abacus $*$-style:

  \begin{example}{abacusStar}
  \Abacus{3}{5,*4_a,*1^2,0^4} \qquad
  \Abacus[abacus star={ball color=brown,text=black}]
    {3}{5,*4_b,*1^2,0^4}
  \end{example}

  \option[0.4]{abacus top=number}[a decimal number]
  \option*[0.1]{abacus bottom=number}[a decimal number]

  The \option{abacus top} key sets the distance between the ``top'' of the
  abacus and the first row of beads, and \option{abacus bottom} determines this
  distance at the bottom of the abacus. By default, these distances are set to 0.1
  units. Similarly, \option{abacus bottom} sets the distance between the last
  row of beads and the bottom of the abacus runners. Both of these keys are
  ``fractional'' row indices. That is, they are interpreted as fractional offsets
  to the row index, so decreasing \option{abacus top} raises the line at the
  ``top'' of abacus and increasing \option{abacus top} lowers the line
  at the ``top'' of the abacus.\footnote{Throughout this section, the
  word ``top'' and ``bottom'' are correct when using the \option{south}
  convention for abacuses. For any convention, ``top'' should be
  interpreted as row zero, and ``bottom'' as the row with the largest
  row index. Similarly, ``left'' and ``right'' refer to the minimum and
  maximum column index, respectively.}

  \begin{example}{abacusTop}
  \Abacus[abacus ends=--]{3}{2,1^2,0^3}\qquad
  \Abacus[abacus ends=--, abacus top=0,
    abacus bottom=1]{3}{2,1^2,0^3}
  \end{example}

  \option[\aTableauColour{Main}]{bead=colour}[a \LaTeX\ colour]

  The \option{bead} key sets  the bead colour.

  \begin{example}{abacusBead}
  \Abacus{2}{2^3,1} \qquad
  \Abacus[bead=black]{3}{4^3,2,1} \qquad
  \Abacus[bead=red]{4}{4^3,[ball color=blue]2,1}
  \end{example}

  The \option{bead} key changes the colour of every bead on the
  abacus. As shown, the colour of individual beads can be changed by
  applying the \TikZ-style \keyword{ball color} to the bead.

  \option[\textbackslash small]{bead font=font command}[\LaTeX\ font command]

  The \option{bead font} key sets the font used for the bead labels.
  By default, these labels are typeset as mathematics, so
  this is mainly useful for changing the font size (because, for example
  \keyword{\bfseries $1$} does not make the $1$ bold). It is only when
  you are using \option{text boxes} that font commands like
  \keyword{\itshape} and \keyword{\bfseries} will have any effect.

  \begin{example}{abacusBeadFont}
  \Abacus{3}{3_1,2^2,1^3} \qquad
  \Abacus[bead font=\tiny]{3}{3_2,2^2,1^3} \qquad
  \Abacus[text boxes, bead font=\bfseries]{3}{3_3,2^2,1^3}
  \end{example}

  \option[0.4]{bead size=number}[decimal number, distance in \unit{cm}]
  \option*[0.42]{bead sep=number}[decimal number, distance in \unit{cm}]
  \option*[0.42]{runner sep=number}[decimal number, distance in \unit{cm}]

  These three keys control the size of the beads and the distance
  between them, so they would normally be used together. By default, the
  \emph{diameter} of the abacus beads is \qty{0.4}{cm}, the distance
  between adjacent beads on the same runner is \qty{.42}{cm}, and the
  distance between consecutive runners is \qty{0.42}{cm}.

  \begin{example}{abacusBeadSize}
  \Abacus[bead size=0.6, bead sep=0.65, runner sep=0.65]
    {3}{3_3,2^2,1^3}
  \end{example}

  As with tableaux, you can also change the size of the abacuses using
  \option{scale}<abacus>, \option{xscale}<abacus> and
  \option{yscale}<abacus>. Changing these keys globally affects both
  abacuses and tableaux.

  The default values for all of these settings change when you use the
  \option{traditional} abacus style. In addition, there are
  \option{bead height} and \option{bead width} keys that are used with
  the traditional style.

  \option[]{bead style=style}[\TikZ-styling]

  The keys above are usually sufficient for fine-tuning the style of the
  abacus beads. Alternatively, the \option{bead style} key appends
  \TikZ-styling to the default bead style, which has many moving parts.

  \begin{example}{abacusBeadStyle}
  \Abacus[bead style={shading=axis}, bead text=red] {3}{3_3,2^2,1^3} \qquad
  \Abacus[bead style={unshaded, fill=aTableauMain}] {3}{3_3,2^2,1^3}
  \end{example}

  By default, the beads look like balls (they use the
  \TikZ-styling \keyword{shading=ball, ball color=}\aTableauColour{Main}).
  In contrast, the beads on the left look like go beads, and those
  on the right are flat. The \option{traditional} key provides another way
  to change the abacus style.

  \option[white]{bead text=colour}[a \LaTeX~colour]

  The \option{bead text} key sets the text colour of the abacus labels.

  \begin{example}{abacusBeadText}
  \Abacus[bead=blue, bead text=yellow] {3}{3_3,2^2,1^3}
  \end{example}

  \option[0]{beads=number of beads}[non-negative integer]

  Set the (minimum) number of beads in the abacus. By default, the
  number of beads is equal to the length of the partition, including
  zeros, or the length of the sequence of beta numbers.  You can
  increase the number of beads by adding $0$'s to the end of the
  partition, or by increasing the number of beta numbers.
  Alternatively, you can set the number of beads using \option{beads}.
  When the partition is entered as a quotient, \option{beads} sets the
  minimum number of beads on each runner.

  \begin{example}{abacusBeads}
  \Abacus[beads=15]{3}{4^2,2}\qquad
  \Abacus[beads=4]{4}{3^2|1^3||2,1^2}
  \end{example}

  \option[false]{beta numbers}[false/true]

  When \option{beta numbers} is used, the numbers in the bead
  specifications are entered as \emph{beta numbers}. The beta numbers
  give the bead positions, which are numbered $0,1,\dots$, starting from
  the first row and then continuing in this way in subsequent rows. More
  explicitly, if there are $e$ runners then the bead in row~$r$ and
  column~$c$ is in position $er+c$. Up to shift, bead numbers are first
  column hook lengths. In particular, beta numbers are pairwise
  distinct.

  \begin{example}{abacusBetaNumbers}
  \Abacus{3}{3,2^2} \qquad
  \Abacus[beta numbers]{3}{5,3,2} \qquad
  \Abacus[beta numbers]{3}{6,4,3,[ball color=red]0}
  \end{example}

  There is no inverse key to \option{beta numbers}, however,
  \option{beta numbers=false} will remove the requirement to use beta
  numbers in the bead specifications.

  \option[]{dotted cols=column indices}[list of runner indices]<abacus>
  \option*[]{dotted rows=row indices}[list of row indices]<abacus>

  The \option{dotted rows}<abacus> and \option{dotted cols}<abacus> keys
  draw abacuses where the specified rows and columns are replaced with
  dots. This makes it possible to draw \emph{generic} abacuses, where
  the number of rows and columns is not fully specified. Note that for
  abacuses, both the row and column indexing starts from~$0$.

  \begin{example}{abacusDotted}
  \Abacus[dotted rows={2,4}]{4}{8,5,4,3,2,1} \qquad
  \Abacus[dotted cols={1,3},abacus ends=-*]
    {6}{9,8,5,4,3^3,2}
  \end{example}

  As with tableaux, consecutive rows and columns are merged.

  \begin{example}{abacusDottedRows}
  \Abacus[dotted rows={1,2,3}]{4}{8,5,4,3,2,1} \qquad
  \Abacus[dotted cols={1,2,3},abacus ends=-*]
    {6}{9,8,5,4,3^3,2}
  \end{example}

  Comparing these two examples shows that the beads and runners in the
  dotted rows and columns are removed by \option{dotted rows}<abacus>
  and \option{dotted cols}<abacus>, respectively. Named coordinates,
  for use with \option{name}<abacus>, are not created for the omitted beads and
  ticks.

  The \option{dotted cols}<abacus> and \option{dotted rows}<abacus> keys
  can be used together, in which case the \option{dotted rows}<abacus>
  are removed first, after which the \option{dotted cols}<abacus> are
  removed. The output may need to be adjusted if the dotted rows and
  columns overlap.  For example, consider the abacus:

  \begin{example}{abacusDottedCol}
  \Abacus[dotted cols={2,3}, dotted rows={2,3}]
    {6}{26,21^2,5^2,3,2^2,0^2}
  \end{example}

  The cross-hatched dots in the centre of the abacus are not ideal. The
  following example shows one way of addressing this:

  \begin{example}[lefthand width=0.2\textwidth]{abacusCleared}
  \Abacus[dotted cols={2,3}, dotted rows={2,3},
    tikz after = {
      \draw[aTableau/clearBoxes]
        (A-1-1.south east)rectangle(A-4-4.north west);
      \draw[aTableau/dottedLine](A-1-1.south east)--(A-4-4.north west);
  }]{6}{26,21^2,5^2,3,2^2,0^2}
  \end{example}

  Notice the use of the styles \keyword{aTableau/clearBoxes} and
  \keyword{aTableau/dottedLine} to draw over, or erase, the
  cross-hatched dots and then draw the dotted lines. (The
  \aTableau styles are listed in \autoref{S:TikZStyles}.)

  \option[]{entries=value}[betas, residues, rows, shape]<abacus>

  Like the \option{entries} key for tableaux, the
  \option{entries}<abacus> key for abacuses provides a shortcut for
  labelling the abacus beads by some common choices. The possible
  choices are:

  \begin{itemize}

    \item\option{entries=beads}:\index{entries!beta}\index{beta numbers!entries}
    \label{beta numbers!abacuses}
    Label each bead with the corresponding \emph{beta numbers}, or bead
    positions.
    \begin{example}{abacusEntriesBeads}
  \Abacus[entries=beads]{3}{3,2^2,0^2} \qquad
  \Abacus[entries=beads]{4}{3,2^2,1^3,0^2}
  \end{example}

  \item\option{entries=residues}:\index{entries!residues}
  Label each bead with its residues.
  \begin{example}{abacusEntriesResidues}
  \Abacus[entries=residues,]{3}{3,2^2,0^2} \qquad
  \Abacus[entries=residues, cartan=C]
    {4}{3,2^2,1^3,0^2}
  \end{example}

  \AddKeyLink{e-abacus}
  \AddKeyLink{charge-abacus}
  \AddKeyLink{cartan-abacus}
  \noindent
  As with (multi)tableau, use the \option{charge}<abacus> key to add an
  offset to the residues, and the \option{cartan} key for residues of
  other affine Cartan types.  Unlike for tableaux, it is not necessary
  to specify the quantum characteristic \option{e}<abacus>, because this
  is determined by the number of runners and the \option{cartan}<abacus>
  type. You can override this by setting \option{e}<abacus> manually.

  \item\option{entries=rows}:\index{entries!rows}
  Labels each bead with the row index of the corresponding part in the
  partition.
  \begin{example}{abacusEntriesRows}
  \Abacus[entries=rows]{3}{3,2^2,0^2} \qquad
  \Abacus[entries=rows]{4}{3,2^2,1^3,0^2}
  \end{example}
  \noindent
  As shown, the beads corresponding to zero parts of the corresponding
  partition are marked with a dash, since there is no corresponding row
  in the partition for such beads.

  \item\option{entries=shape}:\index{entries!partition}
  Label each bead with the length of the corresponding row in the
  partition. That is, each bead is labelled by
  the corresponding part of the partition.
  \begin{example}{abacusEntriesShape}
  \Abacus[entries=shape]{3}{3,2^2,0^2} \qquad
  \Abacus[entries=shape]{4}{3,2^2,1^3,0^2}
  \end{example}

  \end{itemize}

  \option[false]{framed}[false/true]

  The \option{framed} key adds a frame around the abacus. This key
  overrides the \option{abacus ends} key.

  \begin{example}{abacusFramed}
  \Abacus[framed]{3}{3,2^2,0^2} \qquad
  \Abacus[framed,traditional]{3}{3,2^2,0^2}
  \end{example}

  Using the \option{framed} key works better with the
  \option{traditional} abacuses, not least because \option{traditional}
  abacuses only support the $\mid$, $-$ and~\_\!\_ settings for
  \option{abacus ends}.

  \option[A]{name=text}[text]<abacus>

  Just like the tableau commands, the \keyword{abacus} command defines
  named coordinates for all of the \emph{beads} and \emph{ticks} on the
  abacus. The key \option{name} changes the prefix used for the \TikZ
  named coordinates. By default, the named coordinates take the form
  $(\mathsf{A{-}r{-}c})$, for the bead or tick in row~$r$ and column~$c$
  of the abacus.

  \begin{warning}
    After \option{name=X}, the bead and tick names take the
    form~$(\mathsf{X{-}r{-}c})$, for the bead or tick in row~\keyword{r}
    and column~\keyword{c}.  For abacuses, both
    \textit{the row and column indexing starts from~$0$}.
  \end{warning}

  \begin{Example}{abacusBeadPositions}
    \Abacus[name=X,
      tikz after={
        \draw[orange,<-,thick] (X-0-0.west) -- ++(-1,0)
            node[blue,align=left,anchor=east] {Empty bead\\ position};
        \draw[red,<-,thick] (X-2-2.east) -- ++(2,0)
            node[blue,align=left,anchor=west] {First part of\\the partition};
    }]{3}{4^3,1^2}
  \end{Example}

  See \autoref{Ex:FayersPutignano} for an example from the literature.

  \option[]{row labels=labels}[comma-separated list of labels for the abacus runners]
  \option*[font=\textbackslash scriptsize, text=\aTableauColour{Inner}]{row label style=style}[\TikZ-styling]

  The \option{row labels} key adds labels at the start of each row,
  starting from row zero. You can add as many or a few row labels as you
  like.

  \begin{example}{abacusRowLabels}
  \Abacus[row labels={0,1,2},
     entries=residues]{3}{3,2^2,0^2} \qquad
  \Abacus[row labels={0,1,2,3}, entries=residues,
    row label style={fill=red}] {4}{5,3,2^2,0^2}
  \end{example}

  As with the \option{label} key for tableaux, by default, the row
  labels are typeset in mathematics mode.

  \option[0]{rows=number of rows}[non-negative integer]<abacus>

  The \option{rows} key sets the (minimum) number of rows in the abacus.
  By default, the \keyword{\Abacus} command uses the smallest number of
  rows necessary to display all of the beads on the abacus, but this can
  be increased using \option{rows}.

  \begin{example}{abacusRows}
  \Abacus{3}{3,2^2,0^2} \qquad
  \Abacus[rows=4]{3}{3,2^2,0^2} \qquad
  \Abacus[rows=5]{3}{3,2^2,0^2}
  \end{example}

  \option[\aTableauColour{Inner}]{runner=colour}[a \LaTeX\ colour]
  \option*[very thick]{runner style=style}[\TikZ-styling]

  Use \option{runner} to set the colour of abacus runners.  More
  generally, use \option{runner style} to set the style of the abacus
  runners.

  \begin{example}{abacusBallColour}
  \Abacus{3}{3,2^2} \qquad
  \Abacus[runner=red]{3}{5,3,2,0^2} \qquad
  \Abacus[runner=brown, bead=blue]
    {3}{6,4,3,[ball color=red]0^2}
  \end{example}

  The \option{runner style} key appends \TikZ-styling to the abacus
  runner style.

  \begin{example}{abacusRunnerStyle}
  \Abacus[runner style={dotted}]{3}{3,2^2} \quad
  \end{example}

  \option[]{runner labels=labels}[list of labels for the abacus runners]
  \option*[font=\textbackslash scriptsize, text=\aTableauColour{Inner}]{runner label style=style}[\TikZ-styling]

  The \option{runner labels} key adds labels to each runner. An
  error is given if the number of labels does not match the number of
  runners. Use \option{runner label style} to change the style of the
  label.

  \begin{example}{abacusRunnerLabels}
  \Abacus[runner labels={1,2,0},
     entries=residues]{3}{3,2^2,0^2} \qquad
  \Abacus[runner labels={2,3,0,1}, entries=residues,
    runner label style={circle, draw=cyan, inner sep=0pt,
    minimum size=2.4mm, yshift=0.2mm}] {4}{5,3,2^2,0^2}
  \end{example}

  As with the \option{label} key for tableaux, by default, the runner
  labels are typeset in mathematics mode.

  \option[\aTableauColour{Inner}]{tick=colour}[a \LaTeX\ colour]
  \option*[semithick]{tick style=style}[\TikZ-styling]
  \option*[0.2]{tick length=number}[decimal]

  These three keys control the ticks on the abacus runners, which mark
  the empty bead positions. Use \option{tick} to colour the ticks
  on the abacus runners. The \option{tick style} key sets the style of
  the abacus ticks and \option{tick length} sets the length \textit{as a
  fraction of the bead width}.

  \begin{example}{abacusTick}
  \Abacus[tick=red]{3}{6,4,3,1,0} \qquad
  \Abacus[tick length=0.3]{3}{6,4,3,1,0} \qquad
  \Abacus[tick style={ultra thick,orange}]{3}{6,4,3,1,0}
  \end{example}

  Setting \option{tick length=0} removes the ticks from the runners.

  \option[]{unshaded}

  The abacus balls are drawn with the \TikZ style
  \keyword{shading=ball}.  As noted in \autoref{Ex:abacusNoShade}, you can
  disable the \TikZ-ball shading for individual beads using the \TikZ-style \keyword{unshaded}. The
  \option{unshaded} key disables the ball shading for \emph{all} beads,
  making it possible to fully customise how the abacus beads are
  displayed.

  \begin{example}{abacusUnshaded}
  \Abacus[unshaded,bead text=green]{3}{3_1,2_2,2_3}\qquad
  \Abacus[bead style={unshaded, shape=diamond,
    fill=brown, text=yellow}]{3}{3_1,2_2,2_3,0^2}
  \end{example}

  As the first example illustrates, if you use the \option{unshaded} key then
  you need to define a new style for the abacus beads. As the second
  example shows, rather than using \option{unshaded} as an
  \keyword{\Abacus} key, you can also use it inside \option{bead style} as a
  \TikZ-style. In particular, the \option{unshaded} style can be used to
  add labels to abacus ticks:

  \begin{example}{abacusUnshadedTicks}
  \Abacus{3}{5,4,4,[unshaded,text=red,fill=white]2_A,1,1}
  \end{example}

  \subsection{Traditional abacuses}\label{SS:Traditional}
  \index{traditional}
  \index{abacus!traditional}

  By default, the \keyword{\Abacus} command produces a ball-and-stick
  abacus, which is commonly used in the literature for algebraic
  combinatorics and representation theory. When the \option{traditional}
  key is used, the \keyword{\Abacus} command draws a more traditional
  abacus, where the runners look like rods, and the beads look like
  discs. This takes up more space, but the result is more visually
  appealing, except possibly for the choice of colours!

  This section explains how to use the \option{traditional} key, along
  with additional options specific to traditional abacus diagrams.

  \option[false]{traditional}[true/false]

  When the \option{traditional} option is used, the \keyword{\Abacus}
  command draws an abacus that looks more like a traditional Chinese
  abacus, where the runners are drawn as rods and the beads as discs.

  \begin{example}{traditional}
  \Abacus[traditional]{3}{6,4,3,1,0} \qquad
  \Abacus[traditional, colour theme=natural]
    {3}{6,4,3,[ball color=red]0^2}
  \end{example}

  Traditional abacuses occupy more space, but they are more visually
  appealing. Traditional abacuses were added as an afterthought and not
  all of the abacus options have been tested on traditional abacuses.
  Please
  \href{https://\aTableauMeta{repository}/issues}{report any problems}.

  \option[0.285]{bead height}[height in \unit{cm}]
  \option*[0.665]{bead width}[width in \unit{cm}]

  The \option{bead height} and \option{bead width} keys set the height
  and width of the abacus beads, or disks.

  \begin{example}{traditionBeadHeight}
  \Abacus[traditional, bead height=0.3]{3}{6,4,3,1,0} \qquad
  \Abacus[traditional, bead width=0.8]{3}{6,4,3,1,0} \qquad
  \end{example}

  If you change these keys, then you may also need to adjust
  \option{bead sep} and \option{runner sep}.

  \option[0.13]{beam width}[height in \unit{cm}]

  Sets the height of the beam at the top and bottom of the abacus (see
  \option{abacus ends}).

  \begin{example}{traditionBeamHeight}
  \Abacus[traditional, beam width=0.26,
    abacus ends=--]{3}{6,4,3,1,0} \qquad
  \end{example}

  \option[false]{framed}[false/true]

  The \option{framed} key adds a frame around the abacus. This key
  overrides the \option{abacus ends} key.

  \begin{example}{traditionalFramed}
  \Abacus[framed, traditional]{4}{3,2^2,1^3,0^2}
  \end{example}

  \option[0.2]{tick length}[decimal number, length \unit{cm}]

  For traditional abacuses, the \option{tick length} sets the width of
  the rods in the abacus.
  \begin{example}{traditionalTick}
  \Abacus[traditional, tick length=0.3]{3}{6,4,3,1,0}
  \end{example}

  % --------------------------------------------------------------
  \section{Customising \aTableau}\label{S:keys}

  This section describes how to further customise \aTableau by defining
  your own \aTableau commands, using \option{colour theme}s, and
  using \aTableau with \ctan{beamer}. This section also contains a
  compact listing, and brief description, of the many \aTableau keys
  that were described in earlier sections.

  % --------------------------------------------------------------
  \subsection{Custom \aTableau commands}\label{SS:NewTableau}
  \indexcmd{NewATableauCommand}

  Sometimes, it is necessary to use multiple tableau styles within a
  single document. While it is possible to apply the required key-value
  settings manually to each picture using the commands and keys
  described above, a better approach is to define custom commands for
  these pictures using:

  \begin{quote}
  \keyword{\NewATableauCommand \Command {<aTableau command name>} {keys}}
  \end{quote}

  Of course, you should replace $\langle$\keyword{\Command}$\rangle$
  with whatever name you want to call your command. The
  \texttt{\aTableau command name} can be the names of any of the 11 \aTableau picture commands:
  \begin{center}
    \rowcolors{1}{LightSkyBlue!10}{}
    \begin{tabular}{*4l}
      Abacus& Diagram& Multidiagram& Multitableau\\
      RibbonTableau&ShiftedDiagram&ShiftedTableau& SkewDiagram\\
      SkewTableau& Tableau& Tabloid &
    \end{tabular}
  \end{center}
  The $\langle$keys$\rangle$ are a comma-separated list of \aTableau
  keys that define your custom command.  Defining custom commands helps
  to ensure consistency throughout your document. Doing this also makes it
  easier to modify the ``design specifications'' of your custom
  \aTableau pictures because they appear only in the
  definition of your custom command, rather than at different places in
  your document.

  The commands created using \keyword{\NewATableauCommand} are used
  in exactly the same way as the \aTableau picture commands that they emulate.
  In particular, they can be used both in and outside \keyword{tikzpicture}
  environments, they accept \aTableau key-value settings as an optional
  argument, and the elements of the picture can be styled in the usual
  ways.

  \begin{example}{newTableau}
  \NewATableauCommand\MyTableau{Tableau}
    {french,border colour=orange,
     box style={draw=orange,circle,
        text=white, fill=red!40!white}}
  \MyTableau{123,45} \quad
  \MyTableau[border colour=red]{123,[fill=red]45}
  \end{example}

  Similarly, by giving coordinates, these commands can be used inside
  \keyword{tikzpicture} environments:

  \begin{example}{newDiagram}
  \NewATableauCommand\MyDiagram{Diagram}
    {ukrainian, box fill=yellow!40,shifted}
  \begin{tikzpicture}[add grid]
    \MyDiagram(45:0.9){3,2}
    \MyDiagram(2.5,-1)[tabloid]{3,2,1}
  \end{tikzpicture}
  \end{example}

  These commands are provided mainly as a convenience because, in
  principle, it is possible to define such commands ``by hand'' using
  \keyword{\NewDocumentCommand}. This said, commands defined using
  \keyword{\NewATableauCommand} will automatically work with the
  \option{beamer} key, which requires a little more care to set up
  manually. An error results if the \keyword{\Command} being defined by
  \keyword{\NewATableauCommand} already exists.

  % --------------------------------------------------------------
  \subsection{Beamer}\label{SS:Beamer}
  \index{beamer}
  \index{overlay specifications}

  When the \ctan{beamer} document class is used, all of the
  \aTableau commands support the following extended syntax for use with
  \ctan{beamer} overlay commands:

  \begin{quote}
    \keyword{\Command <overlay specifications> (x,y) [options] {...specifications...}}
  \end{quote}

  This enhanced syntax is automatically available whenever the \ctan{beamer}
  document class is used, and it is not available otherwise.

  The \ctan{beamer} \textit{overlay specifications} are described in
  Section~3.10 of the \ctan{beamer} manual. The basic idea is that they
  allow you to specify those slides of a \ctan{beamer} presentation
  where particular content appears, or does not appear.

  \begin{Example}[text only, listing options={style=atableau_beamer}]*{beamer}
    \lstinputlisting{atableau_beamer.tex}
  \begin{slide}[title=Slide 1]
    \includegraphics[width=1.0\textwidth,page=1]{atableau_beamer.pdf}
  \end{slide}
  \begin{slide}[title=Slide 2]
    \includegraphics[width=1.0\textwidth,page=2]{atableau_beamer.pdf}
  \end{slide}
  \begin{slide}[title=Slide 3]
    \includegraphics[width=1.0\textwidth,page=3]{atableau_beamer.pdf}
  \end{slide}
  \end{Example}

  See the \ctan{beamer} manual for a description of overlay
  specifications and how to use them.

  In practice, the \aTableau overlay specifications are just a wrapper
  around the corresponding \ctan{beamer} commands. More precisely, the
  following pairs of commands are equivalent:

\begin{Example}[listing only]*{beamerOverlaySpecsOnly}
\Multidiagram<1->{3,2|1}         \Tabloid<2-4>{3,1^2}{123,789,{10}{11}}
\only<1->{\Multidiagram{3,2|1}}  \only<2-4>{\Tabloid<2->{3,1^2}{123,789,{10}{11}}}
\end{Example}

  The only advantage of using the \aTableau overlay specification,
  rather than the \ctan{beamer} commands, is that the \aTableau code is
  slightly easier to read and type.

  \option[only]{beamer}[invisible,only,onslide,uncover,visible]
  \index{invisible}\index{beamer!invisible}
  \index{only}     \index{beamer!only}
  \index{onslide}  \index{beamer!onslide}
  \index{uncover}  \index{beamer!uncover}
  \index{visible}  \index{beamer!visible}

  The \option{beamer} key allows you to use the five \ctan{beamer} overlay commands:
  \begin{quote}
    \keyword{\invisible}\qquad
    \keyword{\only}\qquad
    \keyword{\onslide}\qquad
    \keyword{\uncover}\qquad
    \keyword{\visible}
  \end{quote}
  By default, the \aTableau commands use \keyword{\only}, but this can
  be changed using the \option{beamer} key.  For example, if you set
  \keyword{\aTabset{beamer=uncover}} then \aTableau uses the \keyword{\uncover} command.
  More explicitly, the following pairs of commands are equivalent.

  \begin{Example}[listing only]*{beamerOverlaySpecsUncover}
  \Abacus<4,5>[beamer=uncover]{3,2}      \Tableau<2-4>[beamer=invisible]{12345,789}
  \uncover<4,5>{\Multidiagram{3,2|1^2}}  \invisible<2-4>{\Tabloid<2->{12345,789}}
  \end{Example}

  The \ctan{beamer} class provides several other overlay commands, but
  \aTableau only supports the five overlay commands listed above.

  % --------------------------------------------------------------
  \subsection{\aTableau colour themes}\label{S:Colours}
  \label{S:ColourTheme}
  \index{colour theme}
  \index{colours}

  The colours in \aTableau pictures are controlled by the six base colours:
  \begin{center}
    \rowcolors{2}{}{LightSkyBlue!10}
    \begin{tabular}{*3l}
    aTableauMain  &
    aTableauInner &
    aTableauStar  \\
    aTableauSkew  &
    aTableauFill  &
    aTableauRod
    \end{tabular}
  \end{center}

  It is sometimes useful to use the \aTableau colour names directly in
  style specifications, and with \LaTeX\ colour commands. For example,
  you can write \keyword{\textcolor{aTableauMain}{text}}. The \aTableau
  colours are defined as HTML colours using the \keyword{\definecolor}
  command provided by \ctan{xcolor}.

  %\newpage[4]
  {\samepage

    \option[default]{colour theme}{default,classic,natural}
  }

  Creating a good colour scheme is difficult, and it is partly
  subjective, so \aTableau provides three colour themes in the hope that
  one of these themes will appeal. The \option{colour theme} key sets
  the colour theme. In addition to changing the colour
  theme, the key-value interface allows you to set the colours of
  individual components in the pictures produced by \aTableau.

  \begin{itemize}
    \item \ColourTheme{default}
    \item \ColourTheme{classic} \newpage
    \item \ColourTheme{natural}
  \end{itemize}

  You can also use \option{colour theme} to define a new colour scheme by giving
  it a comma separated list of \textit{six colours}, which sets the six colours in
  the order listed in the tables above. The six items in the list
  must all be valid colours, as recognised by the \ctan{xcolor} package.
  Setting \option{colour theme} to anything other than one of the names of the three
  colour scheme, or a list of six colours, gives an error.

  \begin{example}{colourTheme}
  \aTabset{colour theme={purple,red,pink,
             purple!10!white,magenta!20!white,brown}}
  \ShiftedTableau[skew boxes]{234,*5*6,*7} \qquad
  \Abacus{3}{4,3,2}
  \end{example}

  % --------------------------------------------------------------
  \subsection{\aTableau keys}
  This section lists all \aTableau keys, together with a quick
  explanation of what they do. The last two columns indicate whether the
  options apply to tableaux (and diagrams), or to abacuses~--- or both!
  Options starting with \keyword{(no)} are pairs of boolean options and
  their inverses. If these options are not given a true or false value, then
  they are implicitly set to true. Although not explicitly listed, spelling
  variations of keys from the American dialect of English are condoned.

  Here, and throughout the manual, the key names (and the green ticks
  below) are hyperlinks to the relevant sections of the manual.

  \rowcolors{2}{}{LightSkyBlue!10}
  \begin{xltabular}{0.9\textwidth}{l>{\raggedright}Xcc}\toprule
    \hiderowcolors
    \heading{Key} & \heading{Meaning} & \heading{Tableau} & \heading{Abacus} \\
    \midrule
    \endhead
    \showrowcolors
    \option{abacus ends}       & Set the top and bottom of the abacus                & \No  & \Yes \\
    \option{abacus ends style} & Set the style of the top and bottom of the abacus   & \No  & \Yes \\
    \option{abacus bottom}     & Set the offset for the bottom of the abacus         & \No  & \Yes \\
    \option{abacus star}       & Set the abacus star                                 & \No  & \Yes \\
    \option{abacus top}        & Set the offset for the top of the abacus            & \No  & \Yes \\
    \option{align}             & Set baseline alignment of \aTableau diagram         & \Yes & \Yes[abacus]\\
    \option{australian}        & Use the Australian convention for tableaux          & \Yes & \No \\
    \option{bead}              & Set the colour of the abacus beads                  & \No  & \Yes \\
    \option{bead font}         & Set the font used for the abacus bead labels        & \No  & \Yes \\
    \option{bead sep}          & The distance between adjacent beads on a runner     & \No  & \Yes \\
    \option{bead size}         & The diameter of the abacus beads                    & \No  & \Yes \\
    \option{bead style}        & Set the style of the abacus beads                   & \No  & \Yes \\
    \option{bead text}         & Set the colour of the abacus bead labels            & \No  & \Yes \\
    \option{beads}             & Set the number of beads on the abacus               & \No  & \Yes \\
    \option{beamer}            & Sets the beamer overlay specifications command      & \Yes & \Yes \\
    \option{beta numbers}      & Abacus bead specifications entered as beta numbers  & \No  & \Yes \\
    \option*{border}           & Draw the tableau border                             & \Yes & \No \\
    \option{border colour}     & Set tableau border colour                           & \Yes & \No \\
    \option{border style}      & Set tableau border style                            & \Yes & \No \\
    \option{box height}        & Set tableau box height                              & \Yes & \No \\
    \option{box style}         & Set tableau box style                               & \Yes & \No \\
    \option{box width}         & Set tableau box width                               & \Yes & \No \\
    \option*{boxes}            & Draw inner walls around tableau boxes               & \Yes & \No \\
    \option{cartan}            & Set Cartan type for residues                        & \Yes & \Yes[abacus] \\
    \option{charge}            & Set charge for contents and residues                & \Yes & \Yes[abacus] \\
    \option{colour theme}      & Set the \aTableau colour theme                      & \Yes & \Yes \\
    \option{colours}           & Set a cyclic list of box fill colours               & \Yes & \Yes \\
    \option{conjugate}         & Draw the conjugate tableau/diagram                  & \Yes & \No \\
    \option{cover}             & Draw a covering partition                           & \Yes & \No \\
    \option*{cover border}     & Draw border of covering tableau                     & \Yes & \No \\
    \option{cover border style}& Set \TikZ-style of the cover border                 & \Yes & \No \\
    \option*{cover boxes}      & Enable drawing of cover boxes                       & \Yes & \No \\
    \option{cover box style}   & Set \TikZ-style of the cover boxes                  & \Yes & \No \\
    \option{e}                 & Set the quantum characteristic for residues         & \Yes & \Yes[abacus] \\
    \option{east}              & Make abacus grow towards the east                   & \No  & \Yes\\
    \option{delimiters}        & Set delimiters for multitableaux and multidiagrams  & \Yes & \No  \\
    \option{empty}             & Symbol for empty tableau in a multitableau          & \Yes & \No \\
    \option{dotted cols}       & Specify columns to replace with dots                & \Yes & \Yes[abacus] \\
    \option{dotted rows}       & Specify rows to replace with dots                   & \Yes & \Yes[abacus] \\
    \option{english}           & Use the English convention for tableaux             & \Yes & \No \\
    \option{entries}           & Add entries to tableaux and abacuses                & \Yes & \Yes[abacus] \\
    \option{framed}            & Draw a frame around the abacus                      & \No  & \Yes \\
    \option{french}            & Use the French convention for tableaux              & \Yes & \No \\
    \option{halign}            & Horizontal alignment of box entries and bead labels & \Yes & \Yes[abacus] \\
    \option{inner style}       & Set style of inner tableau wall                     & \Yes & \No \\
    \option{inner wall}        & Set colour of inner tableau wall                    & \Yes & \No \\
    \option{label}             & Set tableau label                                   & \Yes & \No \\
    \option{label style}       & Set style of tableau labels                         & \Yes & \No \\
    \option{left delimiter}    & Set left delimiter for a multitableau               & \Yes & \No \\
    \option{math boxes}        & Typeset box and label entries in math-mode          & \Yes & \Yes[abacus] \\
    \option{name}              & Prefix of named coordinates                         & \Yes & \Yes[abacus] \\
    \option{north}             & Make abacus grow towards the north                  & \No  & \Yes\\
    \option{paths}             & Add paths to a diagram or tableau                   & \Yes & \No \\
    \option{path box}          & Adds default box entry for each path                & \Yes & \No \\
    \option{path box style}    & Sets style of boxes on each path                    & \Yes & \No \\
    \option{path style}        & Sets style of a path                                & \Yes & \No \\
    \option{ribbons}           & Add ribbons to tableau                              & \Yes & \No \\
    \option{ribbon box}        & Adds default box entry for each ribbon              & \Yes & \No \\
    \option{ribbon box style}  & Sets style of boxes on each ribbon                  & \Yes & \No \\
    \option{ribbon style}      & Set the ribbon style                                & \Yes & \No \\
    \option{right delimiter}   & Set right delimiter for a multitableau              & \No  & \Yes \\
    \option{rotate}            & Rotate the picture anti-clockwise                   & \Yes & \Yes \\
    \option*{separators}       & Enable separators in a multitableau                 & \Yes & \No \\
    \option*{skew border}      & Set skew border colour                              & \Yes & \No \\
    \option*{skew boxes}       & Enable drawing of skew boxes                        & \Yes & \No \\
    \option{row label style}   & Set the style of the abacus labels                  & \No  & \Yes \\
    \option{row labels}        & List of labels for the abacus rows                  & \No  & \Yes \\
    \option{rows}              & Set number of rows in a multitableau or abacus      & \Yes & \Yes[abacus] \\
    \option{runner label style}& Set the style of the abacus labels                  & \No  & \Yes \\
    \option{runner labels}     & List of labels for the abacus rows                  & \No  & \Yes \\
    \option{runner sep}        & Set distance between consecutive abacus runners     & \No  & \Yes \\
    \option{runner style}      & Set the style of the abacus runners                 & \No  & \Yes \\
    \option{runner}            & Set the colour of the abacus runners                & \No  & \Yes \\
    \option{russian}           & Use the Russian convention for tableaux             & \Yes & \No \\
    \option{scale}             & Sets the \aTableau scale                            & \Yes & \Yes[abacus] \\
    \option{scriptscript}      & Sets the \aTableau scale for subsubscripts          & \Yes & \Yes(scale-abacus) \\
    \option{script}            & Sets the \aTableau scale for subscripts             & \Yes & \Yes(scale-abacus) \\
    \option{separation}        & Set distance between components in a multitableau   & \Yes & \No \\
    \option{separator colour}  & Set separator colour for a multitableau             & \Yes & \No \\
    \option{separator}         & Set separator colour in a multitableau              & \Yes & \No \\
    \option{shape}             & Set the shape of a ribbon tableau                   & \Yes & \No \\
    \option{shifted}           & True for a shifted tableau                          & \Yes & \No \\
    \option{skew border style} & Set the \TikZ-style of the skew border              & \Yes & \No \\
    \option{skew box style}    & Set the \TikZ-style of the skew boxes               & \Yes & \No \\
    \option{skew}              & Set inner skew shape                                & \Yes & \No \\
    \option{snob box style}    & Sets style of boxes on each snob                    & \Yes & \No \\
    \option{snob box}          & Adds default box entry for each snob                & \Yes & \No \\
    \option{snob style}        & Sets style of a snob                                & \Yes & \No \\
    \option{snobs}             & add snobs to tableau                                & \Yes & \No \\
    \option{south}             & Make abacus grow towards the south                  & \Yes & \No \\
    \option{styles}            & Shorthand for defining single use \TikZ-styles      & \Yes & \Yes[abacus] \\
    \option{tableau star}      & Set \TikZ-style of tableau $*$-nodes                & \Yes & \No \\
    \option{tabloid}           & True for a tabloids                                 & \Yes & \No \\
    \option{text boxes}        & Typeset box and label entries in text mode          & \Yes & \Yes[abacus] \\
    \option{tick length}       & Set the length of the ticks on the abacus runners   & \No  & \Yes \\
    \option{tick style}        & Set the style of the ticks on the abacus runners    & \No  & \Yes \\
    \option{tick}              & Set the colour of the ticks on the abacus runner    & \No  & \Yes \\
    \option{tikz after}        & \TikZ-code injected after \aTableau picture         & \Yes & \Yes[abacus] \\
    \option{tikz before}       & \TikZ-code injected before \aTableau picture        & \Yes & \Yes[abacus] \\
    \option{tikzpicture}       & Sets \texttt{tikzpicture} environment keys          & \Yes & \No \\
    \option{traditional}       & Use the traditional abacus style                    & \No  & \Yes \\
    \option{unshaded}          & Removes shading from the abacus beads               & \No  & \Yes \\
    \option{valign}            & Set vertical alignment                              & \Yes & \Yes[abacus] \\
    \option{west}              & Make abacus grow towards the west                   & \Yes & \No \\
    \option{xoffsets}          & Set the $x$-offsets for components in a multitableau& \Yes & \No \\
    \option{xscale}            & Set the \aTableau $x$-scale                         & \Yes & \Yes(scale-abacus) \\
    \option{yoffsets}          & Set the $y$-offsets for components in a multitableau& \Yes & \No \\
    \option{yscale}            & Set the \aTableau $y$-scale                         & \Yes & \Yes(scale-abacus) \\
    \bottomrule
  \end{xltabular}

  All keys can be used with all \aTableau pictures. Keys that do not affect
  a given picture are silently ignored.

  % --------------------------------------------------------------
  \subsection{\aTableau styles}\label{S:TikZStyles}

  This package is little more than a glorified interface to some \TikZ
  commands. Under the hood there are many custom \TikZ styles that
  control the pictures drawn by the \aTableau package. The key-value
  interface to the \aTableau commands is the recommended way of changing
  these styles, however, it is sometimes useful (see, for example,
  \autoref{Ex:abacusCleared}), to use these styles in your own pictures.
  You can, if you want, change these styles directly using
  \keyword{\tikzset}, but we recommend against doing this because such
  changes can dramatically modify, and even break, the corresponding
  \aTableau commands. If you do change these styles, we
  strongly recommend that you \emph{append} to them, rather than
  setting the styles directly.

  \begin{center}
    \rowcolors{2}{}{LightSkyBlue!10}
    \begin{xltabular}{0.9\textwidth}{ll}\toprule
       \hiderowcolors
       \heading{Style name} & \heading{Adds \TikZ-styling to...}\\
       \midrule
       \showrowcolors
       aTableau/abacusBead      & Standard abacus beads\\
       aTableau/abacusEnds      & Tops and bottoms of abacus runners\\
       aTableau/abacusLabel     & Base abacus label style\\
       aTableau/abacusRunner    & Abacus runners\\
       aTableau/abacusStar      & Abacus stars \\
       aTableau/abacusTick      & Abacus ticks \\
       aTableau/aTableauBox     & Base tableau box style\\
       aTableau/border          & Tableau borders \\
       aTableau/clearBoxes      & Erases material. Used by \option{dotted rows} and \option{dotted cols}\\
       aTableau/coverBorder     & Borders for covering partitions\\
       aTableau/coverBox        & Boxes for covering partitions\\
       aTableau/delimiter       & Base delimiter style in multitableaux\\
       aTableau/dottedLine      & Adds dotted lines. Used by \option{dotted rows} and \option{dotted cols}\\
       aTableau/innerWall       & Inner tableau walls\\
       aTableau/leftDelimiter   & Left delimiter in a multitableau\\
       aTableau/namedTick       & Named nodes for abacus ticks\\
       aTableau/path            & Paths \\
       aTableau/pathBox         & Boxes in paths \\
       aTableau/ribbon          & Ribbons \\
       aTableau/ribbonBox       & Boxes in ribbons \\
       aTableau/rightDelimiter  & Right delimiter in a multitableau\\
       aTableau/rowLabel        & Style of abacus row labels\\
       aTableau/runnerLabel     & Style of abacus runner labels\\
       aTableau/separatorLine   & Separator lines in multitableau\\
       aTableau/separatorSymbol & Separators in multitableau\\
       aTableau/skewBorder      & Skew tableau borders \\
       aTableau/skewBox         & Skew tableau boxes \\
       aTableau/snob            & Snobs \\
       aTableau/snobBox         & Boxes in snobs \\
       aTableau/tableauBox      & Tableau boxes\\
       aTableau/tableauLabel    & Tableau labels \\
       aTableau/tableauStar     & Star style for tableaux \\
       \bottomrule
    \end{xltabular}
  \end{center}

  Most of these styles are quite basic, however, some are more involved
  or are used in non-obvious ways. In some cases, such as the tableau
  boxes, the \TikZ-styling does not fully control the style of these
  features.  Most of these styles can be changed using the \aTableau
  key-value interface, which is the recommended approach. Changes made to
  these styles are not guaranteed to be compatible with future releases of
  the \aTableau package.

  % --------------------------------------------------------------
  \subsection{\aTableau and the \arXiv}

  The \arXiv now plans to update its \TeXLive distribution annually.
  As of writing, it is using \TeXLive 2025 by default, so papers
  using \aTableau should compile on the \arXiv. The \arXiv
  will not always have the latest version of \aTableau installed.
  If your document does not compile on the \arXiv due to \aTableau,
  check to see it is using the latest versio of \aTableau. If they only
  have an older version of the package available,
  try uploading the latest release of the \aTableau style file,
  \href{https://mirrors.ctan.org/graphics/pgf/contrib/atableau/atableau.sty}{atableau.sty},
  as part of your \arXiv submission.

  % ----------------------------------------------------------
  \section{Examples from the literature}

  This section shows how to use the \aTableau package to draw some of the
  pictures that appear in the literature. The aim is to show how to use the
  package to construct some non-trivial real-world examples. In some cases
  we have taken the liberty of making small modifications where we felt
  these improved on the original.

  Diagrams like the following are common. Note the use of \option{ribbons} to add
  the $\alpha$ in row~$4$ and column~$8$.

  \begin{example}{diagramAddableNode}
  \Diagram[french, no boxes, scale=0.7,
    ribbons={*46_\alpha}]{10,7,6^2,3,2}
  \end{example}

  Mendes~\cite{Mendes:hooks} uses tableaux like the two below to give a new
  proof of the Murnaghan-Nakayama rule.

  \begin{example}{diagramMendes}
  \tikzset{C/.style={circle,draw=blue,
            minimum size=3.5mm, fill=white,thick}}
  \Diagram[paths={ [C]13_1cc_\bullet, [C]21_2r_\bullet,
                   [C]23_3c_\bullet, [C]14_4
  }]{4,3,1} \qquad
  \Diagram[path style=rounded corners,
    paths={[C]12_1cr_\bullet, [C]14_2c_\bullet,
      [C]23_3c_\bullet, [C]31_4}]{4,3,1}
  \end{example}

  The next example, from \cite{Muniz}, is notable mainly for the
  right-hand tableau, which is not of skew shape.
  \begin{Example}{skewLiterature}
  \aTabset{no border, styles={R={fill=red!75}, B={fill=blue!55}, P={fill=magenta!70}} }
  \SkewTableau{4,1}{[B]1,[R]1[P]112,[R]2[B]2[P]23,[R]3[B]34,[B]4} \qquad$\mapsto$\qquad
  \SkewTableau[snobs={(draw=none)11}]{4,1}{,1112,2[B]123,3[B]24,[B]3}\qquad
  \SkewTableau{4,2}{1,112,[R]1223,[R]234,4}\qquad
  \SkewTableau[snobs={22_1}]{4,3}{1,12,22[P]3,334,4}
  \end{Example}
  Notice the use of \option{snobs} to draw a phantom box in the
  $(1,1)$-position of the second tableau, with the result that this
  tableau aligns correctly with the other tableaux.

  The following ribbon tableau comes from a nice paper by
  Fayers~\cite{Fayers:DyckTilings}, which uses Dyck tilings to
  understand homogeneous Garnir relations for KLR algebras of type~$A$.
  (This paper was one of the motivations for implementing ribbon
  tableaux.)

  \begin{example}{ribbonFayers}
  \RibbonTableau[skew={1^2}, russian, scale=0.65,
    ribbons={(draw=none)21_m}
  ]{
     12,16c_\circ c_\circ c_\circ r_\circ r_\circ *r,
     18crcccrr*r,19,1{10},1{11},1{12},
     22,29crcccrr*rccrcrr,
     2{12}ccrcrcccrr*r_lccrcrrr,
     31,*32,41,42,51,52,53,
     62cr,81,91,{10}1,{10}2,{11}1,{11}2
  }
  \end{example}

  The entries of a tableau are usually single characters, or numbers,
  but they can be more complicated. The paper
  \cite{BowmanDeVisscherHaziStroppel:Arc} contains
  tableaux with entries that are \emph{symbols}, produced by
  the \keyword{\Symb} command below.

  \begin{example}{tableauSymbols}
  \newcommand\Symb[2]{\genfrac{}{}{0pt}{}{#1}{#2}}
  \Tableau[russian, box font=\scriptsize,
    ribbons={(ultra thick,red)23crC}
  ]{
     {\Symb11}{\Symb11}{\Symb11}{\Symb0s},
     {\Symb11}{\Symb11}{\Symb11}{\Symb0s},
     {\Symb11}{\Symb11}{\Symb{s^*}s}{\Symb0f},
     {\Symb11}{\Symb11}{\Symb11},
     {\Symb11}{\Symb11}
  }
  \end{example}

  From the \aTableau perspective, the most interesting feature of the next
  three pictures is that they illustrate the power of named coordinates for
  tableaux boxes; see \autoref{E:NodeNames}. As a result, explicit
  \TikZ diagram coordinates are rarely needed in these pictures.

  The first of these examples, which is also from
  \cite{BowmanDeVisscherHaziStroppel:Arc}, is a little more involved.
  The ``hard work'' in drawing this picture diagram is done using custom
  \TikZ-styles, call \textit{pics}, that are a good way of adding repeating
  features to a \keyword{tikzpicture}. The wavy up and down strings in this
  picture are down using pics with the same name, which then use the
  \textit{bendy string} pic to draw the actual strings. These pics take
  as input the string colour, the starting box, the list of the boxes
  that the string passes through, and the final box in the string.

\begin{Example}{tableauUpDown}
\tikzset{ % reusable keys for drawing the strings in the diagram using named coords
   Cap/.style={out=45, in=135},                      % caps are drawn with to[Cap]
   Cup/.style={out=315,in=225},                      % cups are drawn with to[Cup]
   % define pics for drawing the curvy up and down strings using coords O and T
   pics/up string/.style n args = {4}{  % {colour}{first}{middle}{last}
     bendy string={#1}{#2}{#3}{#4}{T}{north}{Cup}{Cap}
   },
   pics/down string/.style n args = {4}{% {colour}{first}{middle}{last}
     bendy string={#1}{#2}{#3}{#4}{O}{south}{Cap}{Cup}
   },
   pics/bendy string/.style n args = {8}{%
    % {colour}{first coord}{middle coords}{last coord}{O/T}{N/S}{Cup/Cap}{Cap/Cup}
    code = {
      \def\last{#2}                                    % should not be necessary
      \draw[thick,#1](#5-|#2.#6 west)node[below=-3.5]{$\wedge$}--(#2.#6 west)
          foreach [remember=\pt as \last (initially #2)] \pt in {#3}
            {to[#7](\last.#6 east) to[#8] (\pt.#6 west)}
             to[#7] (#4.#6 east) -- (#4.#6 east|-#5)node[above=-3.5]{$\vee$};
      }
   },
}
\begin{tikzpicture}[red ribbon/.style={fill=red!40,opacity=0.4}]
 \coordinate (O) at (0,0); \coordinate (T) at (0,3.2);     % needed by the strings
 \draw(-2,0)--(2.5,0) (-2,3.2)--(2.5,3.2);                 % top and bottom lines
 \Diagram(0,0)[russian, inner style=dotted, ribbons={(red ribbon)24rcrcrc}]{5,4^3,3}
 \pic at (T) {up string={gray}{A-1-5}{}{A-1-5}};           % up strings
 \pic at (T) {up string={gray}{A-4-4}{}{A-4-4}};
 \pic at (T) {up string={gray}{A-5-2}{A-4-3,A-3-4}{A-3-4}};
 \pic at (T) {up string={gray}{A-5-3}{}{A-5-3}};
 \pic at (T) {up string={red}{A-5-1}{A-4-2,A-3-3,A-2-4}{A-2-4}};
 \pic at (O) {down string={gray}{A-1-1}{}{A-1-1}};         % down strings
 \pic at (O) {down string={gray}{A-2-1}{A-1-2}{A-1-2}};
 \pic at (O) {down string={gray}{A-3-1}{A-2-2,A-1-3}{A-1-3}};
 \pic at (O) {down string={gray}{A-4-1}{A-3-2,A-2-3,A-1-4}{A-1-4}};
 \pic at (O) {down string={gray}{A-5-1}{A-4-2,A-3-3,A-2-4,A-1-5}{A-1-5}};
\end{tikzpicture}
\end{Example}

The next example demonstrates how to draw a multipartition and its associated
KLRW diagram~\cite{Bowman:ManyCellular}. Once again, the issue is that
we need to draw a tableau and connect it with other combinatorial data
in the picture.

\begin{Example}{multiKLRW}
\begin{tikzpicture}[red string/.style={red, ultra thick},
    solid/.style={blue, thick}, ghost/.style={gray} ]
  \Multidiagram(0,1.3) % the multipartition, filled with residues
    [russian, entries=residues, e=3, rotate=4, no separators]{2^2,1|3,2,1}
  % the red strings, projected from the (1,1)-boxes
  \draw[red string]([shift={(0.1,0)}]A-1-1-1 |- 0,0)node[below]{$\kappa_1$} --++(0,1);
  \draw[red string]([shift={(0.1,0)}]A-2-1-1 |- 0,0)node[below]{$\kappa_2$} --++(0,1);
  \foreach \k/\r/\c in
    {1/1/1,1/1/2,1/2/1,1/2/2,1/3/1,2/1/1,2/1/2,2/1/3,2/2/1,2/2/2,2/3/1}
  { % add solid and ghost strings from the tableau to the KLRW idempotent
    \draw[thin, brown](A-\k-\r-\c.south) -- (A-\k-\r-\c |- 0,0);
    \draw[solid](A-\k-\r-\c.south |- 0,0)--++(0,1);
    \draw[ghost]([xshift=2.8mm]A-\k-\r-\c |- 0,0)--++(0,1);
  }
\end{tikzpicture}
\end{Example}

There are few papers in the literature that use abacuses that
are significantly different from the examples we have already considered.
One exception is a paper of Fayers and Putignano, on centraliser subalgebras
of the symmetric groups, that uses abacuses like the
following~\cite[page~305]{FayersPutignano:CentraliserAlgebras}:

\begin{Example}{FayersPutignano}
% \usetikzlibrary{arrows.meta}
\aTabset{colour theme=classic,
  tikzpicture={>={Stealth}}, tick length=0.1,
  styles={
    semi={shape=semicircle,inner sep=0pt,minimum height=0.7mm},
    R={semi,bead=red,shape border rotate=270,anchor=west},
    B={semi,shape border rotate=90,anchor=east},
    E={text=blue,unshaded,shift={(0.25,-0.1)}}, Cap={out=30,in=150},
    rarr={thick,red, <-}, barr={thick,blue,->}, % red and blue arrows
  }
}
\Abacus[dotted cols={0,2,4,6,8,9,10,11,13,15,17,19},
abacus ends=||, runner sep=0.6, bead sep=0.8, rows=9,
tikz after={ % add the red and blue arrows
  \draw[barr](A-4-1) to[Cap](A-4-5.base);
  \draw[barr](A-4-12) to[Cap](A-4-16.base);
  \draw[barr](A-6-5)node[below left]{$c_{s-1}$}to[out=30,in=180]+(2.2,0.5);
  \draw[barr](A-6-16)to[out=30,in=180]+(2.2,0.5);
  \draw[barr,<-](A-7-1.base)to[out=150,in=0]+(-1,0.4);
  \draw[barr,<-](A-5-12.base)to[out=150,in=0]+(-1,0.4);
  \draw[rarr,->](A-3-3.base)to[out=150,in=0]+(-2,0.5);
  \draw[rarr](A-0-14.base)to[Cap](A-0-18.base);
  \draw[rarr,->](A-1-14.base)to[out=150,in=0]+(-2,0.5);
  \draw[rarr](A-1-3.base)to[Cap](A-1-7.base);
  \draw[rarr](A-2-7.base)to[out=30, in=190]+(1,0.4);
  \draw[rarr](A-2-18.base)to[out=30, in=190]+(1,0.4);
}]{19}{|[E]4_{d_1},4_b,4,4_{c_s}||2,[R]2,[B]1||5,[E]4_{d_s}||4,[B]1,[R]1|||||
         [E]4_{d_3},4_{c_2}||2,[R]0,[B]0||5_{c_1},[E]4_{d_2}||4,[B]1,[R]0}
\end{Example}

  The most interesting features of this example are the use of styles to change the
  shape of some abacus beads into half-spheres (using the \textsf{R}
  and \textsf{B} styles), and to create ``empty'' beads (using the \textsf{E}
  style, which also shifts the bead text to the bottom right of the bead
  position), and the use of named coordinates to draw the arrows between beads using the
  \option{tikz after} key. Notice also that the abacus is specified as a quotient
  (\autoref{SS:quotients}).

  % --------------------------------------------------------------
  \section{Feature requests and bug reports}

  Please make any feature requests and bug reports on the \aTableau github
  page:
  \begin{center}
    \href{https://\aTableauMeta{repository}/issues}{\aTableauMeta{repository}/issues}.
  \end{center}
  Please provide as much detail as possible when submitting requests.

  Bug reports must be accompanied by a \textit{minimal working
  example}, which is the smallest amount of \LaTeX\ code that
  demonstrates the problem and compiles---unless you are reporting a
  problem that gives a compilation error, in which case your example code
  should reproduce the error. This is necessary because it is very difficult
  to fix a problem if you cannot reproduce it.

  % --------------------------------------------------------------
  \subsection*{Acknowledgements}

  Several features in \aTableau have benefited from posts on
  \href{https://tex.stackexchange.com}{tex.stackexchange.com}. Even
  though it may surprise them, I thank
    Max Chernoff,
    Enrico Gregorio,
    Lars Madsen,
    Clea Rees,
    Jonathan Spratte
  and
    Andrew Stacey.

% ----------------------------------------------------------------------
% bibliography
% \bibliography{papers}
\bibliographystyle{andrew}

\begin{thebibliography}{10}

\bibitem{Bowman:ManyCellular}
\textsc{C.~Bowman}, \href{http://dx.doi.org/10.1353/ajm.2022.0008}{\textit{The
  many integral graded cellular bases of {H}ecke algebras of complex reflection
  groups}}, Amer. J. Math., \textbf{144} (2022), 437--504.
\newblock \href{http://arxiv.org/abs/1702.06579}{arXiv:1702.06579}.

\bibitem{BowmanDeVisscherHaziStroppel:Arc}
\textsc{C.~Bowman, M.~D. Visscher, A.~Hazi, and C.~Stroppel},
  \href{https://arxiv.org/abs/2309.13695}{\textit{Quiver presentations and
  isomorphisms of Hecke categories and Khovanov arc algebras}}, 2023.
\newblock \href{http://arxiv.org/abs/2309.13695}{arXiv:2309.13695}.

\bibitem{DJM:cyc}
\textsc{R.~Dipper, G.~James, and A.~Mathas},
  \href{http://dx.doi.org/10.1007/PL00004665}{\textit{Cyclotomic {$q$}-{S}chur
  algebras}}, Math. Z., \textbf{229} (1998), 385--416.

\bibitem{EvseevMathas:DeformedKLR}
\textsc{A.~Evseev and A.~Mathas},
  \href{http://dx.doi.org/10.5802/art.8}{\textit{Content systems and
  deformations of cyclotomic {KLR} algebras of type~$A$ and~$C$}}, Annals of
  Representation Theory, \textbf{1} (2024), 193--297.
\newblock \href{http://arxiv.org/abs/2209.00134}{arXiv:2209.00134}.

\bibitem{Fayers:DyckTilings}
\textsc{M.~Fayers},
  \href{http://dx.doi.org/10.1007/s10801-016-0734-2}{\textit{Dyck tilings and
  the homogeneous {G}arnir relations for graded {S}pecht modules}}, J.
  Algebraic Combin., \textbf{45} (2017), 1041--1082.
\newblock \href{http://arxiv.org/abs/1309.6467}{arXiv:1309.6467}.

\bibitem{FayersPutignano:CentraliserAlgebras}
\textsc{M.~Fayers and L.~Putignano},
  \href{http://dx.doi.org/10.1016/j.jalgebra.2025.07.042}{\textit{Ribbon blocks
  for centraliser algebras of symmetric groups}}, J. Algebra, \textbf{685}
  (2026), 271--312.

\bibitem{Fulton:Tableaux}
\textsc{W.~Fulton}, \textit{Young tableaux}, London Mathematical Society
  Student Texts, \textbf{35}, Cambridge University Press, Cambridge, 1997.
\newblock With applications to representation theory and geometry.

\bibitem{James:YoungD}
\textsc{G.~James}, \textit{Some combinatorial results involving {Y}oung
  diagrams}, Math. Proc. Cambridge Philos. Soc., \textbf{83} (1978), 1--10.

\bibitem{KMR:UniversalSpecht}
\textsc{A.~Kleshchev, A.~Mathas, and A.~Ram},
  \href{http://dx.doi.org/10.1112/plms/pds019}{\textit{Universal graded
  {S}pecht modules for cyclotomic {H}ecke algebras}}, Proc. Lond. Math. Soc.
  (3), \textbf{105} (2012), 1245--1289.
\newblock \href{http://arxiv.org/abs/1102.3519}{arXiv:1102.3519}.

\bibitem{Konvalinka:ShiftedHookLengths}
\textsc{M.~z. Konvalinka}, \href{http://dx.doi.org/10.37236/588}{\textit{The
  weighted hook length formula {III}: {S}hifted tableaux}}, Electron. J.
  Combin., \textbf{18} (2011), Paper 101, 29.

\bibitem{Macdonald}
\textsc{I.~G. Macdonald}, \textit{Symmetric functions and {H}all polynomials},
  Oxford Mathematical Monographs, The Clarendon Press Oxford University Press,
  New York, second~ed., 1995.
\newblock With contributions by A. Zelevinsky, Oxford Science Publications.

\bibitem{Mathas:ULect}
\textsc{A.~Mathas},
  \href{http://dx.doi.org/10.1090/ulect/015}{\textit{Iwahori-{H}ecke algebras
  and {S}chur algebras of the symmetric group}}, University Lecture Series,
  \textbf{15}, American Mathematical Society, Providence, RI, 1999.

\bibitem{MathasTubbenhauer:BAD}
\textsc{A.~Mathas and D.~Tubbenhauer},
  \href{http://dx.doi.org/10.1112/jlms.12706}{\textit{Cellularity
  for weighted KLRW algebras of types $B$, $A^{(2)}$, $D^{(2)}$}}, Journal of
  the London Mathematical Society, \textbf{107} (2023), 1002--1044.
\newblock \href{http://arxiv.org/abs/2201.01998}{arXiv:2201.01998}.

\bibitem{Mendes:hooks}
\textsc{A.~Mendes}, \textit{The combinatorics of rim hook tableaux}, Australas.
  J. Combin., \textbf{73} (2019), 132--148.

\bibitem{Muniz}
\textsc{B.~Muniz}, \href{https://arxiv.org/abs/2505.21738}{\textit{Symplectic
  Branching through Crystals}}, 2025.
\newblock \href{http://arxiv.org/abs/2505.21738}{arXiv:2505.21738}.

\bibitem{KerovVershik}
\textsc{A.~M. Ver\v~sik and S.~V. Kerov}, \textit{Asymptotic behavior of the
  {P}lancherel measure of the symmetric group and the limit form of {Y}oung
  tableaux}, Dokl. Akad. Nauk SSSR, \textbf{233} (1977), 1024--1027.

\end{thebibliography}

% ----------------------------------------------------------------------
% index
\printindex

\end{document}
