\begin{document}
\pagestyle{empty}
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=white!20,
text width=5.5em, text badly centered, node distance=5cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=white!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=5cm,
minimum height=5em]
\begin{tikzpicture}[node distance = 4cm, auto]
% Place nodes
\node [block] (sume) {1.-Sume variables de holgura (forma estándar)};
\node [block, below of=sume] (calcu) {2.-Calcule una primer solución básica factible};
\node [decision, below of=calcu] (decide) {3.-¿Existe una solución básica factible adyacente que sea mejor?};
\node [block, right of=decide, node distance=5cm] (no) {5.-Entonces la solucion basica factible actual es óptima};
\node [block, left of=decide, node distance=5cm] (yes) {4.-Entonces calcule el valor de la funcion $Z$ para la nueva solucion básica factible};
% Draw edges
\path [line] (sume) -- (calcu);
\path [line] (calcu) -- (decide);
\path [line] (decide) -- node {Si} (yes);
\path [line] (yes) -| (calcu);
\path [line] (decide) -- node {No} (no);
\end{tikzpicture}
\end{document}
這是我第一次在 Latex 中建立流程圖,到目前為止我已經這樣做了,結果看起來很糟糕。有人可以幫我使它看起來與我的圖像相似嗎?
- 這是我所做的結果,問題是從4到2的箭頭是翻轉的,我該如何解決這個問題
- 什麼指令使箭頭看起來更粗?
答案1
這會是你所尋求的嗎?
問題是從4到2的箭頭是翻轉的,我該如何解決這個問題
\path [line] (yes.west) --+(-1cm,0) |- (h); %
(yes.west)
從左側繪製1cm,然後垂直向上和水平移動到(h)
程式碼用來node
定義的位置(h)
什麼指令使箭頭看起來更粗?修改
line
tizstyle 中定義的樣式,加入thick
, orvery thick
, orline width=xx pt
如果您關於使箭頭看起來更粗的問題與箭頭有關,請檢查是否可以更改 TikZ/PGF 中箭頭的大小?
產生下面的圖像
程式碼
\documentclass[tikz,border=1cm]{standalone}
\usetikzlibrary{matrix, shapes, arrows,calc, positioning}
\begin{document}
\pagestyle{empty}
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=white!20,
text width=3cm, text badly centered, node distance=5cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=white!20,
text width=3cm, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
minimum height=5em]
\begin{tikzpicture}[node distance = 4cm, auto]
% Place nodes
\node [block] (sume) {1.-Sume variables de holgura (forma estándar)};
\node [block, below of=sume] (calcu) {2.-Calcule una primer solución básica factible};
\node [decision, below of=calcu] (decide) {3.-¿Existe una solución básica factible adyacente que sea mejor?};
\node [block, below right =1cm and 1 cm of decide, node distance=5cm] (no) {5.-Entonces la solucion basica factible actual es óptima};
\node [block, below left = 1cm and 1cm of decide, node distance=5cm] (yes) {4.-Entonces calcule el valor de la funcion $Z$ para la nueva solucion básica factible};
% Draw edges
\path [line] (sume) -- (calcu);
\path [line] (calcu) --node[pos=0.5](h){} (decide);
\path [line] (decide) -| node[pos=0.2,above] {Si} (yes);
\path [line] (yes.west) --+(-1cm,0) |- (h);
\path [line] (decide) -| node[pos=0.2,above] {No} (no);
\end{tikzpicture}
\end{document}