GeneralNumbered XY-pic equations

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
Annabel
Posts: 14
Joined: Mon Jun 16, 2008 3:21 pm

Numbered XY-pic equations

Post by Annabel »

Hi all

I am using XYpic to create chemical reaction schemes, e.g.:

Code: Select all

\begin{displaymath}
    \xymatrix{
                          & B        & \\
        A \ar[ur] \ar[dr] &          & \\
                          & C  \ar[r]& D}
\end{displaymath}
I wish to number them, because they should be treated as any other equation. However,

Code: Select all

\begin{equation}
    \xymatrix{
                          & B        & \\
        A \ar[ur] \ar[dr] &          & \\
                          & C  \ar[r]& D}
\end{equation}
prints the equations at the top right of the line (box of the equation). Is there any way to alter the position of the equation number (either at the center, or in some rare occasions, at the bottom right)?

Thanks a lot!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Numbered XY-pic equations

Post by Stefan Kottwitz »

Hi Annabel,

you could use the split environment to get a vertically centered tag:

Code: Select all

\begin{equation}
\begin{split}
    \xymatrix{
                          & B        & \\
        A \ar[ur] \ar[dr] &          & \\
                          & C  \ar[r]& D}
\end{split}
\end{equation}
A bottom aligned number could be achieved using a minipage with b option (\begin{minipage} ...).

Stefan
LaTeX.org admin
User avatar
Annabel
Posts: 14
Joined: Mon Jun 16, 2008 3:21 pm

Numbered XY-pic equations

Post by Annabel »

Thanks, The split evironment is a great help for vertically centered numbers.

I was not able to put the number at the bottom. Is there a specific order of the latex commands? Now I have:

Code: Select all

\begin{equation}
\begin{minipage}[b]{7cm}
	    \xymatrix{
	                          & B        & \\
	        A \ar[ur] \ar[dr] &          & \\
	                          & C  \ar[r]& D}
\end{minipage}
\end{equation}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Numbered XY-pic equations

Post by Stefan Kottwitz »

Hi Annabel,

there's a trick: insert

Code: Select all

\vspace{0pt}
right before the end of the minipage. For an explanation have a look at Vertical alignment of graphics, the approach desribed there works also for xymatrix.

Stefan
LaTeX.org admin
Post Reply