3

I have a smart diagram:

\begin{frame}
    \begin{center}
      \smartdiagramanimated[descriptive diagram]{
      {Style},
  {Style,{Define shapes, colors, shading,
          and line styles for nodes and arrows}},
  {Position, {Place nodes using a matrix,
              relative or absolute positioning}},
  {Relation, Insert edges or arrows
             between selected nodes},
  {Label, Add labels on edges or arrows}}
    \end{center}
\end{frame}

Which produce the following diagram: enter image description here

But my problem is that I want 2 things:

1- I want the first "Style" item to be a rectangle like the ones down instead of being in a circle like that and to be in the center.

2- is there any possibility to add arrows in this specific descriptive diagram which links each circle and rectangle with the next one, maybe something like this will be helpful: enter image description here

2

1 Answer 1

7

The method from leandris' link does work if one uses the names indicated there. Let me start with a version in which we get rid of the unwanted node by overpainting it. (Below there is an alternative, which is arguably more elegant but also more "hacky" and that will cease to work in its current form if the package author changes the counter from \xi to something different which may not be a Greek letter.)

\documentclass{beamer}
\usepackage{smartdiagram}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}[plain]
\centering\tikzset{every picture/.append style={remember picture}}
\smartdiagramanimated[descriptive diagram]{
      {{},blub},
  {Style,{Define shapes, colors, shading,
          and line styles for nodes and arrows}},
  {Position, {Place nodes using a matrix,
              relative or absolute positioning}},
  {Relation, Insert edges or arrows
             between selected nodes},
  {Label, Add labels on edges or arrows}}
\begin{tikzpicture}[overlay,remember picture]
\only<1>{\fill[white] ([xshift=2mm]module1.west|-module-title1.north)
rectangle ++ (-1.8cm,-1.63cm);}
\fill[white] (module1.west|-module-title1.north)
rectangle ++ (-1.6cm,-1.63cm);
\foreach \X [count=\Y,evaluate=\Y as \Z using {int(2+2*\Y)}] in {2,...,5}
{\draw[line width=1mm,-latex,visible on=<\Z->] (module\Y.south) -- (module\X.north);}
\end{tikzpicture}
\end{frame}
\end{document}

As usual with remember picture, you need to compile twice.

ADDENDUM: Just for fun: this attempts to address the question

how can one "hack" packages like smartdiagram when they do exactly what we want except for a small detail?

One conceivable way of accomplishing this is to locally redefine the styles. In the following code the first round node gets removed without being overpainted. This is achieved by looking up the counter in the smartdiagram manual (which is really extremely well written). This counter is, as of now, called \xi (which may eventually lead to problems if some user wants to use the Greek letter $\xi$ in their code, they may be a bit surprised, so Claudio, if you read this, please let me know if you rename the counter so that I can modify the answer accordingly ;-). So all we need to do is to say

description title/.append style={/utils/exec={\ifnum\xi=1
\pgfkeysalso{opacity=0,every shadow/.append style={opacity=0}}
\fi}}

such that the first item remains invisible. This is the complete code.

\documentclass{beamer}
\usepackage{smartdiagram}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}[plain]
\centering\begingroup% we want to keep these hacks local
\tikzset{every picture/.append style={remember picture},
description title/.append style={/utils/exec={\ifnum\xi=1
\pgfkeysalso{opacity=0,every shadow/.append style={opacity=0}}
\fi}}}
\smartdiagramanimated[descriptive diagram]{
      {{},blub},
  {Style,{Define shapes, colors, shading,
          and line styles for nodes and arrows}},
  {Position, {Place nodes using a matrix,
              relative or absolute positioning}},
  {Relation, Insert edges or arrows
             between selected nodes},
  {Label, Add labels on edges or arrows}}
\begin{tikzpicture}[overlay,remember picture]
 \foreach \X [count=\Y,evaluate=\Y as \Z using {int(2+2*\Y)}] in {2,...,5}
  {\draw[line width=1mm,-latex,visible on=<\Z->] (module\Y.south) -- (module\X.north);}
\end{tikzpicture}\endgroup
\end{frame}
\end{document}
3
  • Thank you so much!! now I can work with it!! I really appreciate it, I'll use it for now and in the future I'll tinker with it and try to find a solution without drawing white over it
    – Hamza Hsn
    Jun 8, 2019 at 15:34
  • Sorry again @marmot but I have another issue which is I can't find in the documentation a way to resize the shape of the rectangle or circle when I put a large equation in them, also I tried to decrease the size of text but it didn't work well
    – Hamza Hsn
    Jun 8, 2019 at 17:16
  • @HamzaHsn You will have to increase the text width, and change the font e.g. to font=\small, see e.g. the example on the bottom of p. 13 of the smartdiagram manual. BTW I successfully "hacked" the package such that overpainting the circle is no longer necessary.
    – user121799
    Jun 8, 2019 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .