# Turnstile arrow in tikz-cd

I want to produce a "turnstile" ie \vdash style arrow in tikz-cd.

I can do it with option [maps to, no head] but then the vertical bar appears too short:

\documentclass{article}
\usepackage{tikz-cd}
\tikzcdset{arrow style=tikz}
\usepackage{tikz}

\begin{document}
$$\begin{tikzcd} A \arrow[r, maps to, no head, "F"] & B \end{tikzcd}$$
\end{document}


What is the simplest way to add a longer vertical bar to the tail?

• Please give a fully compilable code of your attemp. – AndréC Oct 20 '20 at 6:27

You were quite close, I changed maps to to tail, not a huge difference in the result, but in my case you're just saying "I want the tail" rather than "I want this arrow". We will be keeping the no head.

The major change, or rather addition, I did was to add a style to tikzcdset.

## Code

\documentclass[margin=10pt]{standalone}
\usepackage{tikz-cd} % no need to load tikz, since tikz-cd already loads it

% \usetikzlibrary{arrows.meta} % you can uncomment this if you want more arrow types

\tikzcdset{
arrow style=tikz,
diagrams={>={|[scale=2]}}
}

\begin{document}
\begin{tikzcd}
A \arrow[r, tail, no head,"F"] & B
\end{tikzcd}
\end{document}

• Thanks! Can you explain the diagrams line? It seems to have changed the tail shape, otherwise it would not be a vertical line. – Yan King Yin Oct 20 '20 at 13:54
• @YanKingYin Sure! The diagrams command is used to change the style of the diagrams, I used it for the arrow appearance for example. So it's diagrams={ <options> }. Inside of it, I said >= which means "arrow tip is". Then with {|[scale=2]} I specify the arrow tip | with a scale to make it bigger. If you remove "no head", you'll see the arrow will look like |----|. I couldn't find an option to define only the tail and there might not be one. You can see more in the tikz-cd manual – Alenanno Oct 20 '20 at 15:14
• Let me know if something is still unclear. – Alenanno Oct 20 '20 at 15:14

I found a simpler solution, combining ideas from this answer:

\begin{tikzcd}[| /.tip = {Bar[scale=2]}]
A  \arrow[r, |-]  B
\end{tikzcd}


Also, the first answer has the problem that it changes all diagrams in the document, but this one affects only the current diagram.