# A tilted product diagram

Here is the diagram I want to draw:

I know how to draw ordinary commutative diagram like this and here is my trial:

\documentclass{book}
\usepackage{tikz-cd}
\begin{document}
$$\begin{tikzcd}[row sep=huge] & X\ar[dl,"Id_{X}",swap,sloped] \ar[dr,"Id_{X}",sloped] \ar[d,dashed,"{ \vartriangle }" description] & \\ X & X\times X\ar[l,"Pr_{X}"] \ar[r,"Pr_{X}",swap] & X \end{tikzcd}$$
\end{document}


But I do not know how to draw this tilted commutative diagram. Could anyone help me with drawing so, please?

• Are you loading the tikz-cd package? Apr 1 at 0:49
• Yeah I do @Sigur Apr 1 at 0:54

You should familiarize yourself with the basic examples in the tikz-cd documentation.

The basic idea is to create a matrix, in your example, 3 rows and 3 columns.

\begin{tikzcd}
& A\\
& P\\
X & & Y
\end{tikzcd}


Arrows are added using the \arrow command, which has many options. The arrows can be aimed using the letters u, d, l, r in any combination. For example, to point an arrow down two rows and right one column, use \arrow[ddr].

\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
$\begin{tikzcd}[row sep=1cm] &A\arrow[ddl,"f_1"']\arrow[ddr,"f_2"]\arrow[d,dotted,"\bar{f}" description]\\ &P\arrow[dl,"p_1"]\arrow[dr,"p_2"']\\ X&&Y \end{tikzcd}$
\end{document}

• Thank you very very much!! this pdf is really super helpful! Apr 1 at 1:43