First, get the commutative diagrams to look the way you want before you mess with tikzmark
and cloud
s:

\begin{tikzcd}[arrows={-latex},row sep=1cm, column sep=1cm]
a \arrow[r, "f"]\arrow[rd, "g\circ f"'] & b \arrow[d, "g"]\\
& c
\end{tikzcd}\hspace{2.5cm}
\begin{tikzcd}[arrows={-latex},row sep=1cm, column sep=1cm]
F(a) & F(b) \arrow[l, "F(f)"'] \\
& F(c) \arrow[u, "F(g)"'] \arrow[lu, "F(g \circ f)"]
\end{tikzcd}
Then, once those are correct, add a tikzmark
in the center of the left diagram. I think a good spot would be along the arrow from a
to c
, but on the top side. So change the code for the rd
arrow to
\arrow[rd, "g\circ f"', "\tikzmark{catA}"]
Now you have a tikzmark
named catA
that you can use later. To test the position, make a new tikzpicture
using \begin{tikzpicture}[remember picture, overlay]
, which allows you to refer to earlier tikzmarks
.
\begin{tikzpicture}[remember picture, overlay]
\node[cloudnode1, label={above:$C$}](lft) at (pic cs:catA){};
\end{tikzpicture}
I am assuming that in your preamble you have defined the style cloudnode1
using code similar to:
\tikzset{cloudnode1/.style={draw, dashed, black!80, inner sep=1cm,
cloud, cloud puffs=10, cloud puff arc=150}}
which I adapted from this earlier answer. By the way, you should always cite other people's work when you post code on this site.
Remember you must compile twice! The result is this:

So far so good. Now you need to do the same thing on the other diagram. Change the lu
arrow to:
\arrow[lu, "F(g \circ f)", "\tikzmark{catop}"']
Add the line
\node[cloudnode1, label={above:$B$}](rgt) at (pic cs:catop){};
to the tikzpicture
and...

Looks like the clouds are too small. Increase the inner sep
to 1.3cm
or whatever looks good to you. Finally, add
\draw[-latex, black!80, bend left = 10, dashed](lft)to node[above]{$F$}(rgt);
and adjust the space between the two clouds. Remember to compile twice!

Here is the complete code:
\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{tikzmark,shapes.symbols}
\tikzset{cloudnode1/.style={draw, dashed, black!80, inner sep=1.3cm, cloud, cloud puffs=10, cloud puff arc=150}}
\begin{document}
\begin{tikzcd}[arrows={-latex},row sep=1cm, column sep=1cm]
a \arrow[r, "f"]\arrow[rd, "g\circ f"', "\tikzmark{catA}"] & b \arrow[d, "g"]\\
& c
\end{tikzcd}\hspace{3cm}
\begin{tikzcd}[arrows={-latex},row sep=1cm, column sep=1cm]
F(a) & F(b) \arrow[l, "F(f)"'] \\
& F(c) \arrow[u, "F(g)"'] \arrow[lu, "F(g \circ f)", "\tikzmark{catop}"']
\end{tikzcd}
\begin{tikzpicture}[remember picture, overlay]
\node[cloudnode1, label={above:$C$}](lft) at (pic cs:catA){};
\node[cloudnode1, label={above:$B$}](rgt) at (pic cs:catop){};
\draw[-latex, black!80, bend left = 10, dashed](lft)to node[above]{$F$}(rgt);
\end{tikzpicture}
\end{document}
As a final thought, you might want to increase the row sep
and column sep
on the left diagram so it has the same size as the right one.
\begin{tikzcd}[arrows={-latex},row sep=1.3cm, column sep=1.3cm]
Then the result is:

which looks quite nice to me.
tikz-cd
was:Package pgf Error: No shape named 'F' is known. I think the culprit is a tikzcd arrow in cell 1-2
. It seems you are trying to use "F" before defining it.cloudnode1
also seems to be not defined.\documentclass
, includes all relevant\usepackage
commands, and ends with\end{document}
.Package pgf Error...
instead ofPackage pdf Error...
.