I have nested nodes with text. The text could be variable size, however I would like a constant margin between the inner box and outer box.
I've played around with the text width property, but this is trial and error based, and not a perfect solution.
In this example, how do I keep the current layout, but have the right padding match the auto-generated left padding in the blue box.
\documentclass[tikz, border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\begin{document}
\definecolor{CoreBlue}{HTML}{5b9bd5}
\definecolor{CoreOrange}{HTML}{ec7d2d}
\tikzset{
Core/.style={rectangle, draw, fill=CoreBlue, draw opacity=0, text=white},
Core2/.style={rectangle, draw, fill=CoreOrange, draw opacity=0, text=white},
}
\begin{tikzpicture}[]
\node[Core, text width=17mm, align=center] {Lorem \
\tikz{ \node[Core2,align=center,text width=15mm] {\scriptsize Ipsum};}
};
\end{tikzpicture}
\end{document}






tcolorboxpackage? – AndréC Jul 21 '20 at 15:55