0

I would like to replace the single arrows in the code below to 2 arrows (to and from each node). I need to animate it, so I want to adjust to adjust the code in first slide to produce that.

\documentclass{beamer}
\mode<presentation>{\usetheme{Madrid}}

\usepackage{tikz} \usetikzlibrary{backgrounds,fit,matrix}

\tikzstyle{bigbox} = [minimum size=3cm,draw=blue!50, thick, fill=blue!10, rounded corners, rectangle] \tikzstyle{box} = [minimum size=1.5cm, rounded corners,rectangle, fill=blue!50] \tikzstyle{arrow} = [thick,->,>=stealth]

\begin{document}

\begin{frame}[fragile]

\begin{tikzpicture}

\node (box11) [box] {11};

\node (box12) [box, right of=box11,xshift=2cm] {12};

\node (box13) [box, right of=box12,xshift=2cm] {13};

\node (box21) [box, below of=box11,yshift=4cm] {21};

\node (box22) [box, right of=box21,xshift=2cm] {22};

\node (box23) [box, right of=box22,xshift=2cm] {23};

\draw<.(1)-> [arrow] (box11) -- (box12); \draw<.(1)-> [arrow] (box12) -- (box13); \draw<.(1)-> [arrow] (box21) -- (box22); \draw<.(1)-> [arrow] (box22) -- (box23); \draw<.(1)-> [arrow] (box12) -- (box22); \draw<.(1)-> [arrow] (box13) -- (box23);

\end{tikzpicture} \end{frame}

\end{document}

Curious
  • 332
  • Please provide a sketch of desired result. Your description of your wish is not very clear. Can be arrows bended? – Zarko Aug 07 '20 at 14:37
  • 1
    https://tex.stackexchange.com/questions/5461/is-it-possible-to-change-the-size-of-an-arrowhead-in-tikz-pgf -- have a look for the type of arrow you want – js bibra Aug 07 '20 at 14:55
  • \draw<.(1)-> --what is the command – js bibra Aug 07 '20 at 14:58

2 Answers2

4

Like this?

enter image description here

\documentclass{beamer}
\mode<presentation>{\usetheme{Madrid}}

\usepackage{tikz} \usetikzlibrary{arrows.meta, backgrounds, fit, matrix}

\begin{document} \begin{frame}[fragile] \begin{tikzpicture}[ every edge/.style = {draw, thick, -Stealth} ] \matrix (m) [matrix of nodes, nodes={rounded corners, fill =blue!50, minimum size=15mm}, column sep=20mm, row sep=20mm ] { 21 & 22 & 23 \ 11 & 12 & 13 \ }; \path[transform canvas={yshift=+2mm}] (m-1-1) edge (m-1-2) (m-1-2) edge (m-1-3) (m-2-1) edge (m-2-2) (m-2-2) edge (m-2-3); \path[transform canvas={yshift=-2mm}] (m-1-2) edge (m-1-1) (m-1-3) edge (m-1-2) (m-2-2) edge (m-2-1) (m-2-3) edge (m-2-2); \path[transform canvas={xshift=+2mm}] (m-1-2) edge (m-2-2) (m-1-3) edge (m-2-3); \path[transform canvas={xshift=-2mm}] (m-2-2) edge (m-1-2) (m-2-3) edge (m-1-3); \end{tikzpicture} \end{frame} \end{document}

Zarko
  • 296,517
  • Yes, exactly. But in the matrix environment, is there a possibility to animate it, i.e., to control when each box (11 till 23) appear in transition slides. For example, each box appears on each slide. – Curious Aug 07 '20 at 16:07
  • @Curious, this is new question. Ask it as such! Anyway, see http://tex.stackexchange.com/questions/294908/ – Zarko Aug 07 '20 at 17:44
0

Use

\tikzstyle{arrow} = [thick,<->,>=stealth]

enter image description here

js bibra
  • 21,280