# Improve inline xymatrix/tikzcd?

When I was typesetting commutative diagrams, I always put my \xymatrix or tikzcd in displaymath:

For a long time I believed that this is the only way to do so. However, about last month, I saw something like the following:

I realized that this is an \xymatrix acting as an, say, inlinediagram. However it looks weird since I read that diagram as AA->BB->CC->DD->EE->FF. Hence I suggest to align it as follows:

So now there is a smoother path from AA to FF. My question is: Is it a good way to align a commutative diagram? If so, how can I typeset it in a convenient way?

P.S. so far I do the preceding typesettings as the following MWE: (The \hrules make it easier to crop the figures. It is not important at all.)

\documentclass{article}
\usepackage[all,pdf]{xy}
\begin{document}
\hrule
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut AA
$\xymatrix@R11pt{BB\ar[r]&CC\strut\ar[dl]\\DD\ar[r]&EE\strut}$
FF laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
\hrule
\clearpage
\hrule
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut AA
$\xymatrix@R11pt{BB\ar[r]&CC\strut\ar[dl]\\DD\ar[r]&EE\strut}$
FF laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
\hrule
\clearpage
\hrule
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut AA
$\xymatrix@R11pt{BB\ar[r]&CC\strut\ar[dl]\\DD\ar[r]&EE\strut}$
\lower29pt\hbox{FF laoreet dolore magna}
aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
\hrule
\end{document}

• IMHO I don't like to use inline diagrams. I guess that most of people use display style to show them. Do you need an arrow from AA to FF? – Sigur May 18 '14 at 14:55
• Nope. I just want to point out the order of reading. So my suggestion make sense. I consider this more like a golf than a how-to. – Symbol 1 May 18 '14 at 14:59
• That diagram is not a stream of words; if it were, there would be no need of aligning DD under BB. So continuing with FF after the second line of the diagram doesn't make much sense. A complex diagram is two or three dimensional, so its place is in a display. – egreg May 18 '14 at 15:11
• No, it is not a stream of words. I understand that an m-by-n diagram/matrix is more like a figure (hence belongs to a displaymath) then a table. What I'm trying to say is: in case the diagram is only 2-by-2 and its entries are very simple, can we typeset it that way? Or do people think that aligning by a \vcenter is better? (But still worse than a displaymath, I guess.) – Symbol 1 May 18 '14 at 15:39

If the diagram is kind of part of the sentence (as I got the feeling it is in your case), you should try to do an one line diagram (AA BB --> CC --> DD --> EE FF) which makes it easy to understand and to read. If you really need two rows for your diagram, you have to use your first version. displaymath is the normal positioning for such things and everybody is used to start a sentence, read a formula or a diagram, and finally finish the sentence.