I want to add a commutative diagram and started using tilkcd today, but having a trouble with the location of labels attached to an arrow when two arrows cross over with each other.
Here's a commutative diagram in Mac Lane's Cateogory Theory textbook for associativity.
Here's my trial for it.
\usepackage{amsmath, amssymb, graphicx}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=huge, row sep=huge]
a \arrow[r, "f\circ g\circ h"] \arrow[d, "h"'] \arrow[dr, "g\circ h" very near start] & d \\
b \arrow[r, "g"] \arrow[ur, "f\circ g" very near start] & c \arrow[u, "f"']
\end{tikzcd}
\end{document}
As you can see, the labels attached to the arrows in the middle part look out of place. I tried 'very near start' and 'inner sep=0ex' but I couldn't make it look better. Simple problem but any help is much appreciated.
[Edited] Attached the relevant pictures.