7

I'd like to construct diagrams such as

enter image description here,

preferably with tikz-cd, but I've no idea where to start. Please help :)

EDIT: This is what I have so far.

\begin{tikzcd}
\mathbf{C} \arrow[bend left=35]{r}[name=F]{F} & \mathbf{D}\arrow[bend left=35]{l}[name=U]{U}
\arrow[to path=(F) -- (U)]{d}{\vdash}
\end{tikzcd}

I've tried a few variations but I can't figure out how to get \vdash (or \bot , whichever).

  • 2
    The manual of tikz-cd could be a good place to start, there is an example on the top of page 9 that is partly similar to your image. – Torbjørn T. Nov 9 '13 at 14:57
  • 1
    No problem. If there is some part of your example that you are unable to achieve, just edit your question to include the code you already have, and explain what you cannot figure out. – Torbjørn T. Nov 9 '13 at 15:01
  • I can't get the $\vdash$ working :/ – Shaun Nov 9 '13 at 15:57
  • 1
    You need to do \arrow[to path=(F)--(U) \tikztonodes]{<doesnt matter, i.e. just leave it empty>}{\vdash}. Notice that \tikztonodes? – Qrrbrbirlbel Nov 9 '13 at 16:22
  • That works very well too, except that the arrow's still there. If I set the bend at about 20, though, with [description] before {\bot}, then it's almost what I'm after! Thank you. – Shaun Nov 9 '13 at 16:58
1

A minor point on Qrrbrbirlbel's answer: the \dashv should be rotated. This can be done as follows:

\documentclass{standalone}
\usepackage{tikz-cd}
\usepackage{amsfonts}

\begin{document}
\begin{tikzcd}
\mathbb{C}
\arrow[r, "F"{name=F}, bend left=25] &
\mathbb{B}
\arrow[l, "U"{name=G}, bend left=25]
%--- Adjunction Symbol
\arrow[phantom, from=F, to=G, "\dashv" rotate=-90, no line]
\end{tikzcd}
\end{document}

giving

7

If you want to avoud adding additional rows or column but instead want to use coordinates/nodes and a path between them to place nodes, you can use the following to styles:

  • from=<c1> to <c2> where <c1> and <c2> are coordinates/nodes (without parentheses).

    This translates to the to path: (<c1>) -- (<c2>)\tikztonodes.
    The \tikztonodes macro is needed so that nodes (like your \vdash) are placed on this path.

  • The no line style accomplishes two things:

    First, the line is not drawn (draw=none), and then for the “labels” (that tikz-cd-ish for “nodes along path”) the auto option is deactivated which, when activated, places the nodes at one of both sides of the path (left/right).

    The description styles does something similar as it forces the anchor to center (which resets the actions of auto) and applies a fill with the background color.

    As you don’t draw the line, there is no need to add a filling.

Similar shenanigans can be found in my answers to

Code

\documentclass[tikz]{standalone}
\usepackage{tikz-cd}
\tikzset{
  no line/.style={draw=none,
    commutative diagrams/every label/.append style={/tikz/auto=false}},
  from/.style args={#1 to #2}{to path={(#1)--(#2)\tikztonodes}}}
\begin{document}
\begin{tikzcd}
\mathbf{C} \arrow[bend left=35]{r}[name=F]{F}
   & \mathbf{D}\arrow[bend left=35]{l}[name=U]{U}
               \arrow[from=F to U, no line]{}{\vdash}
\end{tikzcd}
\end{document}

Output

enter image description here

  • from and to have been implemented in the meantime. Please remove your from/.style args and use \arrow[from=F, to=U, no line]{}{\vdash} as your last arrow. If the change has been implemented due to your great work here, you should post this edit as an "Update". Thank you. – LaRiFaRi Jan 25 '16 at 16:50
  • Shouldn't the adjunction symbol be rotated? I would use \perp instead of \vdash. – Morgan Rogers Jul 25 '17 at 7:54
4

As you're not drawing the vertical arrow in that example, you could instead add an additional column in the matrix to place the \vdash in the middle. You then have to modify the arrows to go two columns to the right/left, by adding an additional r/l in the first argument:

enter image description here

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}

\begin{tikzcd}
    \mathbf{C} \arrow[bend left=35]{rr}{F} % note {rr} instead of {r}
  & \vdash                                 % additional column for \vdash
  & \mathbf{D}\arrow[bend left=35]{ll}{U}  % note {ll} instead of {l}
\end{tikzcd}

\end{document}

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.