在立方体图的表面添加元素

在立方体图的表面添加元素

感谢这个答案这里;我可以画出如下所示的漂亮的立方图:

在此处输入图片描述

使用以下代码:

\documentclass{standalone}
\usepackage{tikz-cd}

\begin{document}
    \begin{tikzcd}[
        row sep=scriptsize,
        column sep=scriptsize,]
        A\ar[rr,"1",hook]\ar[dr,"2",hook] & & B\ar[dr,"3",hook]\ar[<-,dd,"10",near end] & \\
        & C\ar[rr,"4",near start,crossing over,hook] & & G & \\
        H\ar[rr,"5",near start,hook]\ar[dr,"6",hook]\ar[uu,"9"] & & D\ar[dr,"7", hook] & \\
        & E\ar[rr,"8",hook]\ar[uu,"11",crossing over,near start,swap] & & F\ar[uu,"12",swap] &
    \end{tikzcd}
\end{document}

现在我想添加一个箭头或 V 形(可能在立方体的 6 个侧面上);例如,在左侧表面上我想要类似的东西:

在此处输入图片描述

上面的图片是我在 powerpoint 里画的。用 latex 能实现吗?(图片里的 V 字形不是必须的,可以用双箭头或者其他能显示目的的东西代替)


更新:

我可以按照@Henri 的回答和下面的说明将 V 形臂移至波纹表面。如下所示:

\begin{tikzcd}[
  remember picture,
  row sep=scriptsize,
  column sep=scriptsize,]
  A\ar[rr,"1",hook]\ar[dr,"2",""{coordinate,name=two},hook] & & B\ar[dr,"3",hook]\ar[<-,dd,"10",near end] & \\
  & C\ar[rr,"4",near start,crossing over,hook] & & G & \\
  H\ar[rr,"5",near start,""{coordinate,name=five},hook]\ar[dr,"6",""{coordinate,name=six},hook]\ar[uu,"9",""{coordinate,name=nine}] & & D\ar[dr,"7",""{coordinate,name=seven}, hook] & \\
  & E\ar[rr,"8",""{coordinate,name=eight},hook]\ar[uu,"11",""{pos=.9,coordinate,name=eleven},crossing over,near end,swap] & & F\ar[uu,"12",swap] &
\end{tikzcd}



\begin{tikzpicture}[remember picture,overlay,
conn/.style = {{Circle[scale=.5]}-{Stealth[scale=.5]},gray!40,
    shorten >=1pt, shorten <=1pt,dash pattern=on 2pt off 1pt}
]
\node[draw,fill=red!20,signal,signal from=west,signal pointer angle=145,
inner sep=0pt,rotate=-28]
(PB) at ([xshift=.5cm,yshift=-1.46cm]\tikzcdmatrixname-2-2)
{\vrule height 2em width 0pt};
\node at ([yshift=15pt,xshift=15pt]PB.south) {\tiny PB};
\draw[conn] (five) to[bend right=10] (PB.80);
\draw[conn] (PB.280) to[bend left] (eight);
\draw[conn] (\tikzcdmatrixname-3-1) to[bend right=0] (PB);
\draw[conn] (PB) to[bend right=0] (\tikzcdmatrixname-4-4);
\draw[conn] (six) to[bend left=10] (PB.-70);
\draw[conn] (PB.80) to[bend right] (seven);
\end{tikzpicture}

在此处输入图片描述

答案1

tikz-cd图表只是一种常见的图表matrix of nodes。您可以使用remember pictureoverlay功能在现有图纸上进行绘制。

箭头进入和离开 V 形的位置是通过一种老套的方法确定的,即通过反复试验。此外,许多尺寸都是硬编码的,因此缩放绘图并不简单。

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,cd,shapes.symbols}

\begin{document}
\begin{tikzcd}[
  remember picture,
  row sep=scriptsize,
  column sep=scriptsize,]
  A\ar[rr,"1",hook]\ar[dr,"2",""{coordinate,name=two},hook] & & B\ar[dr,"3",hook]\ar[<-,dd,"10",near end] & \\
  & C\ar[rr,"4",near start,crossing over,hook] & & G & \\
  H\ar[rr,"5",near start,hook]\ar[dr,"6",""{coordinate,name=six},hook]\ar[uu,"9",""{coordinate,name=nine}] & & D\ar[dr,"7", hook] & \\
  & E\ar[rr,"8",hook]\ar[uu,"11",""{pos=.9,coordinate,name=eleven},crossing over,near start,swap] & & F\ar[uu,"12",swap] &
\end{tikzcd}

\begin{tikzpicture}[remember picture,overlay,
  conn/.style = {{Circle[scale=.5]}-{Stealth[scale=.5]},gray!40,
    shorten >=1pt, shorten <=1pt,dash pattern=on 2pt off 1pt}
  ]
  \node[draw,fill=gray!40,signal,signal from=west,signal pointer angle=135,
  inner sep=0pt,rotate=220]
  (PB) at ([xshift=-.6cm,yshift=-.2cm]\tikzcdmatrixname-2-2)
  {\vrule height 2em width 0pt};
  \node at ([yshift=5pt]PB.south) {\tiny PB};
  \draw[conn] (two) to[bend left] (PB.246);
  \draw[conn] (PB.280) to[bend left] (nine);
  \draw[conn] (\tikzcdmatrixname-2-2) to[bend right=20] (PB);
  \draw[conn] (PB) to[bend right=20] (\tikzcdmatrixname-3-1);
  \draw[conn] (eleven) to[bend right] (PB.114);
  \draw[conn] (PB.80) to[bend right] (six);
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容