2017-05-03 15 views
0

空白にラベルを移動し、私は矢印は、このようなラベルを通過することが判明する方法:コードと確かラテックスは、TikZフローチャート:私は現在、フローチャートを作るためにラテックスを使用してい

enter image description here

%!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ラベルを両サイドの空白スペースに移動するにはどうすればよいですか?トリックを行う必要があります
\draw [arrow](dec1) -| node[anchor=north, left] {Doch} (out1);または
\draw [arrow](dec1) -| node[anchor=north, above] {Doch} (out1);

答えて

2

は、追加leftまたはabove属性を使用します。

+0

thx a lot!できます。 –