如何改变 tikz 中箭头的路径?

如何改变 tikz 中箭头的路径?

基本上,我希望箭头穿过节点而不是穿过节点,我唯一的解决方案是将目标节点向下移动 5 毫米,但如何在不移动节点的情况下实现这一点?我该如何更改箭头?

\documentclass[a4paper,12p]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, automata, backgrounds, positioning, fit,petri}

\setlength\parindent{0pt}

\title{Hausaufgabe 18, Potenzmengenkonstruktion}
\date{\today}

%\hspace{5mm}

\begin{document}

\begin{tikzpicture}[shorten > = 1pt, > = {Stealth}]
        \node[state] (s0s3) {$ \{s_{0}, s_{3}\} $};
        \node (start) [left = of s0s3, xshift = 3mm] {};
        \node[state] (s3) [below right = of s0s3] {$ \{s_{3}\} $};
        \node[state] (nothing) [right = of s3] {$ \{\varnothing\} $};
        \node[state, accepting] (s1s3) [right = of s0s3, xshift = 1cm] {$ \{s_{1}, s_{3}\} $};
        \node[state, accepting] (s1s2s3) [above left = of s1s3] {$ \{s_{1}, s_{2}, s_{3}\} $};
        \node[state] (s4s5) [above right = of s1s3] {$ \{s_{4}, s_{5}\} $};
        
        \path[->] (start) edge (s0s3)
        (s0s3) edge node [above] {$ a $} (s1s3)
        edge [bend right = 15] node [right, yshift = 2mm] {$ b $} (s3)
        (s3) edge node [above] {$ b $} (nothing)
        edge [bend left = 25] node [left] {$ a $} (s1s3)
        (s1s3) edge [bend right = 45] node [left, yshift = -2mm] {$ a $} (s1s2s3)
        edge [bend left = 45] node [right, yshift = -2mm] {$ b $} (s4s5)
        (s1s2s3) edge [loop above] node [above] {$ a $} (s1s2s3)
        edge [bend left = 30] node [above] {$ b $} (s4s5)
        (s4s5) edge [bend left = 30] node [right] {$ a $} (nothing)
        edge [bend left = 120] node [right, yshift = -2mm] {$ b $} (s3);
    \end{tikzpicture}

\end{document}

右边的 b arrowq,从 s4s5 到 s3

答案1

looseness为边缘添加一个因子可解决该问题。默认值为looseness=1。值为 0 将产生一条直线。

edge [bend left = 120, looseness=1.5] node [right, yshift = -2mm] {$ b $} (s3);

在此处输入图片描述

相关内容