答案1
一个选项(第二张图的箭头与方框分离)
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amssymb}
\begin{document}
\begin{tikzcd}[row sep=large,cells={nodes={draw,minimum height=0.6cm}}]
\mathbb{R}^{p}\ar[d,"\mathbf{D}_{p}",swap] & \mathbb{R}^{n^{\ast}}\ar[r,"\mathbf{Y}^{T}"]\ar[l,"\mathbf{X}^{T}",swap] & \mathbb{R}^{q}\ar[d,"\mathbf{D}_{q}"] \\
\mathbb{R}^{p^{\ast}}\ar[r,"\mathbf{X}",swap] & \mathbb{R}^{n}\ar[u,"\mathbf{D}_{n}",swap] & \mathbb{R}^{q^{\ast}}\ar[l,"\mathbf{Y}"]
\end{tikzcd}\par\bigskip
\begin{tikzcd}[row sep=large,arrows={shorten >= 2pt,shorten <= 2pt},cells={nodes={draw,minimum height=0.6cm}}]
\mathbb{R}^{p}\ar[d,"\mathbf{D}_{p}",swap] & \mathbb{R}^{n^{\ast}}\ar[r,"\mathbf{Y}^{T}"]\ar[l,"\mathbf{X}^{T}",swap] & \mathbb{R}^{q}\ar[d,"\mathbf{D}_{q}"] \\
\mathbb{R}^{p^{\ast}}\ar[r,"\mathbf{X}",swap] & \mathbb{R}^{n}\ar[u,"\mathbf{D}_{n}",swap] & \mathbb{R}^{q^{\ast}}\ar[l,"\mathbf{Y}"]
\end{tikzcd}
\end{document}
您真的需要这些框吗?如果不需要,请删除该cells={...}
部分代码。