3

I am using xymatrix for the following diagram

\eq
&&\xymatrix{
    &X\times Y\times X\times Y&& \\
    &X\times X\times Y \ar@{^{(}->}[u]_-{j}\ar[ld]_{q}\ar[rd]&&\\
    X\times X \ar[rd]&&X\times Y\ar[ld]\ar[rd]&\\
    &X&&Y
}\eneq

But the central commutative diagram looks like a diamond rather than a square. Is it possible to control better the shape of this. Also, the central diagram is cartesian, so that I would like to draw inside the diagram a rotated square (\pi/4 rotation) with xymatrix (see also here)

| improve this question | | | | |
3

Adjust the row and column separation. For the square in the middle, add a phantom arrow.

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage[all,cmtip]{xy}

\begin{document}

\begin{equation}
\begin{gathered}
\xymatrix@C-1.2pc@R+1.6pc{
    &X\times Y\times X\times Y && \\
    &X\times X\times Y \ar@{^{(}->}[u]_-{j}\ar[ld]_{q}\ar[rd] \ar@{}[dd]|\square&&\\
    X\times X \ar[rd]&&X\times Y\ar[ld]\ar[rrd]&\\
    &X&&&Y
}
\end{gathered}
\end{equation}

\end{document}

enter image description here

With tikz-cd:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz-cd}

\newcommand{\commsquare}[1][0]{%
  \raisebox{\depth}{\rotatebox[origin=center]{#1}{$\scriptstyle\square$}}%
}

\begin{document}

\begin{equation}
\begin{tikzcd}[row sep=2.5em,column sep={4em,between origins},nodes in empty cells]
&
X\times Y\times X\times Y 
&&
\\
&
X\times X\times Y
  \arrow[u,hook,swap,"j"]
  \arrow[ld,swap,"q"]
  \arrow[rd]
\\
X\times X
  \arrow[rd]
& \commsquare[45] &
X\times Y
  \arrow[ld]
  \ar[rd]
\\
& X && Y
\end{tikzcd}
\end{equation}

\end{document}

enter image description here

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.