1

I know how to draw 3 rhombi above each other as follows:

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{tikz-cd}
    \usetikzlibrary{shapes.geometric}
    \begin{document}
    \[\begin{tikzcd}[sep = 2em,
        /tikz/rhombus/.style={shape=diamond,draw,minimum size=2em}]
     |[rhombus,draw,minimum size=3em]|{}\arrow[r,shorten >=0.5em,shorten <=0.5em] & 
     |[rhombus,append after command={\pgfextra{\let\myln\tikzlastnode}
     (\myln.north) node[anchor=south,rhombus] {}
     (\myln.south) node[anchor=north,rhombus] {}}]|{}\\
    \end{tikzcd}\]
    \end{document}

But what if inside the big rhombus I want to put 2 dotted lines to indicate the places where I will pinch it to get the 3 rhombi?

Any help in drawing this will be greatly appreciated!

Happy
  • 363

1 Answers1

2

You can use execute at end picture to add additional TikZ code to the diagram. So if you give the big node alias with alias=foo added to the style of the node, you can draw lines between the anchors of the node.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{shapes.geometric}
\begin{document}
\[
  \begin{tikzcd}[sep = 2em,
    /tikz/rhombus/.style={shape=diamond,draw,minimum size=2em},
    execute at end picture={
      \draw [densely dotted] (foo.north west) -- (foo.north east);
      \draw [densely dotted] (foo.south west) -- (foo.south east);
    }
    ]
 |[rhombus,draw,minimum size=3em, alias=foo]|{}\arrow[r,shorten >=0.5em,shorten <=0.5em] & 
 |[rhombus,append after command={\pgfextra{\let\myln\tikzlastnode}
 (\myln.north) node[anchor=south,rhombus] {}
 (\myln.south) node[anchor=north,rhombus] {}}]|{}\\
\end{tikzcd}
\]
\end{document}
Torbjørn T.
  • 206,688