\documentclass{article}
\usepackage{tikz}
\usepackage[latin1]{inputenc}
\usetikzlibrary{shapes.geometric, arrows,backgrounds,fit,positioning}
\pagestyle{empty}
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=4.2em, text centered, minimum height=3em]
%\tikzstyle{int}=[draw, fill=blue!20, minimum size=2em]
%\tikzstyle{init} = [pin edge={to-,thin,black}]
\tikzstyle{line} = [draw, -latex']
\begin{document}
\begin{tikzpicture}[node distance=2cm]
% Place nodes
\node [block] (b1) {Title};
\node [block, left of= b1, node distance=2.3cm] (Input) {};
\node [block, right of= b1, node distance=2.3cm] (b2) {};
\node [block, right of= b2, node distance=2.3cm] (b3) {Title};
% Draw edges
\path [line] (Input) -- (b1) ;
\path [line] (b1) -- (b2);
\path [line] (b2) -- (b3) ;
\end{tikzpicture}
\end{document}
答案1
这是一项提议。但请注意,从您的草图中看不出您所说的“框中框”是什么意思,因此我添加了两种可能性:使用fit
(您已经加载)和\fbox
。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
%\usepackage[latin1]{inputenc}
\usetikzlibrary{shapes.geometric, arrows,backgrounds,fit,positioning}
\pagestyle{empty}
\tikzset{block/.style={rectangle, draw, fill=blue!20,
text width=4.2em, text centered, minimum height=3em},
line/.style={draw, -latex'},
int/.style={draw, fill=blue!20, minimum size=2em}}
%\tikzstyle{init} = [pin edge={to-,thin,black}]
\begin{document}
\begin{tikzpicture}
% Place nodes
\node[int] (i1) {text};
\node[int,below=2mm of i1] (i2) {text};
\node[int,below=2mm of i2] (i3) {text};
\node[int,below=2mm of i3] (i4) {text};
\node[below=2mm of i4] (title) {Title};
\node[fit=(i1) (i2) (i3) (i4) (title),draw,minimum width=2.4cm] (Input) {};
\node[block,left=2.3cm of Input] (b1) {Title};
\node[block,right=2.3cm of Input] (b2) {};
\node[block, right=2.3cm of b2,align=center] (b3) {Title\\
\fbox{text} \fbox{text} \fbox{text}};
% Draw edges
\path [line] (b1) -- (Input) ;
\path [line] (Input) -- node[above]{Text 1}
node[below,align=center]{$\left(\begin{array}{c}
\text{Text 2}\\ \text{Text 3}
\end{array}\right)$}
(b2);
\path [line] (b2) -- (b3) ;
\end{tikzpicture}
\end{document}