2

I am switching all of the arrow tips in tikzcd from the default ones to angle 45 in the tikz arrows library. When I attempt to apply it to the double-arrows using tikzcd implies/.tip, the tip of the arrow appears to be overly large. How can I resize the tip so that it is of the same size as the tip of the to arrows?

enter image description here

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}

\tikzcdset{%
arrow style=tikz,
diagrams={>=angle 45},
tikzcd implies/.tip={>}
}

\begin{document}
\[
\begin{tikzcd}
A \arrow[r, bend left=50, ""{name=U, below}] \arrow[r, bend right=50, ""{name=D}] & 
B \arrow[Rightarrow,from=U,to=D]
\end{tikzcd}
\]
\end{document}
3
  • 1
    Is there a reason to creat such style? If you comment the lines containing the style you will get the correct arrow tip for Rightarrow Commented Jul 5, 2021 at 21:40
  • @Luis Turcio It's just a personal preference. Because the default implies tips are curvy, I think they do not look good with the straight edges of angle 45.
    – FR09
    Commented Jul 6, 2021 at 0:28
  • Sort of known limitation, github.com/astoff/tikz-cd/issues/1. Commented Jul 6, 2021 at 18:08

2 Answers 2

1

I suggest to use the specific line tikzcd implies/.tip={Implies} instead of tikzcd implies/.tip={>}.

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}

\tikzcdset{%
arrow style=tikz,
diagrams={>=angle 45},
tikzcd implies/.tip={Implies}
}

\begin{document}
\[
\begin{tikzcd}
A \arrow[r, bend left=50, ""{name=U, below}] \arrow[r, bend right=50, ""{name=D}] & 
B \arrow[Rightarrow,from=U,to=D]
\end{tikzcd}
\]
\end{document}

In fact you will have the correct tips for implies. Here there is the snapshot:

enter image description here

If you, one day, to use an old package called xy, with the option 2cell, you will obtain this (I have used the parameter <5> to increase the arcs):

\documentclass[a4paper,12pt]{standalone}
\usepackage[all,cmtip,2cell]{xy}
\UseAllTwocells
\begin{document}
\xymatrix{ A\rtwocell<5> &B}
\end{document}

enter image description here

2
  • 1
    Thank you for your help, however I am using implies/.tip={>} because I want to use angle 45 for the implies tips specifically, otherwise tikzcd implies/.tip={Implies} seems to be the default option, which is not required inside of \tikzcdset.
    – FR09
    Commented Jul 6, 2021 at 0:11
  • @FR09 Oh, hi. Don't worry if I have not given a true help. I not thing that it is possible to reproduce the angle 45 for the implies. I have seen also the option of implies here: webcache.googleusercontent.com/… and I not see the possibility to have the correct .tip={>}. Probably that you can create a macro with a specific implies with the same tips of the bend: see this link latexdraw.com/exploring-tikz-arrows using \usetikzlibrary{arrows.meta}
    – Sebastiano
    Commented Jul 6, 2021 at 14:30
1

To get straight lines in the arrow tips I suggest to use Straight Barb tips. With the defaults they look like this:

enter image description here

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}

\tikzcdset{%
arrow style=tikz,
diagrams={>={Straight Barb}},
tikzcd implies/.tip={Straight Barb[scale=0.5]}
}

\begin{document}
\[
\begin{tikzcd}
A \arrow[r, bend left=50, ""{name=U, below}] \arrow[r, bend right=50, ""{name=D}] & 
B \arrow[Rightarrow,from=U,to=D]
\end{tikzcd}
\]
\end{document}

If you prefer the 45 degrees of the tip you can add the angle key as follows

diagrams={>={Straight Barb[angle=45:4pt]}},

there are more keys to control the look of the tip, like width or length

Edit

After a quick read of the tikz/pgf manual, in section 16.4.3 you can see a quick "fix" for the overlapping problem of the tip (note the . added to both tips), I also make the angle tips equal to 45 degrees:

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{arrows, arrows.meta}

\tikzcdset{%
arrow style=tikz,
diagrams={>={.Straight Barb[angle=45:4pt]}},
tikzcd implies/.tip={.Straight Barb[angle=45:6pt]}
}

\begin{document}
\[
\begin{tikzcd}
A \arrow[r, bend left=50, ""{name=U, below}] \arrow[r, bend right=50, ""{name=D}] & 
B \arrow[Rightarrow,from=U,to=D]
\end{tikzcd}
\]
\end{document}

With this separation between the line and the tip you can also avoid the problem of the tip at 45 degrees not centered with respect to the line.

enter image description here

5
  • 1
    Hi; I have read your answer and I have appreciated it. For my humblest opinion like I thought give a strange and unusual effect for the tip of implies. +1
    – Sebastiano
    Commented Jul 6, 2021 at 14:47
  • 1
    Yes, I see the tip not placed at the very end. At the moment I am not sure how to make that correction. In a moment I will read tikz documentation, but any correction is welcome Commented Jul 6, 2021 at 17:30
  • I think that the tip with the tickness of the implies give a ugly impact with tikzcd implies/.tip={.Straight Barb[angle=45:6pt]}.
    – Sebastiano
    Commented Jul 6, 2021 at 22:36
  • Then, the only possibility I can think is to create an arrow style from scratch Commented Jul 7, 2021 at 0:39
  • No :-) just if you can decrease the distance of the > with the = sign, it is better.
    – Sebastiano
    Commented Jul 7, 2021 at 11:49

You must log in to answer this question.

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