When I try to compile the following diagram

A\ar[r]^{g}{\ar[d]_j} & B\ar[d]^{e}\\
X\ar[r]_{f} \ar[ur]^{\tilde g}& Y

the subscripts of the arrow labels are treated as the subscripts of A and X, but if I take out the diagonal arrow it compiles normally

A\ar[r]^{g}{\ar[d]_j} & B\ar[d]^{e}\\
X\ar[r]_{f} & Y

Is this just me or a bug? How do I fix it?

Edit: here are pics of the compiled diagrams

no diagonal

enter image description here


enter image description here

Edit 2: I just tried compiling the same thing in my Texclipse setup but it actually comes out the same way. So it's not an Anki problem.

  • 1
    Are you loading \usepackage[all]{xy}? It works here using TeXlive 2014.
    – Sigur
    Commented Feb 24, 2015 at 17:57
  • 1
    Welcome to TeX.SX! Could you please post an image of your output? Commented Feb 24, 2015 at 17:58
  • @Sigur yes I'm calling \usepackage[all]{xy} in the preamble Commented Feb 25, 2015 at 19:14
  • What's Anki that you mention in a comment?
    – egreg
    Commented Feb 25, 2015 at 19:19
  • The website gives a pretty good intro to it. It's a software that helps increase retention rate for learning. It allows compilation of latex into jpeg (I believe) so that mathematical knowledge can be gained efficiently with this method as well. For most cases, the implemented latex conversion system works, but for diagrams, for example, I can't do tikz-cd. Commented Feb 25, 2015 at 22:02

1 Answer 1


Please provide an MWE as your problem is not reproducible for us. Your snippet works just fine as I am showing below. However, I provide a transcript to which is much more modern and maybe interesting for you.

% arara: pdflatex


    A\ar[r]^{g}\ar[d]_j & B\ar[d]^{e}\\
    X\ar[r]_{f} \ar[ur]^{\tilde g} & Y
    A\ar{r}{g}\ar{d}[swap]{j} & B\ar{d}{e} \\
    X\ar{r}[swap]{f}\ar{ur}{\tilde{g}} & Y

enter image description here

  • what is an MWE? To put this in context, I'm writing this snippet in Anki, which doesn't support tikz for some reason I'm forgetting. Commented Feb 25, 2015 at 19:18
  • We often use the abbreviation minimal working example (MWE) for a compilable but small version of your document. If you can't use TikZ, you will have to tell me, what is wrong with my XY approach-
    – LaRiFaRi
    Commented May 19, 2015 at 8:11

You must log in to answer this question.

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