我正在使用 smartdiagram 包并有一个flow diagram:horizontal
图表。我想添加一个“附加”,即完整的flow diagram:vertical
。
这是我的图表的代码:
\smartdiagramset{
back arrow disabled = true,
module minimum width=1.5cm,
module x sep = 2.5,
uniform arrow color=true,
additions={
additional item offset=0.85cm,
additional item border color=red,
additional arrow color=red,
additional arrow tip=stealth,
additional arrow line width=1pt,
additional arrow style=]-latex’,
}
}
\smartdiagramadd[flow diagram:horizontal]{ Experiment, Theory, Processing, V\&V, Codes, Users }{%
below of module3/Name
}
我希望Name
模块是这样的:
smartdiagram[flow diagram:vertical]{Name, Step1, Step2, Step3}
当然,我还可以根据自己的需要自定义这个图表。
使用 smartdiagram 包是否可行,还是必须使用完整的 Ti钾Z 包(我对此没有太多经验)?
答案1
\documentclass{article}
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usetikzlibrary{chains, scopes, arrows.meta}
\begin{document}
\begin{tikzpicture}[
every on chain/.style=join,
every join/.style=->,
mynode/.style={rectangle, draw, semithick, rounded corners,text width=20mm, minimum height=11mm, align=center,
fill=white, fill=blue!20,inner sep=2mm,},
node distance=10mm and 1cm
]
{ [start chain=trunk]
\node [mynode,on chain] {A};
\node [mynode,on chain] {B};
{ [start branch=numbers going below] } % just a declaration,
{ [start branch=greek going above] } % we will come back later
\node [mynode,on chain] {C};
\node [mynode,on chain] {D};
% Now come the branches...
{ [continue branch=numbers]
\node [mynode,on chain] {1};
\node [mynode,on chain] {2};
}
{ [continue branch=greek]
\node [mynode,on chain] {$\alpha$};
\node [mynode,on chain] {$\beta$};
}
}
\end{tikzpicture}
\end{document}
**编辑另一个改编版**
\documentclass{article}
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usetikzlibrary{chains, scopes, arrows.meta}
\begin{document}
\begin{tikzpicture}[
every on chain/.style=join,
every join/.style=->,
C/.style args = {#1/#2}{% Color
top color = #1, bottom color=#2},
C/.default = green!40!white/green!20!white,
mynode/.style={rectangle, draw=blue!75, ultra thick, rounded corners,text width=20mm, minimum height=11mm, align=center, inner sep=2mm,},
node distance=10mm and 1cm
]
{ [start chain=trunk]
\node [mynode,C=blue!40/blue,on chain] {A};
\node [mynode,C=yellow!40/yellow,on chain] {B};
{ [start branch=numbers going below] } % just a declaration,
{ [start branch=greek going above] } % we will come back later
\node [mynode,C=yellow!40/yellow,on chain] {C};
\node [mynode,C=red!40/red,on chain] {D};
% Now come the branches...
{ [continue branch=numbers]
\node [mynode,C,on chain] {1};
\node [mynode,C, on chain] {2};
}
{ [continue branch=greek]
\node [mynode,C=gray!40/gray,on chain] {$\alpha$};
\node [mynode,C=gray!40/gray,on chain] {$\beta$};
}
}
\end{tikzpicture}
\end{document}
答案2
我建议使用普通的 TikZ,不带smartdiagram
TikZchains
库。
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[n/.style={minimum height=9mm, minimum width=1.5cm,draw=cyan,thick,fill=cyan!30,rounded corners,inner xsep=1mm}]
\def\a{2.5} % vertical distance between nodes
\def\b{1.5} % horizontal distance between nodes
\path[nodes={n}]
(0,0) node (A) {Experiment}
++(\a,0) node (B) [fill=yellow]{Theory}
++(\a,0) node (C) {Processing}
++(\a,0) node (D) {V\& V}
++(\a,0) node (E) {Codes}
++(\a,0) node (F) {Users}
(B)
++(0,-\b) node (N) [draw=red]{Name}
(B)
++(0,\b) node (s1) {Step 1}
++(0,\b) node (s2) {Step 2}
++(0,\b) node (s3) {Step 3}
;
\foreach \p/\q in {A/B,B/C,C/D,D/E,E/F,N/B,B/s1,s1/s2,s2/s3}
\draw[-stealth] (\p)--(\q);
\end{tikzpicture}
\end{document}