When I put some minted code inside a basic rectangular TikZ node as follows:
\documentclass{article}
\usepackage{tikz}
\usepackage{minted}
\begin{document}
\begin{tikzpicture}[]
\noderectangle{
\begin{minted}{perl6}
say grep {$_ %% 3},[...] +<< prompt.split(" ").reverse
\end{minted}
};
\end{tikzpicture}
\end{document}
The lualatex --shell-escape compiler gives the following error:
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 \begin{Verbatim}[commandchars=\{}]
When I searched for this particular problem, I've noticed that it's not even asked. Do I miss something very obvious, have no idea.
How to put a minted code inside a TikZ node ?
System: TeXLive 2020 on Mac OS X

text widthbut that will add vertical space at the top. Similarly, aminipage(almost the same) helps, too, and doesn't add vertical space. You will need to set a width, though. – Qrrbrbirlbel Jan 27 '23 at 13:23\mintinline:\node{\mintinline{perl6}!say grep {$_ %% 3},[...] +<< prompt.split(" ").reverse!};– Qrrbrbirlbel Jan 27 '23 at 13:31