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.

I have drawn the following picture in xypicenter image description here

and I would like to align in the right column the Hom term in the first row as well as direct product guys in the 2nd and 3rd rows exactly together. How can I do this? Because right now the diagram is looking odd. For those interested, here is my code:

\[\begin{xy} \xymatrix@C=5em@R=4em{  \Hom(X,\spec A) \ar[r]^\alpha \ar[d] &  \operatorname{Hom}(A,\Gamma(X,\mathcal{O}_X)) \ar[d] \\

\prod_i \Hom(U_i,A) \ar[r]^-{\beta_i} \ar@<-0.5ex>[d] \ar@<0.5ex>[d] &\prod_i \operatorname{Hom}\Big(A,\Gamma(U_i,\mathcal{O}_X|_{U_i}) \Big)  \ar@<-0.5ex>[d] \ar@<0.5ex>[d] \\

\prod_{i,j} \Hom(U_i \cap U_j,A) \ar[r]^-{\beta_{i,j}} & \prod_{i,j}  \operatorname{Hom}\Big(A,\Gamma(U_i \cap U_j,\mathcal{O}_X|_{U_i\cap U_j}) \Big)   }\end{xy}\]
share|improve this question
    
I think that it is not possible on xy. Do you know tikz-cd? –  Sigur Jul 27 '13 at 1:32
    
Something like this for the RHS? –  Werner Jul 27 '13 at 1:35
    
@Werner Perhaps but is it possible for them to be perfectly alinged? –  fpqc Jul 27 '13 at 2:22
    
@Sigur I am not using it now, but if you show me the code I am prepared to change from xypic to tikz-cd. –  fpqc Jul 27 '13 at 2:22
    
@BenjaLim: According to your post, you want the Hom operator name to be aligned horizontally across the rows. Am I right? That's exactly what I have in my picture. Sure, you want it for the LHS as well, correct? Perhaps use a graphic interface and mock up the exact output you're after as well. –  Werner Jul 27 '13 at 2:37
show 3 more comments

1 Answer

This is a first cut. I'm sure something can be done better with the arrows than just stretching them (as I did).

\documentclass{article}
\usepackage{stackengine}
\usepackage{scalerel}
\def\spec{\mathrm{Spec}}
\def\Hom{\mystrut\mathrm{Hom}}
\def\bigdownarrow{\stretchto{\downarrow}{6ex}}
\def\bigrightarrow{\protect\hstretch{5}{\rightarrow}}
\def\nobigdownarrow{\protect\phantom{\bigdownarrow}}
\newcommand\rarrow[1]{\mystrut\smash{\stackon{$\bigrightarrow$}{$#1$}}}
\def\hgapa{\hspace{5ex}}
\def\hgapb{\hspace{4.5ex}}
\def\mystrut{\protect\vphantom{\Big(}}
\begin{document}
\[
\Shortstack[r]{{} {$\nobigdownarrow$} {$\prod_{i,j}\mystrut$}
 {$\nobigdownarrow$} {$\prod_{i,j}\mystrut$}}
\Shortstack[l]{{$\Hom(X, \spec A)$} {$\hgapa\bigdownarrow$} {$\Hom(U_i, A)$}
  {$\hgapb\bigdownarrow\bigdownarrow$} {$\Hom(U_i \cap U_j,A)$}}
\Shortstack[c]{{$\rarrow{\alpha}$} {$\nobigdownarrow$} {$\rarrow{\beta_i}$}
  {$\nobigdownarrow$} {$\rarrow{\beta_{i,j}}$}}
\Shortstack[r]{{} {$\nobigdownarrow$} {$\prod_{i,j}\mystrut$}
 {$\nobigdownarrow$} {$\prod_{i,j}\mystrut$}}
\Shortstack[l]{{$\Hom(A,\Gamma(X,\mathcal{O}_X))$} {$\hgapa\bigdownarrow$}
  {$\Hom\Big(A,\Gamma(U_i,\mathcal{O}_X|_{U_i}) \Big)$}
  {$\hgapb\bigdownarrow\bigdownarrow$} 
  {$\Hom\Big(A,\Gamma(U_i \cap U_j,\mathcal{O}_X|_{U_i\cap U_j}) \Big)  $}}
\]
\end{document}

enter image description here

share|improve this answer
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.