I wish to create a diagram like this.
My attempt is shown below:
Output
Code
\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{tikzmark,shapes.geometric,shapes.symbols}
\tikzset{elnode/.style={draw, ellipse, dotted, minimum height=1cm, label distance=-2mm},
cloudnode/.style={draw, dotted, black!80, inner sep=1.75cm, cloud, cloud puffs=20, cloud puff arc=100}}
\begin{document}
\begin{tikzpicture}
\subnode{A}{ptA} at (0, 0);
\end{tikzpicture} \hspace{5cm}
\begin{tikzcd}[arrows={-latex, outer sep=-1.5pt},row sep=2cm, column sep=2cm]
& \subnode{ptfa}{F(A)} \arrow[d, "\alpha_A"{name = arrow1}] \arrow[to=arrow1, phantom, "{}\tikzmark{Fa}"]\\ & \subnode{ptga}{G(A)}
\end{tikzcd}
\begin{tikzpicture}[remember picture, overlay]
\node[cloudnode1, label = {above: $\cat{A}$}](lft) at (pic cs:A){};
\node[cloudnode, label = {above: $\cat{B}$}](rgt) at (pic cs:ptfa){};
\draw[-latex, dotted, black!80, bend right](A)to node[below]{$F$}(ptfa);
\draw[-latex, dotted, black!80, bend right](A)to node[below]{$G$}(ptga);
\end{tikzpicture}
\end{document}
I would like to know how I can add space between the two cloudnodes. hspace{}
doesn't seem to work.
I am new to Latex. I'd like to mention the previous help that I have received so far. @user:125871 (SandyG) has been very helpful. They have helped me make some progress so far. This is the first question that I posted: https://tex.stackexchange.com/a/640262/268068
\documentclass
, includes all relevant\usepackage
commands, ends with\end{document}
and compiles without errors, even if it does not produce your desired output.hspace
doesn't work because the blank line after it creates a new line, so you need to remove that blank line to put the two pictures on a level.\subnode
is meant to be used inside a\node
, not by itself. It works in thetikzcd
because things get put inside nodes automatically but it can't be used in atikzpicture
as you use it. When you say that you want to keep the style of your picture, what do you want to keep? In trying to fix your code then there are many things I would do differently, so knowing what is essential is useful.