I have noticed inconsistent spacing when using itemized lists in a TikZ node when the tikzpicture is inside a centering environment.
I have the following code:
\documentclass{memoir}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\node[align=left, text width=5cm] (0,0)
{
\textbf{Heading 1}
\begin{itemize}
\item{item 1}
\end{itemize}
};
\node[align=left, text width=5cm] at (0,2)
{
\textbf{Heading 2}
\begin{itemize}
\item{item 2}
\end{itemize}
};
\end{tikzpicture}
\end{center}
\end{document}
and I get a result like this:
However, when I have the nodes in different order like this:
\documentclass{memoir}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\node[align=left, text width=5cm] at (0,2)
{
\textbf{Heading 2}
\begin{itemize}
\item{item 2}
\end{itemize}
};
\node[align=left, text width=5cm] (0,0)
{
\textbf{Heading 1}
\begin{itemize}
\item{item 1}
\end{itemize}
};
\end{tikzpicture}
\end{center}
\end{document}
I get this output:
If I remove the centering environment around the tikzpicture, then both lists are rendered with similar spacing like this:
Why is this happening? Is this a bug? Is there a way that I can fix this?
I'm using TeX Live 2023 on Linux.



enumitempackage and adding[itemsep=0pt,partopsep=0pt,topsep=0pt]after each\begin{itemize}like in A160457 seem to overwrite and egalize any weird things that are happening. – Qrrbrbirlbel Sep 24 '23 at 21:06