3

I am a beginner in latex. Please help me draw this category theory diagram via latex. I have tried this code, but working:

\begin{tikzcd}
A \arrow[dd, bend right, shift right=2] \arrow[rrr, bend left, shift left] &  &  & B \arrow[lll, bend left, shift left] \arrow[dd, bend left, shift left=2] & \colon  & P \\
                                                                           &  &  &                                                                          &         &   \\
C \arrow[uu, bend right, shift right=2]                                    &  &  & D \arrow[uu, bend left] \arrow[lll]                                      & \colon  & Q
\end{tikzcd}

enter image description here

4
  • 4
    Welcome to TeX.se, but this is not really how the site works. Post some code showing what you've tried and we can help you with that. A good place to start would be the tikz-cd package.
    – Alan Munn
    Commented Apr 28 at 14:52
  • @AlanMunn That is not a very good welcome with a downvote. I have added the code. But it is not working. Commented Apr 28 at 15:17
  • 3
    The downvote is not from me. But just posting an image and not showing what you've done isn't really helpful either. Also, it's much more helpful to post a compilable document rather than a code fragment.
    – Alan Munn
    Commented Apr 28 at 15:21
  • 1
    Dear OP: Glad you got a good answer! For future questions, what’s really helpful to include is a “minimal working example” as described here — briefly, a version of your document cut down to just the content relevant to the question, but still compilable. That makes it much, much easier for potential answerers to help you with your question. Commented Apr 28 at 15:44

1 Answer 1

6

Something like this seems to do what you want:

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=4em,row sep=4em,/tikz/column 2/.style={column sep=2em}]
A \arrow[r,bend left,"h"]
\arrow[d,bend right,swap,"f"]
    & C \arrow[l,bend left,"k"] \arrow[d,bend right,swap,"s"] &  : P\\
B \arrow[u,bend right,swap,"g"] & D \arrow[l]\arrow[u,bend right,swap,"t"] & : Q
\end{tikzcd}
\end{document}

output of code

0

You must log in to answer this question.

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