Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to add arrows between equations using TikZ and I'm having some issues.

First, I can't figure out how to make the lines thicker and the arrowheads bigger.

Second, I can't figure out how to get lines coming out of two different nodes that merge to form an arrow pointing at a third node. Here is some code showing the basic layout, followed by an image showing where I'm at with the code at this point (I want the red lines all merged). Some of the images at this thread show what I want quite nicely, but I can't figure out how to apply that stuff to my situation.

\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}

image 1

EDIT Apr. 11 at 7:10 pm EDT: Changed code to more clearly illustrate the problem, and to reflect changes made after reading this thread.

share|improve this question
1  
You can check the manual for the options [remember picture,overlay] and increase the [linewidth=X mm]. –  percusse Apr 11 '12 at 22:10
    
If I understand correctly, your problem is not how to draw lines between nodes defined in different tikzpictures, but how to draw the merged line, right? In that case, maybe you should reduce your example to one that doesn't use different tikzpictures, since it distracts from your actual issue. –  Jake Apr 11 '12 at 22:16
1  
Also do these examples in this question merge-arrows-with-tikz help? –  percusse Apr 11 '12 at 22:18
    
@percusse : Setting \pgfsetlinewidth{5pt} within the tikzpicture in question helped with the line thickness and arrowhead size issues, thanks! –  Sam Rabin Apr 11 '12 at 22:19
3  
@SamRabin: Instead of using the low level \pgfsetlinewidth, you can use the TikZ key line width=<width> in the options of your \draw command (so \draw [line width=3pt] (e2) to [out=-90, in=180] (e6);, for example). –  Jake Apr 11 '12 at 22:21
show 2 more comments

1 Answer

It's a good idea to define an auxiliary point where the arrows will meet. Instead of using a node, it's better to use a \coordinate (<name>) at (<location>);. That saves you the trouble of defining an empty node text using {}, and it will make the joining of the lines easier, since a coordinate (which is just shorthand for \node [coordinate] (<name>) at (<location>) {};) doesn't take up space.

To get curved lines, you can use the in=<angle> and out=<angle> options of the to paths. Make sure that both to paths that go into the auxiliary node have the same in angle, and that the to path leaving the auxiliary node has that <angle + 180> as the out angle. That way, the lines will join up smoothly.

To save yourself some typing with common options, you can use a \begin{scope}[<options>] ... \end{scope}, the <options> will apply to all commands within the scope. For example, you could use a scope with the options very thick, -stealth to get thick lines with stealth arrow tips. To switch off the arrow tips for some lines, you can pass the option - to those lines.

\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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.