# change tag position in amsmath and xy-package

I use the amsmath-package and xy. Now I have a formulae like this

$\label{eq-name} \tag{\ast} \xymatrix{ & A & B & C \\ D & & E & & F \\ & G & & H }$


The xymatrix is quite long in 2nd row. Therefore the tag is placed in the right-lower corner of the diagram, where it can't be found. I want to raise it. It doesn't matter if I raise it manually or bring it on a line with the 1st or 3rd row of the matrix. In the amsmath manual it it said, that \raistag should do exactly what I want. But it has no effect at all. Maybe that is, because the xymatrix reserves the whole rectangle it fills. So maybe I have to put the tag into the matrix. But how can I do that?

The concrete problem is here:

\documentclass[12pt, a4paper, twoside, titlepage, bibliography=totocnumbered]{scrreprt}
\usepackage{amsmath}
\usepackage{bbm}
\usepackage[all,knot,color]{xy}
\usepackage[ngerman]{babel}

\newcommand{\bijar}[1][]{%
\ar[#1]
\ar@<0.4ex>@{}[#1]|-*=0[@]{\sim}}

\newcommand{\QL}[2]
{{\left.\raisebox{-.1em}{\ensuremath{#1}}\middle\backslash\raisebox{.1em}{\ensuremath{#2}}\right.}}

\newcommand{\ggruppe}{{<\!\! g \!\! >}}

\newcommand{\C}{\mathbbm{C}}

\begin{document}

$\label{mf:masterplan} \tag{\ast} \xymatrix{ & D_2^\times\times\C^\times \ar@{>>} [dl]_{p_g} \ar @{-} [d]^{p_1} \bijar [r]_-{j_N} & M^0_2(N) \ar [d]^{p_g^0} \ar @{^(.>} [r]^{\text{incl.}} & M_2(N) \ar @{.>>} [dr] \ar @{.>>} [dd]|\hole & \\ \QL{\ggruppe}{D_2^\times \times \C^\times} \ar @{>>} [dr]_{p_{1,g}} \bijar [rr]_(.4){\hat j_N} & {\phantom{X}} \ar @{>>} [d] & \QL{\ggruppe}{M_2^0(N)} \ar @<-0.4ex> @{>>} [dl]_{\chi_N^0} \ar @{^(.>} [rr]^{\text{incl.}} & & \QL{\ggruppe}{ M_2(N)} \ar @{.>>} [dl]^{\chi_N} \\ & D_2^\times \ar @{^(.>} @<-0.2ex> [rr]^{\text{incl.}} & & D_2 }$

\end{document}

-
If the math material in $...$ is too wide, amsmath will put the tag below it. Can you make a "real world" example, so that we can check the actual output? – egreg Mar 18 '13 at 19:06

Perhaps you could reduce the column separation; the following code shows this option and also the use of split to get the tag vertically centered:

\documentclass[12pt, a4paper, twoside, titlepage, bibliography=totocnumbered]{scrreprt}
\usepackage{amsmath}
\usepackage{bbm}
\usepackage[all,knot,color]{xy}
\usepackage[ngerman]{babel}

\newcommand{\bijar}[1][]{%
\ar[#1]
\ar@<0.4ex>@{}[#1]|-*=0[@]{\sim}}

\newcommand{\QL}[2]
{{\left.\raisebox{-.1em}{\ensuremath{#1}}\middle\backslash\raisebox{.1em}{\ensuremath{#2}}\right.}}

\newcommand{\ggruppe}{{<\!\! g \!\! >}}

\newcommand{\C}{\mathbbm{C}}

\begin{document}

$\label{mf:masterplan} \tag{\ast} \xymatrix@C=10pt{ & D_2^\times\times\C^\times \ar@{>>} [dl]_{p_g} \ar @{-} [d]^{p_1} \bijar [r]_-{j_N} & M^0_2(N) \ar [d]^{p_g^0} \ar @{^(.>} [r]^{\text{incl.}} & M_2(N) \ar @{.>>} [dr] \ar @{.>>} [dd]|\hole & \\ \QL{\ggruppe}{D_2^\times \times \C^\times} \ar @{>>} [dr]_{p_{1,g}} \bijar [rr]_(.4){\hat j_N} & {\phantom{X}} \ar @{>>} [d] & \QL{\ggruppe}{M_2^0(N)} \ar @<-0.4ex> @{>>} [dl]_{\chi_N^0} \ar @{^(.>} [rr]^{\text{incl.}} & & \QL{\ggruppe}{ M_2(N)} \ar @{.>>} [dl]^{\chi_N} \\ & D_2^\times \ar @{^(.>} @<-0.2ex> [rr]^{\text{incl.}} & & D_2 }$

$$\label{mf:masterplan} \tag{\ast} \begin{split} \xymatrix@C=10pt{ & D_2^\times\times\C^\times \ar@{>>} [dl]_{p_g} \ar @{-} [d]^{p_1} \bijar [r]_-{j_N} & M^0_2(N) \ar [d]^{p_g^0} \ar @{^(.>} [r]^{\text{incl.}} & M_2(N) \ar @{.>>} [dr] \ar @{.>>} [dd]|\hole & \\ \QL{\ggruppe}{D_2^\times \times \C^\times} \ar @{>>} [dr]_{p_{1,g}} \bijar [rr]_(.4){\hat j_N} & {\phantom{X}} \ar @{>>} [d] & \QL{\ggruppe}{M_2^0(N)} \ar @<-0.4ex> @{>>} [dl]_{\chi_N^0} \ar @{^(.>} [rr]^{\text{incl.}} & & \QL{\ggruppe}{ M_2(N)} \ar @{.>>} [dl]^{\chi_N} \\ & D_2^\times \ar @{^(.>} @<-0.2ex> [rr]^{\text{incl.}} & & D_2 } \end{split}$$

\end{document}


-
Thanks a lot for this easy solution. – Greyfox Mar 18 '13 at 19:51