Take the 2-minute tour ×
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.

How to give a number (for later reference) to the following diagram?

\begin{displaymath}
\xymatrix@!C{ \{ \prod_{g \in A} \OO_g  \} \ar@{->>}[r] & {
\{\prod_{g \in A^{\prime}} \OO_g \} }\\ { {\tilde {\T}}^{\prime}_{
{\tilde{\m}}^{\prime} } } \ar@{^{(}->}[u] \ar@{->>}[r]^(0.55){q} &
{\T} \ar@{^{(}->}[u] }
\end{displaymath}
share|improve this question
    
Welcome to TeX.SX! Here's starter guide –  texenthusiast May 7 '13 at 7:53
add comment

1 Answer

up vote 2 down vote accepted

Perhaps, the simplest way might be:

  • if you'd like to number this along with other equations, put this inside an equation environment (instead of displaymath)

  • if you'd like to number this with a custom number, put this inside an equation* and use \tag{<your-label-here>}.

And, to get the number centered, the trick is to center the number. So, this might go inside a gathered environment.

\documentclass{amsart}
\usepackage{xypic} %generates a warning, but the problem is with the package
\begin{document}
\begin{equation}
\begin{gathered} 
\xymatrix@!C{ 
\left\{\prod_{g \in A}\mathcal{O}_g\right\} \ar@{->>}[r] 
& \left\{\prod_{g \in A^{\prime}} \mathcal{O}_g \right\} \\

\widetilde{\mathcal{T}}}^{\prime}_{{\tilde{\mu}}^{\prime} \ar@{^{(}->}[u] \ar@{->>}[r]^(0.55){q} 
& {\mathcal{T}} \ar@{^{(}->}[u]
}
\end{gathered} 
\end{document} 

Now, brace yourself as you see the output:

xypicdraw.png

Unrelated to your actual question:

  1. You seem to be having big symbols inside smaller braces. You might want to put this into \left\{...\right\}. (There are other variants here: the constructs \bigl...\bigr and \biggl...\biggr can be used the way one uses \left...\right.)

  2. However, I'd suggest that you draw diagrams in Tikz, if you'd like to see beautiful images. (The package tikz-cd is very good at this!)

share|improve this answer
    
Can you compile and see where the equation no. occurs. I want the number to apper at the right side of the diagram (that also to be in the centre). Thanks. \begin{equation*}\tag{1} \xymatrix@!C{A & B \ar[l]}\C& D \ar[l] \ar[u] } \end{equation} –  sri May 7 '13 at 8:30
    
@ Kan: Thanks for all your comments. Yes. Gathered comment really helped. Still have a small problem. Equation no. appears left side (@ center as i wanted) but i want it to be rightside. \begin{equation*}\tag{1} \begin{gathered}\xymatrix@!C{A & B \ar[l]}\D& E \ar[l] \ar[u] } \end{gathered}\end{equation} –  sri May 7 '13 at 8:37
    
@sri You can do that by passing the option [reqno] to your documentclass: eg, \documentclass[reqno]{amsart}. –  kan May 7 '13 at 8:40
    
Yes. It helped. I can't vote your answers (not having 15 points). Many thanks. I did mark the answer as right by clicking on the tick mark. –  sri May 7 '13 at 8:43
add comment

Your Answer

 
discard

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.