2

I am using this to produce a diagram

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[all]{xy}

\begin{document}

[ \xymatrix{H_n(X;R) \ar[d]^{f_}& \times & H^m(X;R) \ar[r] & H_{n-m}(X;R) \ar[d]^{f_} \ H_n(X;R)& \times & H^m(X;R)\ar[u]{f^*} \ar[r] &H{n-m}(Y;R)} ]

\end{document}

because I want an arrow between each component of the product. How can I suppress the space on each side of \times ?

Van
  • 23
  • That said, I don't think xy can do that. You can with tikzcd (which I'd recommend over xy nowadays, more features, nicer arrows). But it would probably just be easier to x shift the arrows instead. AFAIR xy can do this as well. – daleif Jun 29 '20 at 12:36
  • 1
    You mean that way ? – Van Jun 29 '20 at 12:36
  • Thank you I will try – Van Jun 29 '20 at 12:37

2 Answers2

1

I don't think xy can do what you ask, but tikz-cd can. Though I'd probably just use the xshift solution (second tikzcd example).

The xy equivalent for xshift can be seen in section 2.4 in the xy manual (xyguide.pdf)

\documentclass[a4paper]{article}

\usepackage{amsmath,amssymb} \usepackage[all]{xy} \usepackage{tikz-cd} \usetikzlibrary{babel} % if you are using a language that makes " an active char \begin{document}

Standard xy: [ \xymatrix{H_n(X;R) \ar[d]^{f_}& \times & H^m(X;R) \ar[r] & H_{n-m}(X;R) \ar[d]^{f_} \ H_n(X;R)& \times & H^m(X;R)\ar[u]{f^*} \ar[r] &H{n-m}(Y;R)} ]

Tikzcd with column space adjustment: [ \begin{tikzcd} H_n(X;R) \arrow[d,"f_*"] &[-3em] \times &[-3em] H^m(X;R) \arrow[r] & H_{n-m}(X;R) \arrow[d, "f_*"] \ H_n(X;R)& \times & H^m(X;R)\arrow[u,"f^*"] \ar[r] &H_{n-m}(Y;R)\ \end{tikzcd} ]

Tikzcd using xshift instead: [ \begin{tikzcd} H_n(X;R) \times H^m(X;R) \arrow[d,"f_*",xshift=-2em] \arrow[r] & H_{n-m}(X;R) \arrow[d, "f_*"] \ H_n(X;R) \times H^m(X;R)\arrow[u,"f^*",xshift=2em] \ar[r] &H_{n-m}(Y;R)\ \end{tikzcd} ]

\end{document}

daleif
  • 54,450
1

You can slide arrows; use the amount you think best.

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[all,cmtip]{xy}

\begin{document}

[ \xymatrix{H_n(X;R) \times H^m(X;R) \ar@<-2.5em>[d]{f} \ar[r] & H_{n-m}(X;R) \ar[d]^{f_} \ H_n(X;R) \times H^m(X;R) \ar@<-2.5em>[u]{f^*} \ar[r] & H{n-m}(Y;R)} ]

\end{document}

enter image description here

Without “thumb computation”:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[all,cmtip]{xy} \newlength{\shiftA} \newlength{\shiftB}

\begin{document}

[ \settowidth{\dimen0}{$H_n(X;R)$} \settowidth{\dimen2}{$H^m(X;R)$} \settowidth{\dimen4}{${}\times{}$} \setlength{\shiftA}{\dimexpr(\dimen0+\dimen4)/2} \setlength{\shiftB}{\dimexpr(\dimen2+\dimen4)/2} \xymatrix{H_n(X;R) \times H^m(X;R) \ar@<-\shiftA>[d]{f} \ar[r] & H_{n-m}(X;R) \ar[d]^{f_} \ H_n(X;R) \times H^m(X;R) \ar@<-\shiftB>[u]{f^*} \ar[r] & H{n-m}(Y;R)} ]

\end{document}

enter image description here

egreg
  • 1,121,712