xymatrix 和笛卡尔积

xymatrix 和笛卡尔积

我正在用它制作一个图表

\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}

因为我想要在乘积的每个组件之间添加一个箭头。如何才能抑制 \times 两边的空格?

答案1

我认为xy不能满足您的要求,但tikz-cd可以。不过我可能只会使用xshift解决方案(第二个tikzcd示例)。

xy的等效项可以在手册的xshift第 2.4 节中看到xyxyguide.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}

答案2

您可以滑动箭头;使用您认为最佳的数量。

\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}

在此处输入图片描述

无需“拇指计算”:

\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}

在此处输入图片描述

相关内容