TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to include the diagram of a Kan extension in a beamer presentation (see the nLab page for an example). I've achieved to draw it through \xymatrix without the natural transformations symbol (the \Rightarrow), but I would like to put the symbol into the diagram. Does anybody know how to draw it?


share|improve this question
Sorry, I don't understand the but I would like to put them part. Also, drawing this shouldn't be beamer specific. I personally would just use TikZ for it. – Martin Scharrer May 24 '11 at 23:09
@Martin: I believe he means that he succeeded to draw the diagram without the ⇒, and now wants to know how to place a ⇒ into the middle. – Caramdir May 24 '11 at 23:40
+1 for referring to the nLab page! – Loop Space May 25 '11 at 21:37

If you click on the source link at the bottom of the nLab page, you will see that the diagram is produced with

    \mathbf{A} \ar[ddr]_F \ar[rr]^{P}  &             & \mathbf{B} \ar[ddl]^{F'}  \\
                                       & \Rightarrow & \\
                                       & \mathbf{M}  &     

Personally, I prefer using TikZ. Here is an example:

    \node (A) at (150:1.5) {$\mathbf{A}$};
    \node (B) at (30:1.5)  {$\mathbf{B}$};
    \node (M) at (270:1.5) {$\mathbf{M}$};

        (A) edge node[auto] {$P$} (B)
        (A) edge node[auto,swap] {$F$} (M)
        (B) edge node[auto] {$F'$} (M);

    \node at (0,-0.2) {$\Rightarrow$};

Both can just be put into a beamer frame (maybe inside a \[ \] for centering and vertical spacing), provided that the corresponding packages are loaded.

share|improve this answer
Ack. That means it's a codecogs diagram. One of my missions in life is to remove all codecogs from the nLab and replace them with beautiful SVGs. – Loop Space May 25 '11 at 21:39

When using the \xymatrix command from Xy-pic, you can (1) Attach a name to a label on an arrow, and then use that label as a source or target of another arrow, and (2) add a displacement vector to either the source or target of an arrow. We use both of those ideas in the following code:

    {A} \ar[rr]^-{P} \ar[dr]_{F}="left"
    && {B} \ar[dl]^{F'}="right"\\
    & {M}


which produces:Compiled version of the code

In that code, we give the name "left" to the F and the name "right" to the F'. The last line of the \xymatrix then draws an arrow of the form \ar{=>} from a point 1.5em to the right of the F to the point 1.5em to the left of the F'.

Edit: You might actually want that to change that last line of the \xymatrix to


That would both raise the double shafted arrow a bit and label it with \eta (It's not labelled in the diagram you reference, but that arrow is meant to be the natural transformation \eta.)

share|improve this answer

Why don't you simply use the diagrams package found here: http://www.paultaylor.eu/diagrams/

It's very versatile, and making simple commutative diagrams like the one shown is really easy. Just look through the examples in the tutorial PDF.

Milne also has a overview of different diagrams packages somewhere...

share|improve this answer
Before using that package, you should make sure they've read the author's licensing terms. For example, the license forbids use "for any military purpose under any circumstances." Additionally, under certain circumstances, if you use this package to write a book, the author requires you send him a free copy. – Chris Phan May 25 '11 at 1:29
... and ”if you are doing something where mistakes cost money” then you are not allowed to use the package. Strictly interpreting this, you are not allowed to use it for anything? – Caramdir May 25 '11 at 3:45
Also you are not allowed to read the code of the package. – Caramdir May 25 '11 at 3:50
All of those terms do not apply to you if you're making a beamer presentation. Unless it's for a military or nonacademic purpose, although I don't see the military being very interested in category theory. – MarkovCh1 May 25 '11 at 6:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.