tikz钻石节点空白

tikz钻石节点空白

我想知道如何删除以下 MWE 中菱形节点和链接之间的空白。

\documentclass[10pt]{article}

\usepackage{tikz}
\usetikzlibrary{positioning,shapes,arrows}

\usepackage[a4paper, margin=0.2in, includefoot]{geometry}

\usepackage{fontspec,lipsum}
\defaultfontfeatures{Ligatures=TeX}
\setromanfont{Century Gothic}

\begin{document}

\tikzset{font=\Large,
every node/.style=
    {rectangle,rounded corners,
    draw=black,
    very thick,
    align=center
    }}

\begin{tikzpicture}[node distance = 2cm, auto]
\node (a) {AAAAA};
\node[diamond, below=of a] (R) {BBBBB};
\node[below right=of R](d){CCCCC};
\draw[->][ultra thick](R.east) -| node[above, draw=none,near start,yshift=0.1cm] {No} (d.north);
\draw[->][ultra thick](a.south) -- (R.north);
\end{tikzpicture}

\end{document}

答案1

圆角修改了原本应该是尖角的路径,但没有相应地移动锚点。快速修复方法是添加shorten <shorten >键来微调路径的起点/终点

\documentclass[10pt]{article}

\usepackage{tikz}
\usetikzlibrary{positioning,shapes,arrows}

\usepackage[a4paper, margin=0.2in, includefoot]{geometry}

\usepackage{fontspec,lipsum}
\defaultfontfeatures{Ligatures=TeX}
\setromanfont{Century Gothic}

\begin{document}

\tikzset{font=\Large,
every node/.style=
    {rectangle,rounded corners,
    draw=black,
    very thick,
    align=center
    }}

\begin{tikzpicture}[node distance = 2cm, auto]
\node (a) {AAAAA};
\node[diamond, below=of a] (R) {BBBBB};
\node[below right=of R](d){CCCCC};
\draw[->,shorten <=-2pt][ultra thick](R.east) -| node[above, draw=none,near start,yshift=0.1cm] {No} (d.north);
\draw[->,shorten >=-2pt][ultra thick](a.south) -- (R.north);
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容