我正在用它制作一个图表
\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 节中看到xy
(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}
答案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}