tikz:更大的箭头,合并线条

tikz:更大的箭头,合并线条

我正在尝试在方程式之间添加箭头TikZ,但遇到了一些问题。

首先,我不知道如何使线条变粗、箭头变大。

其次,我不知道如何让从两个不同节点出来的线合并形成指向第三个节点的箭头。下面是一些显示基本布局的代码,后面是一张显示我此时代码所在位置的图像(我希望所有红线都合并)。以下是一些图像此主题很好地展示了我想要的东西,但我不知道如何将这些东西应用到我的情况中。

\documentclass[]{beamer}
\def\newblock{\hskip .11em plus .33em minus .07em}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}

\begin{document}
\begin{frame}
\begin{block}{Block title goes here}                        

Some text here.

        \begin{tikzpicture}
        % \draw[style=help lines] (-1cm,0cm) grid[step=1cm] (5cm,5cm); % These don't work for some reason.
            \node (e0) at (2, 0.0) {$p_{a,i} + p_{n,i} = 1$} ;
            \node (e1) at (2, -0.5) {$E_i = p_{a,i}*\overline{F_a} + (1 - p_{a,i})*\overline{F_n}$} ;
            \node (e2) at (2, -1.0) {$S = \sum^N_{i=1}(E_i - D_i)^2$} ;
            \node (e3) at (1, -2.0) {$\frac{\partial S}{\partial \overline{F_n}} = 0$} ;
            \node (e4) at (1, -4.0) {$\overline{F_a} = \frac{\overline{D}}{\overline{p_a}} + (1 - \frac{1}{\overline{p_a}})\overline{F_n}$} ;
            \node (e5) at (6, -2.0) {$\frac{\partial S}{\partial \overline{F_a}} = 0$} ;
            \node (e6) at (6, -5.0) {$\overline{F_n} = \overline{D} - \frac{covariance(p_a,D)}{variance(p_a)}\overline{p_a}$} ;

        \node (n1) at (5, -4.0) {} ;

        \draw[->] (e2) to (e3) ;
        \draw[->] (e2) to (e5) ;
        \draw[->] (e3) to (e4) ;
        \draw[] (e4) to (n1) ;
        \draw[] (e5) to (n1) ;
        \draw[->] (n1) to (e6) ;

        \end{tikzpicture}       

\end{block}

\end{frame}
\end{document}

图片 1

编辑于 4 月 11 日下午 7:10(美国东部时间):更改代码以更清楚地说明问题,并反映阅读后所做的更改此主题

答案1

定义箭头相交的辅助点是个好主意。与其使用node,不如使用\coordinate (<name>) at (<location>);。这样可以省去使用 定义空节点文本的麻烦{},而且可以使线条的连接更加容易,因为coordinate(只是 的简写\node [coordinate] (<name>) at (<location>) {};)不占用空间。

要获得曲线,您可以使用路径的in=<angle>和选项。确保进入辅助节点的两条路径具有相同的角度,并且离开辅助节点的路径具有相同的角度。这样,线条就会平滑地连接起来。out=<angle>totointo<angle + 180>out

为了节省输入常用选项的时间,您可以使用\begin{scope}[<options>] ... \end{scope},它将<options>应用于范围内的所有命令。例如,您可以将scope和 选项一起使用very thick, -stealth以获得带箭头的粗线stealth。要关闭某些线的箭头,您可以将选项传递-给这些线。

\documentclass[]{beamer}
\def\newblock{\hskip .11em plus .33em minus .07em}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}

\begin{document}
\begin{frame}
\begin{block}{Block title goes here}                        

Some text here.

        \begin{tikzpicture}
        % \draw[style=help lines] (-1cm,0cm) grid[step=1cm] (5cm,5cm); % These don't work for some reason.
            \node (e0) at (2, 0.0) {$p_{a,i} + p_{n,i} = 1$} ;
            \node (e1) at (2, -0.5) {$E_i = p_{a,i}*\overline{F_a} + (1 - p_{a,i})*\overline{F_n}$} ;
            \node (e2) at (2, -1.0) {$S = \sum^N_{i=1}(E_i - D_i)^2$} ;
            \node (e3) at (1, -2.0) {$\frac{\partial S}{\partial \overline{F_n}} = 0$} ;
            \node (e4) at (1, -4.0) {$\overline{F_a} = \frac{\overline{D}}{\overline{p_a}} + (1 - \frac{1}{\overline{p_a}})\overline{F_n}$} ;
            \node (e5) at (6, -2.0) {$\frac{\partial S}{\partial \overline{F_a}} = 0$} ;
            \node (e6) at (6, -5.0) {$\overline{F_n} = \overline{D} - \frac{covariance(p_a,D)}{variance(p_a)}\overline{p_a}$} ;

        \coordinate (n1) at (5.2, -4.2);
        \begin{scope}[very thick, -stealth]
        \draw (e2) to (e3) ;
        \draw (e2) to (e5) ;
        \draw (e3) to (e4) ;
        \draw[-] (e4) to [in=135, out=0] (n1) ;
        \draw[-] (e5) to [in=135, out=-90] (n1) ;
        \draw (n1) to [out=-45] (e6) ;
        \end{scope}
        \end{tikzpicture}       

\end{block}

\end{frame}
\end{document}

相关内容