如何减少这片森林的面积?

如何减少这片森林的面积?
\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}

答案1

我个人不会选择任何如此花哨的东西,但如果你喜欢闪亮的东西,你可以使用这样的东西:

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

省略号必须去掉。 也一样\large。路径也一样rounded corners。如果你能缩写一些文本,你就能让它看起来更整洁,但我不知道这是否是一个选择。

答案2

另一个起点可以是以下重新设计您的forest图像:

在此处输入图片描述

代码不太优雅,因为它在联邦法规答案但结果图像与原始图像更相似。它结合foresttikz

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

相关内容