How to put a square inside a commutative diagram as in the following picture:
It would like to have a square in the following diagram:
\documentclass[a4paper,12pt]{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
X\times_S Y \arrow{r}{p_2} \arrow{d}[swap]{p_1} &Y \arrow{d}{g} \\
X \arrow[swap]{r}{f} & Z
\end{tikzcd}
\end{document}}
Best Answer
Two solutions: one with
pstricks
and apsmatrix
environment, the other withtikz-cd
, in which I use the short syntax for arrows: