TikZ - 強製文字在節點內居中

TikZ - 強製文字在節點內居中

我有下面的程式碼......它做了我想要的一切,除了底部節點內的「*」不居中。我想使用像 \ast 這樣的符號,但沒有成功。類似地,分別位於左上角和右上角節點上的文字「輸入 x」和「輸入 y」不在「訊號」區塊的中間。

有什麼方法可以使文字強制進入節點的正中間嗎?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning,shapes.symbols}

\tikzstyle{decision} = [diamond, draw, fill=blue!20,
    text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]

\tikzstyle{block} = [signal, draw, signal to=south,
    text width=4.5em, rounded corners]

\tikzstyle{line} = [draw, -latex]

\tikzstyle{cloud} = [draw, ellipse, node distance=3cm, minimum height=3em, minimum width=3em]

%\tikzstyle{signal} = [signal, draw, signal to=south]


\tikzset{
  mycustomnode/.style={
    draw,
    single arrow,
    single arrow head extend=0,
    shape border uses incircle,
    shape border rotate=-90,
  }
}

\begin{document}
\begin{tikzpicture}[node distance = 2cm, auto]
    block/.style={signal, draw, signal to=south}]
    % Place nodes
    \node [cloud, line width=2pt] (init) {\huge +};
    \node [line width=2pt, text depth=0.25ex, text width=5em, block, above left of=init, node distance=10em] (inputx) {Input x};
    \node [line width=2pt, block, above right of=init, node distance=10em] (inputy) {Input y};
    \node [line width=2pt, cloud, below of=init, node distance=10em] (*) {\huge *};
    % Draw arrows
    \path[->, line width=2pt]
     (inputx) edge (init)
     (inputy) edge (init);
    \path[->, line width=2pt] ([xshift=1ex]init.south) edge ([xshift=1ex]*.north);
    \path[->, line width=2pt] ([xshift=-1ex]init.south) edge ([xshift=-1ex]*.north);

\end{tikzpicture}
\end{document}

相關內容