在 \begin{forest} 和 \end{forest} 中断线

在 \begin{forest} 和 \end{forest} 中断线

我想用“需要重大升级”来打破单元格中的文本,但我做不到。

\documentclass[dvipsnames,svgnames,x11names]{beamer}
\usepackage{amsmath}
\usepackage{amsfonts,amssymb}
\usepackage{xcolor}
\usepackage{txfonts}
\usepackage{graphicx}
\usepackage[edges]{forest}
\usepackage{flexisym}
\usetikzlibrary{shadows,arrows.meta}
\tikzset{
  selected/.style={draw=ProcessBlue, thick, rounded corners=2pt, inner color=ProcessBlue!25, outer color=ProcessBlue!35, drop shadow,},
}
\usepackage{ragged2e}\justifying
\usetheme{warsaw}
\usecolortheme[RGB={100, 90, 150}]{structure}
\begin{document}
\forestset{
  my tree/.style={
    forked edges,
    for tree={
      grow'=0,
      fork sep=5mm,
      drop shadow,
      anchor=parent,
      edge={draw=DarkOrchid3, -Latex, thick},
      l sep'=7.5mm,
    },
    before typesetting nodes={
      tempcounta/.max={level()-1}{tree},
      for tree={
        top color/.wrap pgfmath arg={blue!##1!WildStrawberry!50}{((level()-1)/(tempcounta))*100)},
        bottom color/.wrap pgfmath arg={blue!##1!WildStrawberry}{((level()-1)/(tempcounta))*100)},
        draw/.wrap pgfmath arg={blue!##1!WildStrawberry}{((level()-1)/(tempcounta))*100)},
        text=white,
        tier/.wrap pgfmath arg={tier ##1}{level()},
        content/.wrap value={\strut ##1},
      }
    },
    where level=0{phantom}{},
  }
}
\begin{frame}
\begin{forest}
  my tree
  [
   [Fundamental
     [require major 
    upgrades
   [Thermal
   ]
  [Quantum
  ]]
    ]
  [Technical 
    [Can be reduced
  [Electronics
  ]
    [Charging Noise
    ]
    [Control loops
    ]]
  ]
  [Environmental 
  [Seismic Motion
  ]
    [Magnetic Noise
    ]]
    ]
\end{forest}
\end{frame}
\end{document}

答案1

使用tabular

\begin{forest}
  my tree
  [
   [Fundamental
     [\begin{tabular}{@{}l@{}}require major \\ upgrades\end{tabular}
   [Thermal
   ]
  [Quantum
  ]]
<...the rest is the same...>

在此处输入图片描述

请注意,首字母必须\usetheme{Warsaw}大写。在某些系统(Windows)上,小写版本也可以工作,但文档无法移植。

相关内容