I want to draw an ellipse around three pairs of nodes in my diagram: (32), (78) and (56).
\begin{tikzcd}
1\arrow[bend right]{r} \arrow{d}
&3 \arrow[bend right]{l} \arrow[bend left]{r}
&2 \arrow[bend left]{l} \arrow[bend right]{r} \arrow{d}
&4 \arrow[bend right]{l} \\
7\arrow[bend right]{r}
&8 \arrow[bend right]{l} \arrow[bend left]{r} \arrow{u}
&5 \arrow[bend left]{l} \arrow[bend right]{r}
&6 \arrow[bend right]{l} \arrow{u}
\end{tikzcd}
Here is a picture of the diagram that the above code outputs, with the dashed ellipses I would like superimposed on top:
Here is the best I have been able to do so far, using answers from elsewhere:
\[\begin{tikzcd}[execute at end picture={\node[ellipse,draw,blue,fit={(tikz@f@1-3-1) (tikz@f@1-3-2)}]{};}]
1\arrow[bend right]{r} \arrow{d}
&3 \arrow[bend right]{l} \arrow[bend left]{r}
&2 \arrow[bend left]{l} \arrow[bend right]{r} \arrow{d}
&4 \arrow[bend right]{l} \\
7\arrow[bend right]{r}
&8 \arrow[bend right]{l} \arrow[bend left]{r} \arrow{u}
&5 \arrow[bend left]{l} \arrow[bend right]{r}
&6 \arrow[bend right]{l} \arrow{u}
\end{tikzcd}\]
with the output:
I cannot figure out how to get the ellipse snugly around the pairs.
It seems that perhaps a different tikz would work better, like tikz picture, but all of the diagrams in my paper are written in the same way, so I would rather not rewrite this just to get ellipses around the nodes, because then it likely will not match.
Thank you!




tikz-cddo you have? (Add\listfilesbefore\documentclass, compile, and look at the*File list*near the end of the.logfile to find out.) – Torbjørn T. Oct 09 '17 at 16:10\node[dashellipse=(tikz@f@1-1-2)(tikz@f@1-1-3)(tikz@f@1-1-4)]{};– Torbjørn T. Jun 13 '18 at 17:42