3

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:

enter image description here

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

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

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

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

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.

Output

enter image description here

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}
| improve this answer | |
  • 1
    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 at 13:54
  • 1
    @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 at 15:14
  • Let me know if something is still unclear. – Alenanno Oct 20 at 15:14

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.