10

I'm drawing a BIG tikzpicture using the tikz-cd package. I won't reproduce the entire diagram here as there's no need. But the following MWE highlights the problem I'm having which is this: One region of the diagram is a little crowded and I would like to nudge the starting position of one edge to, say, the east of the source node. However, when I specify the coordinate for the source node an unwanted tip appears on the source end of the arrow. Here's the code:

\documentclass[11pt]{article}

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

\title{}
\date{}                                          
\tikzset{
   commutative diagrams/.cd,
   arrow style = tikz,
   diagrams={>=latex}}

\begin{document}
\begin{tikzpicture}[commutative diagrams/every diagram,column sep = 3em]
       \matrix (m) [matrix of math nodes, nodes in empty cells]{
       |(A)|A\\
       |(B)|B\\
       };
       \path [commutative diagrams/.cd, every arrow, every label] 
          (B.north east) edge [bend right, dashed] (A.east)
          (B) edge [bend left] (A.west)
       ;
    \end{tikzpicture}
\end{document}

Here's the output this example produces. You can see the extra tip on the dashed line.

Rogue arrow tip at source

Recall, I am deliberately NOT using the {tikzcd} environment because I have a LOT of nodes and edges and may need to change the locations of some of the nodes as I add to the diagram.

Any suggestions for how I can move the starting position of the arrow within the tikzpicture environment using edge paths?

2 Answers 2

8

edge is a bit of a strange beast, and you need to use to here instead:

Sample output

\documentclass[11pt]{article}

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

\title{}
\date{}                                          
\tikzset{
   commutative diagrams/.cd,
   arrow style = tikz,
   diagrams={>=latex}}

\begin{document}
\begin{tikzpicture}[commutative diagrams/every diagram,column sep = 3em]
       \matrix (m) [matrix of math nodes, nodes in empty cells]{
       |(A)|A\\
       |(B)|B\\
       };
       \draw[commutative diagrams/.cd, every arrow, every label,dashed] 
          (B.north east) to [bend right, dashed] (A.east);
       \draw[commutative diagrams/.cd, every arrow, every label] 
          (B) edge [bend left] (A.west);
    \end{tikzpicture}
\end{document}

I think what is happending with the edge is that there are two paths, the first a very short one from (B) to (B.north east). But I haven't yet be able to verify this.

Update: thanks to the pointer to https://tex.stackexchange.com/a/82495/15925 from Torbjørn T. this is indeed the case. In your code the main path, i.e. with the edge parts removed, is

   \draw[commutative diagrams/.cd, every arrow, every label,dashed] 
      (B.north east)
      (B);

which in the above code produces

Test output

with the strangely placed arrowhead you experienced.

The full code for this last diagram is:

\documentclass[11pt]{article}

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

\title{}
\date{}                                          
\tikzset{
   commutative diagrams/.cd,
   arrow style = tikz,
   diagrams={>=latex}}

\begin{document}
\begin{tikzpicture}[commutative diagrams/every diagram,column sep = 3em]
       \matrix (m) [matrix of math nodes, nodes in empty cells]{
       |(A)|A\\
       |(B)|B\\
       };
       \draw[commutative diagrams/.cd, every arrow, every label,dashed] 
          (B.north east)
          (B);
    \end{tikzpicture}
\end{document}
3
  • 1
    Ah, yes, that does the trick! Many thanks. I must say how impressed I am with how helpful and knowledgeable everyone is here. :-) Commented Apr 4, 2014 at 15:50
  • tex.stackexchange.com/a/82495/586 may be of interest. Commented May 21, 2014 at 17:03
  • @TorbjørnT. Great - that indeed gives the reason. Commented May 21, 2014 at 18:28
1

I have used a minimal code using, also, tikz-cd.

enter image description here

\documentclass[a4paper,12pt]{article}

\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
\mathit{A}\\
\mathit{B} \arrow[u, bend left] \arrow[u, dashed, bend right]
\end{tikzcd}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .