
흐름도를 만드는 중입니다.
현재 나는 다음을 가지고 있습니다:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,arrows,amsmath}
\tikzstyle{process}=[rectangle,minimum width=3cm,minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision}=[diamond,minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow}=[thick,->,>=stealth]
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\node (start) [process] {
$\text{A}_{it}$
};
\node (in1) [process, below of=start] {$\text{B}_{it}$};
\node (in2) [process, below of=in1] {$\text{C}_{it}$};
\node (pro2) [decision, right of=in1, xshift=2cm] {$\text{ D}_{it}$};
\draw [arrow] (start)--(pro2);
\draw [arrow] (in1)--(pro2);
\draw [arrow] (in2)--(pro2);
\end{tikzpicture}
\end{document}
이는 세 개의 노드 A, B, C를 D에 연결합니다.
이제 D 오른쪽에 또 다른 노드 E를 만들고 싶지만 화살표 대신 더하기 기호를 추가하고 싶습니다.
이를 수행할 수 있는 방법이 있습니까?
답변1
이와 같이 ?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz,amsmath}
\usetikzlibrary{shapes.geometric,arrows.meta,positioning}
\tikzstyle{process}=[rectangle,minimum width=3cm,minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision}=[diamond,minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow}=[thick,->,>=stealth]
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\node (start) [process] {
$\text{A}_{it}$
};
\node (in1) [process, below of=start] {$\text{B}_{it}$};
\node (in2) [process, below of=in1] {$\text{C}_{it}$};
\node (pro2) [decision, right= 2cm of in1] {$\text{ D}_{it}$};
\node (pro3) [decision, right= 2cm of pro2] {$\text{ E}_{it}$};
\draw [arrow] (start)--(pro2);
\draw [arrow] (in1)--(pro2);
\draw [arrow] (in2)--(pro2);
\draw (pro2) edge node[draw,fill=white,circle]{+} (pro3);
\end{tikzpicture}
\end{document}
부록
\tikzstyle
tikz 버전 2.10부터 더 이상 사용되지 않으므로 \tikzset
which give를 사용해야 합니다.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz,amsmath}
\usetikzlibrary{shapes.geometric,arrows.meta,positioning}
%\tikzstyle{process}=[rectangle,minimum width=3cm,minimum height=1cm, text centered, draw=black, fill=orange!30]
%\tikzstyle{decision}=[diamond,minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
%
%\tikzstyle{arrow}=[thick,->,>=stealth]
\tikzset{
process/.style={rectangle,minimum width=3cm,minimum height=1cm, text centered, draw=black, fill=orange!30},
decision/.style={diamond,minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30},
}
\begin{document}
\begin{tikzpicture}[node distance=2cm,arrows={-stealth},thick]
\node (start) [process] { $\text{A}_{it}$ };
\node (in1) [process, below of=start] {$\text{B}_{it}$};
\node (in2) [process, below of=in1] {$\text{C}_{it}$};
\node (pro2) [decision, right= 2cm of in1] {$\text{ D}_{it}$};
\node (pro3) [decision, right= 2cm of pro2] {$\text{ E}_{it}$};
\draw [->] (start)--(pro2);
\draw [->] (in1)--(pro2);
\draw [->] (in2)--(pro2);
\draw (pro2) edge node[fill=white]{+} (pro3);
\end{tikzpicture}
\end{document}