tikz 使节点与其邻居一样大

tikz 使节点与其邻居一样大

如何让蓝色节点根据红色节点的大小自动缩放?

\documentclass{standalone}

\usepackage{tikz}
\usepackage{xparse}
\newsavebox{\linetmp}

\usetikzlibrary{fit,shapes.multipart,positioning,shapes}

\NewDocumentCommand{\threepart}{mmmm}{%
\begin{tikzpicture}
    \node[text width=60pt,fill=red] (date) {#1};
    \node[right= 0pt of date.east,fill=cyan] (title) {\bfseries#2};
    \node[below= 0pt of date.south west,anchor=north west] (body) {#3};
    \node[below= 0pt of body] (quote) {\textit#4};
    \draw[thick]  (date.south west) -- (title.south east);
    \node[inner sep=0pt,draw,thick,rounded corners,fit=(date)(title)(body)(quote)] (W) {};
\end{tikzpicture}%
}

\begin{document}

\noindent
\threepart{Services}{Event Driven Framework}{OS Adapter Layer}{4}

\bigskip

\noindent
\threepart{Some very long text in the left field}{Some very long text in the upper right field}{Some very long text in the lower  field}{4}

\end{document}

https://www.latex4technics.com?note=zzvqsg 在此处输入图片描述

相关内容