2

I'm trying to diagram a mathematical concept, but for some reason the symbol is tilted and the labels are not centered. I've tried tweaking parameters such as pos, but there must be a better way in general:

\[
\begin{tikzcd}
\Gph\arrow[r,bend left,"F_C",""{name=A, below}] & \Cat\arrow[l,bend left,"U_G",""{name=B,above}] \arrow[from=A, to=B, symbol=\dashv] \arrow[r,bend left,"F_P",""{name=C, below}] & \Pos \arrow[l,bend left,"U_C",""{name=D,above}] \arrow[r,bend left,"U_S",""{name=E, below}] \arrow[from=C, to=D, symbol=\dashv] & \Set \arrow[l,bend left,"F_P",""{name=F,above}] \arrow[from=F, to=E, symbol=\dashv]
\end{tikzcd}
\]

result

Please let me know a more systematic way to make these diagrams; thank you!

  • 1
    Welcome to TeX.SE! Please provide an MWE. What do the commands \Gph, \Cat and so on do? – user121799 Apr 13 '18 at 5:50
  • Thanks! I thought my question did provide an MWE. The commands just print the corresponding names in non-math font. – Christian Williams Apr 13 '18 at 7:19
6

I just reworked your entry as follows.

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

\def\ac{\rotatebox[origin=c]{90}{$\dashv$}} %rotate dash anti-cw
\def\cw{\rotatebox[origin=c]{-90}{$\dashv$}} %rotate dash cw
%\tikzset{adj/.style={pos=0.545,outer sep=3pt}} %adjust label position along path

\begin{document}
\begin{tikzcd}[column sep=small]
    Gph \arrow[bend left,below]{rr}{F_C}
    & \cw &
    \arrow[bend left,above]{ll}{U_G} Cat \arrow[bend left,below]{rr}{F_P}
    %\arrow[bend left,above, adj]{ll}{U_G} Cat \arrow[bend left,below]{rr}{F_P}
    & \dashv &
    \arrow[bend left,above]{ll}{U_C} Pos \arrow[bend left,below]{rr}{U_S}
    & \ac &
    Set \arrow[bend left,above]{ll}{F_P}
\end{tikzcd}
\end{document} 

enter image description here

I have also added code to rotate the \dashv symbol. Showing the normal \dashv and the clockwise and anticlockwise rotations.

Added a command (commented out) for adjusting the position of a label along the arrow, and its distance from the line. You can play around with values until you get a result you like. Below, the first picture shows the resulting misplaced label with 'column sep = tiny'.

enter image description here

The subsequent picture using the commented out commands adjust the label position to be aligned vertically with the other label, and showing that you can push the label further from the line by 3pt.

enter image description here

  • 1
    Thanks so much; works perfectly. This will probably help another category theorist in the future. – Christian Williams Apr 13 '18 at 7:17
  • Just a note, if you set 'column sep = tiny' the U_G label will not line up, and will appear as in your initial figure. – Dunk the Lunk Apr 13 '18 at 7:23
2

A different approch to the original code.

enter image description here

\documentclass{article}
\usepackage{tikz-cd}
\newcommand{\pdashv}{\rotatebox[origin=c]{-90}{$\dashv$}}
\newcommand{\vdashv}{\rotatebox[origin=c]{0}{$\dashv$}}
\newcommand{\sdashv}{\rotatebox[origin=c]{90}{$\dashv$}}
\begin{document}
\begin{tikzcd}
Gph \arrow[rr, "F_C", bend left] & \pdashv & Cat 
\arrow[ll, "U_G", bend left] 
\arrow[rr, "F_P", bend left] & \vdashv & Pos \arrow[ll, "U_C", bend left] 
\arrow[rr, "U_S", bend left] & \sdashv & Set \arrow[ll, "F_P", bend left]
\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.