5

Thanks to this answer here; I can draw a nice cubic diagram as bellow:

enter image description here

with the following code:

\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}

Now I want to add an arrow or chevron (possibly on each of 6 sides of the cubic); for example, on the left surface I want to have something like:

enter image description here

I draw the above picture in powerpoint. Is it possible to achieve such a thing with latex? (the chevron shape in the picture is not a must; it can be replaced with double arrow or anything showing the purpose)


Update:

I could manage to shift the chevron to the bellow surface according to the @Henri answer and his instructions below. Here it is:

\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}

enter image description here

4

The tikz-cd diagram is just a usual matrix of nodes. You can use the remember picture and overlay functionality to draw onto the existing drawing.

The positions where the arrows enter and emanate from the chevron are determined in a kind of hackish way, namely by trial and error. Also, many dimensions are hardcoded, so scaling the drawing is not straight forward.

\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}

enter image description here

  • Which parameters should I change to move the chevron on the other surfaces? ( I tried some, but I failed) and Is it possible to skew it a little bit? – qartal Nov 6 '15 at 17:19
  • 1
    @qartal The chevron is placed at ([xshift=-.6cm,yshift=-.2cm]\tikzcdmatrixname-2-2), i.e. 0.6 cm to the left and 0.2 cm below of “C”. That is to say, you have to adjust at (...) of the PB node to place the chevron somewhere else. You may rotate the chevron by changing rotate=<angle>, the skew parameter is signal pointer angle. – Henri Menke Nov 6 '15 at 17:23
  • May you please take a look at the picture I added. How to shift the head of dotted arrows going from edge 6 to the chevron to touch the chevron edge. – qartal Nov 6 '15 at 18:00
  • @qartal Please post this as a new question. This is not a traditional forum. – Henri Menke Nov 6 '15 at 18:47
  • I update the question. However, your post still remains answering the content in the question completely. I will post it as a question later if I can not figure that out. – qartal Nov 6 '15 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.