首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Latex流程图:如何将标签移动到空白

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

Stack Overflow用户
提问于 2017-05-03 06:39:19
回答 1查看 3.7K关注 0票数 0

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

当然,根据这些守则:

代码语言:javascript
复制
%!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移动到两边的空白?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-03 06:55:36

使用附加的leftabove属性:

\draw [arrow](dec1) -| node[anchor=north, left] {Doch} (out1);

\draw [arrow](dec1) -| node[anchor=north, above] {Doch} (out1);应该能做到这一点。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43752817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档