# Drawing commutative left triangle

Here is the figure I want to draw:

I do not know exactly from which vertex should I start drawing. Could anyone show me how to draw this please?

• You have to consider a square with top left corner empty, so no arrows pointing from/to there. Commented Feb 12, 2021 at 13:00
• @Sigur Can you show me how can I do that please? Commented Feb 12, 2021 at 13:46
• As a recommendation, this commutative diagram generator can be very helpful both for not having to write code yourself as well as checking how you would go about writing it. Commented Feb 12, 2021 at 22:13
• @tolUene thank you ! Commented Feb 13, 2021 at 1:29
• "I do not know exactly from which vertex should I start drawing" >> you can start drawing from any vertex, as same as the way you choose the origin when you solving analytic geometry problems: choose any that you think fit. However, to start drawing that commutative diagram, a search in this texSE site with keyword "commutative diagram" will list a lot of how-to involving questions Commented Feb 13, 2021 at 7:36

%\documentclass{article}
\documentclass[margin=3.1415692mm,varwidth]{standalone}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
& P \ar[dl, dashed, "\tilde{f}" ']
\ar[d, "f"]     \\
\end{tikzcd}
\end{document}


%\documentclass{article}
\documentclass[margin=3.1415692mm,varwidth]{standalone}% show only image
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
& P \ar[dl, dashed, "\tilde{f}" ']  \\
A \ar[r,twoheadrightarrow,"g" ']    & B \ar[u, "f" ']
\end{tikzcd}
\end{document}


Note: for MWE (Minimal Working Example) is used standalone document class because it show only image with small border and not complete page as it happens at other document classes. However, proposed solution work at all other document classes. If you like to see result at article document class, just uncomment first line of MWE and comment the second line (with inserting % at beginning of second line).

• Should I remove document class {article} from my file to draw this? Commented Feb 12, 2021 at 15:18
• +1 for "margin=3.1415692mm" Commented Feb 12, 2021 at 15:34
• @Smart20 No, you can keep your article class. Commented Feb 12, 2021 at 15:35
• but it is giving me [email protected] Commented Feb 12, 2021 at 15:36
• @Smart20 Replace the complete line "\documentclass[margin=3.1415692mm,varwidth]{standalone}" Commented Feb 12, 2021 at 15:45

Here there are two (2) MWE using xy package with the same tips of the tikz-cd in function of your tastes.

\documentclass[a4paper,12pt]{article}
\usepackage[all,cmtip]{xy}
\begin{document}
\xymatrix@R=2.3pc@C=2.7pc{
& P \ar[d]^f \ar@{-->}[dl]_{\tilde{f}}\\
A \ar@{>>}[r]_g & B
}

\xymatrix@R=2.3pc@C=2.7pc{
& P \ar[d]^f \ar@{.>}[dl]_{\tilde{f}}\\
A \ar@{>>}[r]_g & B
}
\end{document}