Latex tikz流程图:如何将标签移动到空白处

Latex tikz流程图:如何将标签移动到空白处,latex,flowchart,tikz,xelatex,Latex,Flowchart,Tikz,Xelatex,我目前正在使用Latex制作流程图,我发现箭头穿过标签,如下所示: 当然,对于代码: %!TEX program = xelatex UTF8 \documentclass[UTF8]{ctexart} \usepackage{tikz,mathpazo} \usepackage{graphicx,amssymb,amstext,amsmath,newtxmath} \usetikzlibrary{shapes.geometric, arrows} \begin{document} \this

我目前正在使用Latex制作流程图,我发现箭头穿过标签,如下所示:

当然,对于代码:

%!TEX program = xelatex UTF8
\documentclass[UTF8]{ctexart}
\usepackage{tikz,mathpazo}
\usepackage{graphicx,amssymb,amstext,amsmath,newtxmath}
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
\thispagestyle{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, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [->,>=stealth]

\begin{tikzpicture}[node distance=2cm]
\node (start) [startstop] {Start};
\node (in1) [io, below of=start] {Input 1};
\node (pro1) [process, below of=in1] {Process 1};
\node (dec1) [decision, below of=pro1, yshift=-0.5cm] {Decision 1};
\node (out1) [io, left of=dec1,xshift=-2cm,yshift=-2cm] {Out 1};
\node (stop) [startstop, below of=out1] {Stop};
\node (dec2) [decision,right of=dec1,xshift=2cm,yshift=-2cm] {Decision 2};
\node (pro2) [process, right of=dec2, xshift=2cm] {Process 2};
\node (pro3) [process, below of=dec2, yshift=-0.5cm] {Process 3};

\draw [arrow](start) -- (in1);
\draw [arrow](in1) -- (pro1);
\draw [arrow](pro1) -- (dec1);
\draw [arrow](dec1) -| node[anchor=north] {Doch} (out1);
\draw [arrow](out1) -- (stop);
\draw [arrow](dec1) |- node[anchor=east] {Nein} (dec2);
\draw [arrow](dec2) -- node[anchor=east] {Nein} (pro3);
\draw [arrow](dec2) -- node[anchor=south] {Ja} (pro2);
\draw [arrow](pro2) |- (dec1);

\end{tikzpicture}
\end{document}

如何将标签DOCH移动到边上的空白空间?< /P> < P>使用附加的<代码>左<代码>或<代码> > 属性:

\draw[arrow](dec1)|节点[anchor=north,left]{Doch}(out1)

\draw[arrow](dec1)| node[anchor=north,在上面]{Doch}(out1)
应该可以做到这一点。

使用一个额外的
上的
属性:
\draw[arrow](dec1)|节点[anchor=north,left]{Doch}(out1)
\draw[arrow](dec1)| node[anchor=north,在上面]{Doch}(out1)应该可以做到这一点