0

I am drawing a diagram with nodes and arrows using Tikz, but do not have an idea how I can make an arrow branch into two.

I am using something very similar to this:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
  \matrix (m) [matrix of math nodes,row sep=3em,column sep=4em,minimum
    width=2em]
  {
     F_t(x) & F(x) \\
     A_t & A \\};
  \path[-stealth]
    (m-1-1) edge node [left] {$\mathcal{B}_X$} (m-2-1)
        edge [double] node [below] {$\mathcal{B}_t$} (m-1-2)
    (m-2-1.east|-m-2-2) edge node [below] {$\mathcal{B}_T$}
            node [above] {$\exists$} (m-2-2)
    (m-1-2) edge node [right] {$\mathcal{B}_T$} (m-2-2)
            edge [dashed,-] (m-2-1);
\end{tikzpicture}
\end{document}

Code reference

  • 5
    Welcome! What should it look like exactly? What is meant to branch? Every edge gets its own arrow tip, because that's how edges work. You can use regular path construction commands between nodes if you just want a tip at the end, say. – cfr Feb 25 '17 at 3:35
  • Do you mean something like the effect of \draw [->] (0,0) to[bend left] (-1,-2); \draw [->] (0,0) to[bend right] (1,-2);? – Torbjørn T. Feb 25 '17 at 8:24
1

My friend, I warmly suggest you the usage of tikzcd package. It truly makes life easier. You can find an exhaustive documentation here. And now onto the code. You'll see It's much shorter than the average painful tikz source:

\documentclass[a4paper]{report}

\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document}

\[
\begin{tikzcd}[column sep=large, row sep=large]
F_t(x) \arrow[d, "\mathcal{B}_X"'] \arrow[r, "\mathcal{B}_t"', rightharpoondown, shift right=0.25ex] \arrow[r, rightharpoonup, shift left=0.25ex] & F(x) \arrow[d, "\mathcal{B}_T"] \\
A_t \arrow[ru, dashrightarrow, dash] \arrow[r, "\exists", "\mathcal{B}_T"'] & A
\end{tikzcd}
\]

\end{document}

enter image description here

Or if you perhaps want two normal arrows pointing in the same direction:

\documentclass[a4paper]{report}

\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document}

\[
\begin{tikzcd}[column sep=large, row sep=large]
F_t(x) \arrow[d, "\mathcal{B}_X"'] \arrow[r, "\mathcal{B}_t"', shift right=0.65ex] \arrow[r, shift left=0.65ex] & F(x) \arrow[d, "\mathcal{B}_T"] \\
A_t \arrow[ru, dashrightarrow, dash] \arrow[r, "\exists", "\mathcal{B}_T"'] & A
\end{tikzcd}
\]

\end{document}

enter image description here

I'd be impolite if I didn't answer your question specifically. Perhaps you are very skilled in tikz and don't feel like jumping onto another package. I understand. Though I have to warn you that path is not the best way to go about. In fact (for commutative diagrams) it's pretty horrible. I rewrote the whole diagram because I wasn't able to find a solution in path environment. It kind of castrates a wide portion of functions tikz has to offer, like for example xshift and yshift I used to move the arrows. Here's a solution in plain tikz:

\documentclass{article}

\usepackage{amsmath}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[node distance=2.3cm, auto]
\node (A) {$F_t(x)$};
\node(B) [right of=A] {$F(x)$};
\node (C) [below of=A] {$A_t$};
\node (D) [right of=C] {$A$};
\draw[transform canvas={yshift=0.5ex},->] (A) -- (B);
\draw[transform canvas={yshift=-0.5ex},->](A) to node [below] {$\mathcal{B}_{t}$} (B); 
\draw[->](A) to node [left] {$\mathcal{B}_{X}$}(C);
\draw[->](B) to node {$\mathcal{B}_{T}$}(D);
\draw[->](C) to node [below] {$\mathcal{B}_{T}$}(D);
\draw[](C) to node [above] {$\exists$}(D);
\draw[dashed](B) to (C);
\end{tikzpicture}

\end{document}

enter image description here

I hope this post was helpful to you. I wish you a good day.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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