![添加间距以避免箭头超出标签](https://linux22.com/image/404426/%E6%B7%BB%E5%8A%A0%E9%97%B4%E8%B7%9D%E4%BB%A5%E9%81%BF%E5%85%8D%E7%AE%AD%E5%A4%B4%E8%B6%85%E5%87%BA%E6%A0%87%E7%AD%BE.png)
我有以下 MWE
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,calc}
\tikzset{%
block/.style = {draw, thick, rectangle, node distance=3em, minimum height = 3em,
minimum width = 3em, align=center}
}
\begin{document}
\begin{tikzpicture}[auto, thick, >=triangle 45]
\draw node [block] (b) {B};
\draw node [block, above left=of b, label=below:Label] (a) {A};
\draw[->](a) |- (b);
\end{tikzpicture}
\end{document}
以及相应的图像:
如何减少长度/移动箭头的起点以使其不绘制在标签上方?
答案1
欢迎!您可以给标签命名并连接标签而不是节点。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,calc}
\tikzset{%
block/.style = {draw, thick, rectangle, node distance=3em, minimum height = 3em,
minimum width = 3em, align=center}
}
\begin{document}
\begin{tikzpicture}[auto, thick, >=triangle 45]
\draw node [block] (b) {B};
\draw node [block, above left=of b, label={[name=aLabel]below:Label}] (a) {A};
\draw[->](aLabel) |- (b);
\end{tikzpicture}
\end{document}
答案2
像这样?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,calc}
\tikzset{%
block/.style = {draw, thick, rectangle, node distance=3em, minimum height = 3em,
minimum width = 3em, align=center}
}
\begin{document}
\begin{tikzpicture}[auto, thick, >=triangle 45]
\draw node [block] (b) {B};
\draw node [block, above left=of b] (a) {A};
\draw (a.south) node [below] (a2) {Label};
\draw[->](a2.south) |- (b);
\end{tikzpicture}
\end{document}