# New shape format of a singe node in tikzcd (rewrite cells option)

How to get a new custom shape of a node in a tikzcd diagramm which uses option cells={nodes={ellipse}}?

I've tried to use a trick with |[cells={nodes={draw=red, rectangular}}]|, but in vain.

MWE is from this discussion.

    \documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{shapes}
\begin{document}
\begin{figure}
\begin{tikzcd}[cells={nodes={draw=black, ellipse,anchor=center,minimum height=2em}}]
0 \arrow[r] & 1 \arrow[r] & |[draw=none]|\dots \arrow[r] & n-1 \arrow[r] & |[cells={nodes={draw=red, rectangular}}]|n
\end{tikzcd}
\end{figure}
\end{document}


Desired effect:

• \begin{tikzcd}[cells={nodes={draw=black, ellipse,anchor=center,minimum height=2em}}] 0 \arrow[r] & 1 \arrow[r] & |[draw=none]|\dots \arrow[r] & n-1 \arrow[r] & |[shape=rectangle]|n \end{tikzcd} \begin{tikzcd}[cells={nodes={draw=black, ellipse,anchor=center,minimum height=2em}}] 0 \arrow[r] & 1 \arrow[r] & |[draw=none]|\dots \arrow[r] & n-1 \arrow[r] & |[shape=rectangle]|n \end{tikzcd} i.e. add shape=rectangle. – user121799 Jul 31 '19 at 15:18

You're overcomplicating a bit, you just need

|[draw=red, rectangle]|


in the cell.

\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{shapes}
\begin{document}
\begin{figure}
\begin{tikzcd}[cells={nodes={draw=black, ellipse,anchor=center,minimum height=2em}}]
0 \arrow[r] & 1 \arrow[r] & |[draw=none]|\dots \arrow[r] & n-1 \arrow[r] & |[draw=red, rectangle]|n
\end{tikzcd}
\end{figure}
\end{document}

• thank you so much! Overcomplicating is almost everywhere in my life, unfortunatelly.. – Vladimir Parkhomenko Jul 31 '19 at 15:21
• @VladimirParkhomenko Don't worry about the difficulties. Think about how much I have with the LaTeX :-) – Sebastiano Jul 31 '19 at 15:26
• Thanks once again)) – Vladimir Parkhomenko Jul 31 '19 at 15:28