EDIT : I added some examples to illustrate what I want to do.
I would like to be able to draw nested Young tableaux. For a definition of Young tableaux, see https://en.wikipedia.org/wiki/Young_tableau. What I mean by nested is that the content of a cell of a tableau is itself a tableau. For example, my result should look like this :
In general, rows and columns can be of any length. Here is another example to illustrate what I want to be able to do:
Because I also want tabloids and column-tabloids, I draw my tableaux using the method in this answer (instead of the packages ytableau or genyoungtabtikz) :
column tabloids versus row tabloids
However, I am not used to tikz, and it does not work as I would like. There is a minimal code for my first example (I used \Tableau and \PTableau so that the computer does not confuse both methods):
\documentclass{article}
\usepackage{tikz}
\newcount\tableauRow\newcount\tableauCol
\newcommand\Tableau[2]{%
\begin{tikzpicture}[scale=#2,draw/.append style={thick,black},baseline=-4mm]
\tableauRow=0
\foreach \Row in {#1} {
\tableauCol=1
\foreach\k in \Row {
\draw(\the\tableauCol,\the\tableauRow)+(-.5,-.5)rectangle++(.5,.5);
\draw(\the\tableauCol,\the\tableauRow)node{\k};
\global\advance\tableauCol by 1
}
\global\advance\tableauRow by -1
}
\end{tikzpicture}
}
\newcommand\PTableau[2]{%
\begin{tikzpicture}[scale=#2,draw/.append style={thick,black},baseline=-4mm]
\tableauRow=0
\foreach \Row in {#1} {
\tableauCol=1
\foreach\k in \Row {
\draw(\the\tableauCol,\the\tableauRow)+(-.5,-.5)rectangle++(.5,.5);
\draw(\the\tableauCol,\the\tableauRow)node{\k};
\global\advance\tableauCol by 1
}
\global\advance\tableauRow by -1
}
\end{tikzpicture}
}
\begin{document}
[
\PTableau{{\Tableau{{1,2},{3,4}}{0.5},\Tableau{{5,6},{7,8}}{0.5}}}{1.5}
]
\end{document}
With this code, the result looks like this instead of what I want (I drew it because of computer problem, but it illustrates the problem):
What should I modify to \PTableau so that I obtain the result I want? And mostly, why?




tikzpictures isn't supported and typically breaks. It should always be avoided unless you know what you are doing and it should almost always be avoided even if you do. – cfr Feb 01 '24 at 05:46tikzpictures, use\picsinstead. Could you post a picture of how the expected output should look like? – Jasper Habicht Feb 01 '24 at 10:13