tikz 下括号末端多余的箭头

tikz 下括号末端多余的箭头

我正在尝试重现这个自动机:

这是我迄今为止所取得的成就:

这是我的 MWE:

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,decorations.pathreplacing}
\begin{document}
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm,scale = 1,transform shape,bend angle=10,accepting/.style={double distance=2pt, outer sep=0.75pt+\pgflinewidth}]

    \node[state,initial] (p_0) {$p_0$};
    \node[state] (p_1) [right of=p_0] {$p_1$};
    \node[state] (p_2) [right of=p_1] {$p_2$};
    \node (p_3) [right of=p_2] {$\dots$};
    \node[state] (p_k) [right of=p_3] {$p_k$};
    
    \path (p_0) edge              node {$0$} (p_1)
        (p_1) edge              node {$0$} (p_2)
        (p_2) edge              node {$0$} (p_3)
        (p_3) edge              node {$0$} (p_k);
        \draw[decorate,thick, decoration={brace, amplitude=10pt,mirror}] (p_0.south) -- (p_k.south)
          node [midway,below=10pt] {$k+1$};
\end{tikzpicture}\\
\end{document}

问题是,在我的代码中,下括号的末尾有一个箭头(不需要)。
我做了一个测试,我明白这是由于括号->内的原因。 有没有人能给我一些提示?谢谢!\begin{tikzpicture}

答案1

->从 的选项移至相关路径 的。此外,使用tikzpicture(或可能)。optionspositioningchains

\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,decorations.pathreplacing,positioning}
\begin{document}
\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=1.5cm,scale = 1,transform shape,bend angle=10,accepting/.style={double distance=2pt, outer sep=0.75pt+\pgflinewidth}]

    \node[state,initial] (p_0) {$p_0$};
    \node[state] (p_1) [right=of p_0] {$p_1$};
    \node[state] (p_2) [right=of p_1] {$p_2$};
    \node (p_3) [right=of p_2] {$\dots$};
    \node[state] (p_k) [right=of p_3] {$p_k$};
    
    \path[->] (p_0) edge              node {$0$} (p_1)
        (p_1) edge              node {$0$} (p_2)
        (p_2) edge              node {$0$} (p_3)
        (p_3) edge              node {$0$} (p_k);
    \draw[decorate,thick, decoration={brace, amplitude=10pt,mirror}] (p_0.south) -- (p_k.south)
          node [midway,below=10pt] {$k+1$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容