这是我想要绘制的图形:
一个大菱形 $\rightarrow$ 3 个较小的菱形,一个叠一个,相互连接。
任何有关绘图的帮助都将不胜感激!
答案1
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{shapes.geometric}
\begin{document}
\[\begin{tikzcd}[sep = large,
/tikz/rhombus/.style={shape=diamond,draw,minimum size=3em}]
|[rhombus,draw]|{}\arrow[r] &
|[rhombus,append after command={\pgfextra{\let\myln\tikzlastnode}
(\myln.north) node[anchor=south,rhombus] {}
(\myln.south) node[anchor=north,rhombus] {}}]|{}\\
\end{tikzcd}\]
\end{document}
您可以使用 键控制菱形的大小,使用和键minimum size
控制箭头的长度。sep
shorten
\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}