2
\documentclass[xcolor=table]{beamer}

\usepackage[american,francais]{babel}
\usepackage{listings}
\usepackage{microtype}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[final]{pdfpages}
\usepackage{smartdiagram}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning}
\usepackage{relsize}
\usepackage{mathtools,amsmath}
\usepackage{graphics,bm}
\usepackage{pifont}
\usepackage{color}
\usepackage{calligra}
\usepackage{verbatim}
\usepackage{amsfonts,amsmath,amssymb}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{forest}
\usetikzlibrary{arrows.meta, shapes.geometric, calc, shadows}

\colorlet{mygreen}{green!75!black}
\colorlet{col1in}{red!30}
\colorlet{col1out}{red!40}
\colorlet{col2in}{mygreen!40}
\colorlet{col2out}{mygreen!50}
\colorlet{col3in}{blue!30}
\colorlet{col3out}{blue!40}
\colorlet{col4in}{mygreen!20}
\colorlet{col4out}{mygreen!30}
\colorlet{col5in}{blue!10}
\colorlet{col5out}{blue!20}
\colorlet{col6in}{blue!20}
\colorlet{col6out}{blue!30}
\colorlet{col7out}{orange}
\colorlet{col7in}{orange!50}
\colorlet{col8out}{orange!40}
\colorlet{col8in}{orange!20}
\colorlet{linecol}{blue!60}

\begin{document}
\begin{frame}%[fragile]
  \frametitle{Commande}
\pgfkeys{/forest,
  rect/.append style={rectangle, rounded corners=2pt, inner color=col6in, outer color=col6out},
  ellip/.append style={ellipse, inner color=col5in, outer color=col5out},
  orect/.append style={rect, font=\sffamily\bfseries\normalsize, text width=150pt, text centered, minimum height=5pt, outer color=col7out, inner color=col7in},
  oellip/.append style={ellip, inner color=col8in, outer color=col8out, font=\sffamily\bfseries\large, text centered},
}
\begin{forest}
  for tree={
      font=\sffamily\bfseries,
      line width=1pt,
      draw=linecol,
      ellip,
      align=center,
      child anchor=north,
      parent anchor=south,
      drop shadow,
      l sep+=12.5pt,
      edge path={
        \noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
          (!u.parent anchor) -- +(0,-5pt) -|
          (.child anchor)\forestoption{edge label};
        },
      where level={3}{tier=tier3}{},
      where level={0}{l sep-=1.5pt}{},
      where level={1}{
        if n={1}{
          edge path={
            \noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
              (!u.west) -| (.child anchor)\forestoption{edge label};
            },
        }{
          edge path={
            \noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
              (!u.east) -| (.child anchor)\forestoption{edge label};
            },
        }
      }{},
  }
  [Compressed Sensing\\Theory, inner color=col1in, outer color=col1out
    [Projection Matrix\\Theory, inner color=col2in, outer color=col2out
      [Optimise Projection\\Matrix, inner color=col4in, outer color=col4out]
      [Reduce Number of\\Measurements, inner color=col4in, outer color=col4out]
    ]
    [Reconstruction\\Algorithms, inner color=col3in, outer color=col3out
      [Convex Relaxation
        [Sparse Signal\\Estimate, rect, name=sse1
        ]
      ]
      [Greedy Pursuits
        [Sparse Signal\\Estimate, rect, name=sse2
        ]
      ]
      [, phantom, calign with current
        [A\\B, phantom
          [Our Work, orect, name=us
            [{Improved Sparse Signal Estimate!}, oellip
            ]
          ]
        ]
      ]
      [Non-Convex\\Minimisation Methods
        [Sparse Signal\\Estimate, rect, name=sse3
        ]
      ]
      [Combinatorial\\Algorithms
        [Sparse Signal\\Estimate, rect, name=sse4
        ]
      ]
    ]
  ]
  \begin{scope}[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->]
    \draw (sse2.south) -- (us.north -| sse2.south);
    \draw (sse3.south) -- (us.north -| sse3.south);
    \coordinate (c1) at ($(sse1.south)!2/5!(sse2.south)$);
    \coordinate (c2) at ($(sse3.south)!2/5!(sse4.south)$);
    \draw (sse1.south) -- +(0,-10pt) -| (us.north -| c1);
    \draw (sse4.south) -- +(0,-10pt) -| (us.north -| c2);
  \end{scope}
\end{forest}
\end{frame}
\end{document}
Elyes
  • 181
  • apparently you need to redraw your forest. as it is now it can't be fit on a4 paper ... some advises: reduce font size to tiny, reduce inner sep, break nodes text into three lines, etc. – Zarko Sep 02 '18 at 19:33
  • If you want more detailed help, please reduce your example to what's actually needed for the example. It is extremely improbable your example requires all those packages. (It is very unlikely you need them all in your real document. Some are certainly redundant, anyhow.) Also, avoid loading the same package multiple times. It spells trouble sooner or later. – cfr Sep 02 '18 at 23:25
  • Also, please attribute code which you get from other people. Not only is this probably legally required, which strikes me as of minor relevance here, but it is rude and makes it more difficult for people to help you, to boot, if they don't have access to the original context. And your code would benefit from an update to current Forest which would make the setup considerably less verbose. – cfr Sep 02 '18 at 23:27
  • @Zarko \tiny will be useless: the audience will never be able to read it. Even \small isn't great for a whole slide. You might as well just draw some dots instead of the words if you use \tiny. – cfr Sep 02 '18 at 23:30
  • You need to rethink this. You clearly cannot do anything like this in the space of a slide. You are only getting a tiny fraction of the material you've got on there. So, either rethink the content or rethink the format or both. Only you can do this because only you know what matters for your audience and your message. – cfr Sep 03 '18 at 00:09
  • @cfr, at beamer tiny is not so small (default font size is 24pt, if i remember correctly). of course the use of the bigger font size is better. – Zarko Sep 03 '18 at 00:11
  • @Zarko Default font size is 11pt. – cfr Sep 03 '18 at 01:11

2 Answers2

4

I would personally not opt for anything so garish, but, if bling is your thing, you might use something like this:

squeezed bling for Beamer

\documentclass[beamer]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta, shadows}

\colorlet{mygreen}{green!75!black}
\colorlet{col1in}{red!30}
\colorlet{col1out}{red!40}
\colorlet{col2in}{mygreen!40}
\colorlet{col2out}{mygreen!50}
\colorlet{col3in}{blue!30}
\colorlet{col3out}{blue!40}
\colorlet{col4in}{mygreen!20}
\colorlet{col4out}{mygreen!30}
\colorlet{col5in}{blue!10}
\colorlet{col5out}{blue!20}
\colorlet{col6in}{blue!20}
\colorlet{col6out}{blue!30}
\colorlet{col7out}{orange}
\colorlet{col7in}{orange!50}
\colorlet{col8out}{orange!40}
\colorlet{col8in}{orange!20}
\colorlet{linecol}{blue!60}
% \newenvironment{frame}{}{}
\standaloneenv{frame}
\begin{document}
\begin{frame}[fragile]
  \frametitle{Commande}
  \forestset{
    rect/.append style={inner color=col6in, outer color=col6out},
    ellip/.append style={inner color=col5in, outer color=col5out},
    orect/.append style={outer color=col7out, inner color=col7in},
    oellip/.append style={inner color=col8in, outer color=col8out, font=\bfseries},}
  \begin{forest}
    for tree={
      line width=1pt,
      inner sep=2pt,
      font=\small,
      draw=linecol,
      ellip,
      align=center,
      drop shadow,
      parent anchor=children,
      child anchor=parent,
      rounded corners,
      l sep+=2.5pt,
      edge+={color=linecol,  -{Stealth}, line width=1pt},
      if level={3}{tier=tier3}{},
      if level={0}{l sep-=1.5pt}{},
    },
    forked edges,
    [Compressed Sensing Theory, inner color=col1in, outer color=col1out
    [, coordinate, edge+={-} [, coordinate, edge+={-} [Projection Matrix Theory, inner color=col2in, outer color=col2out
        [Optimise\\Projection\\Matrix, inner color=col4in, outer color=col4out]
        [Reduce\\Number of\\Measurements, inner color=col4in, outer color=col4out]
      ]]]
      [Reconstruction Algorithms, inner color=col3in, outer color=col3out
        [Convex\\Relaxation ]
        [Greedy\\Pursuits]
        [A\\B\\C, phantom, calign with current [Sparse Signal\\Estimate, rect, delay={for nodewalk/.process={OOw2 {name}{edge}{ {fake=u,siblings}{tikz+={\path [#2] (.parent anchor) -- (nmm.parent anchor |- .parent anchor)-- +(\forestoption{fork sep},0pt) |- (#1.child anchor); } } } }}
            [Our Work, orect, 
              [{Improved Sparse Signal Estimate!}, oellip
            ]]
          ]
        ]
        [Non-Convex\\Minimisation\\Methods, name=nmm]
        [Combinatorial\\Algorithms ]
      ]
    ]
  \end{forest}
\end{frame}
\end{document}

The ellipses have to go. So does \large. So do rounded corners for the paths. You can make it look neater if you can abbreviate some texts, but I don't know if that's an option.

cfr
  • 198,882
2

another starting point can be the following redesign your forest image:

enter image description here

code is less elegant as it is in cfr's answer but resulted image is a bit more similar to your original one. it combine forest with tikz:

\documentclass[xcolor=table]{beamer}

\usepackage[american,francais]{babel}
\usepackage{listings}
\usepackage{microtype}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[final]{pdfpages}
\usepackage{smartdiagram}
%\usepackage{tikz}     % <-- loaded by forest
\usepackage{relsize}
\usepackage{mathtools,
            % amsmath  % <-- loaded by mathtools
            }
\usepackage{%graphics, % <-- loaded by graphicx,
            bm}
\usepackage{pifont}
%\usepackage{color}    % <-- beamer load xcolor, which is enhanced color
\usepackage{calligra}
\usepackage{verbatim}
\usepackage{% amsfonts, % <-- loaded by amssymb
            % amsmath,  % <-- loaded by mathtools
            amssymb}
%\usepackage[T1]{fontenc}
%\usepackage{graphicx}  % <-- loaded by beamer
\usepackage{forest}
\usetikzlibrary{arrows.meta,    % <-- moved after forest
                calc,
                positioning,
                shadows, shadows.blur,
                shapes.symbols, shapes.geometric, }

%\usetikzlibrary{arrows.meta, calc, positioning, shapes.geometric, calc, shadows}

\colorlet{mygreen}{green!75!black}
\colorlet{col1in}{red!30}
\colorlet{col1out}{red!40}
\colorlet{col2in}{mygreen!40}
\colorlet{col2out}{mygreen!50}
\colorlet{col3in}{blue!30}
\colorlet{col3out}{blue!40}
\colorlet{col4in}{mygreen!20}
\colorlet{col4out}{mygreen!30}
\colorlet{col5in}{blue!10}
\colorlet{col5out}{blue!20}
\colorlet{col6in}{blue!20}
\colorlet{col6out}{blue!30}
\colorlet{col7out}{orange}
\colorlet{col7in}{orange!50}
\colorlet{col8out}{orange!40}
\colorlet{col8in}{orange!20}
\colorlet{linecol}{blue!60}

\begin{document}
\begin{frame}[fragile]
\frametitle{Commande}
\centering

\tikzset{
   node distance = 9pt and 0pt,
       fs/.style = {font=\sffamily\bfseries\small},
rect/.style args = {#1/#2}{rectangle, draw=linecol, line width=1pt, rounded corners=2pt,
                           inner color=#1, outer color=#2},
   rect/.default = col6in/col6out,
 oellip/.style   = {ellipse, draw=linecol, line width=1pt,
                    inner color=col8in, outer color=col8out,
                    fs, align=center,
                    inner xsep=-3pt},
        }

\begin{forest}
  for tree={
      rect,
      font=\sffamily\bfseries\scriptsize\linespread{0.8}\selectfont,
      align=center,
      drop shadow,
      child anchor=north,
      parent anchor=south,
      l sep+=3pt,   s sep=3.3pt,
    edge = {color=linecol, rounded corners=3pt, -{Stealth[length=5pt]}, line width=1pt},
    edge path={ \noexpand\path[\forestoption{edge}]
          (!u.parent anchor) -- +(0,-5pt) -| (.child anchor); },
      where level={1}{l sep+=3pt,
        if n={1}{
          edge path={
            \noexpand\path[\forestoption{edge}]
              (!u.west) -| (.child anchor);},
        }{
          edge path={\noexpand\path[\forestoption{edge}]
              (!u.east) -| (.child anchor);},
        }
      }{},
      where level={3}{tier=tier3,l sep+=3pt}{},
  }
  [Compressed Sensing Theory, rect=col1in/col1out, fs
    [Projection Matrix\\Theory, rect=col2in/col2out
      [Optimise\\ Projection\\Matrix, rect=col4in/col4out]
      [Reduce\\ Number of\\Measurements, rect=col4in/col4out]
    ]
    [Reconstruction\\Algorithms, %inner color=col3in, outer color=col3out
      [Convex\\ Relaxation
        [Sparse\\ Signal\\Estimate, name=sse1]
      ]
      [Greedy\\ Pursuits
        [Sparse\\ Signal\\Estimate, name=sse2]
      ]
      [Non-Convex\\Minimisation\\ Methods
        [Sparse\\ Signal\\Estimate, name=sse3]
      ]
      [Combinatorial\\Algorithms
        [Sparse\\ Signal\\Estimate, name=sse4
        ]
      ]
    ]
  ]
\draw   let \p1=($(sse1.west)-(sse4.east)$),
            \n1={veclen(\x1,\y1)} in
        node[rect=col7in/col7out, fs,
             minimum width=\n1, below right=of sse1.south west]
             (us) {Our Work};
\node[oellip, below=of us] (isse) {Improved Sparse\\ Signal Estimate!};
\draw[color=linecol, rounded corners=3pt, -{Stealth[length=5pt]}, line width=1pt]
    (sse1) edge (us.north -| sse1)
    (sse2) edge (us.north -| sse2)
    (sse3) edge (us.north -| sse3)
    (sse4) edge (us.north -| sse4)
    (us)   edge (isse);
\end{forest}
\end{frame}
\end{document}
Zarko
  • 296,517