避免箭头穿过投影仪中的块TikZ的边界

避免箭头穿过投影仪中的块TikZ的边界

这是我的情况

我正在用 Beamer 写演示文稿,但是当向“客观情况”和“宏观背景”块添加箭头时,它们指向块内部,而不是指向边界。可以告诉我如何让箭头指向边界吗?

这是我的 MWE:

       \documentclass{beamer}
       \usetheme{Ilmenau}
       \usepackage[utf8]{inputenc}
       \usepackage{appendix}
       \usepackage[numberedbib]{apacite}
       \renewcommand\bibsection{\section[]{\refname}}
       \renewcommand\bibliographytypesize{\tiny}
       \usepackage{textpos}
       \usepackage{eurosym}
       \usepackage{tikz}
       \usetikzlibrary{shapes,arrows,positioning}
       \usetikzlibrary{positioning}

     \begin{document}

    \begin{frame}{}

    \tikzstyle{block} = [draw, fill=white, rectangle,  minimum height=3em, 
     minimum width=6em]
    \tikzstyle{pinstyle} = [pin edge={to-,thin,black}]

    \begin{figure}[!h]
    \begin{center}

  \begin{tikzpicture} [auto,>=latex',every node/.append style= 
 {font=\footnotesize}]

  \node [block, name=input, node distance=1cm] (a2) {Subjective perception};
\node [block, above=of input, yshift=1cm ](a5) {Objective situation};
\node [block, below=of input, yshift=-1cm] (a1) {Macro context};
\node [block, right=of a2] (a3) {Fertility intentions};
\node [block, right=of a3] (a4) {Fertility realizations};

\draw [->] (a5) -- (input);
\draw [->] (a1) -- (input);
\draw [->] (a2) -- (a3);
\draw [->] (a3) -- (a4);

 \end{tikzpicture}
 \end{center}
 \end{figure}
  \end{frame}


  \end{document}

答案1

您有\node [block, name=input, node distance=1cm] (a2) {Subjective perception};,因此您给节点命名两次,首先input是 然后是a2a2名称将覆盖input,因此您会收到错误no shape input is known。更改name=inputalias=input,然后您可以通过两个名称引用它。

相关内容