\documentclass[UTF8]{ctexart} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \pagestyle{empty} % 无页眉页脚 \tikzstyle{startstop} = [rectangle,rounded corners, minimum width=3cm,minimum height=1cm,text centered, draw=black,fill=red!30] \tikzstyle{io} = [trapezium, trapezium left angle = 70,trapezium right angle=110,minimum width=3cm,minimum height=1cm,text centered,draw=black,fill=blue!30] \tikzstyle{process} = [rectangle,minimum width=3cm,minimum height=1cm,text centered,text width =3cm,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{tikzpicture}[node distance=2cm] \node (start) [startstop] {Start}; \node (input1) [io,below of=start] {Input}; \node (process1) [process,below of=input1] {Process 1}; \node (decision1) [decision,below of=process1,yshift=-0.5cm] {Decession 1}; \node (process2a) [process,below of=decision1,yshift=-0.5cm] {Process 2aaaaaa aaaaaaa aaaa}; \node (process2b) [process,right of =decision1,xshift=2cm] {Process 2b}; \node (out1) [io,below of=process2a] {Output}; \node (stop) [startstop,below of=out1] {Stop}; \draw [arrow] (start) -- (input1); \draw [arrow] (input1) -- (process1); \draw [arrow] (process1) -- (decision1); \draw [arrow] (decision1) -- node[anchor=east] {yes} (process2a); \draw [arrow] (decision1) -- node[anchor=south] {no} (process2b); \draw [arrow] (process2b) |- (process1); \draw [arrow] (process2a) -- (out1); \draw [arrow] (out1) -- (stop); \end{tikzpicture} \end{document}

2 回答2

0
```tex \documentclass[UTF8]{ctexart} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \pagestyle{empty} % 无页眉页脚 \tikzstyle{startstop} = [rectangle,rounded corners, minimum width=3cm,minimum height=1cm,text centered, draw=black,fill=red!30] \tikzstyle{io} = [trapezium, trapezium left angle = 70,trapezium right angle=110,minimum width=3cm,minimum height=1cm,text centered,draw=black,fill=blue!30] \tikzstyle{process} = [rectangle,minimum width=3cm,minimum height=1cm,text centered,text width =3cm,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{tikzpicture}[node distance=2cm] \node (start) [startstop] {Start}; \node (input1) [io,below of=start] {Input}; \node (process1) [process,below of=input1] {Process 1}; \node (decision1) [decision,below of=process1,yshift=-0.5cm] {Decession 1}; \node (process2a) [process,below of=decision1,yshift=-0.5cm] {Process 2aaaaaa aaaaaaa aaaa}; \node (process2b) [process,right of =decision1,xshift=2cm] {Process 2b}; \node (out1) [io,below of=process2a] {Output}; \node (stop) [startstop,below of=out1] {Stop}; \draw [arrow] (start) -- (input1); \draw [arrow] (input1) -- (process1); \draw [arrow] (process1) -- (decision1); \draw [arrow] (decision1) -- node[anchor=east] {yes} (process2a); \draw [arrow] (decision1) -- node[anchor=south] {no} (process2b); \draw [arrow] (process2b) |- (process1); \draw [arrow] (process2a) -- (out1); \draw [arrow] (out1) -- (stop); \end{tikzpicture} \end{document} ``` 这段代码在我的系统中运行没有任何问题。 发行版:texlive 2019 操作系统:wsl in windows 10 ![](https://wenda.latexstudio.net/data/attach/191009/XdVo7F30.png)
0
`--` 不要写成 —
  • 回复 fan1984 :把`--`写成—就是语法错误,你怎么能得到箭头和程序框图呢!是不是直接拷贝的不好的网站上的代码? – registor 2019-10-10 09:39 回复
  • 但是我运行的怎么没有任何箭头和程序框图 – fan1984 2019-10-09 17:14 回复

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。