# Double diagram in tikz-cd

Can someone help me draw a double diagram like this with tikz-cd, please? ## 1 Answer

One option (the second diagram has the arrows detached from the boxes)

\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} Do you really need the boxes? If not, delete the cells={...} part of the code.