我的代码如下:
\documentclass[8pt]{beamer}
\setbeamertemplate{navigation symbols}{}
\usetheme{Madrid}
\usecolortheme[named=magenta]{structure}
\date{}
% TYPING PACKAGES
\usepackage{hyperref}
\usepackage{fancyhdr}
\usepackage{xcolor,rotating,epic,eepic}
% ANIMATION AND GRAPHIC PACKAGES
\usepackage{tikz}
%\usetikzlibrary{mindmap,trees}
\usepackage{verbatim}
\usepackage{smartdiagram}
\usetikzlibrary{mindmap,trees,shapes.geometric,overlay-beamer-styles} % tikz library for node shapes...
%\usesmartdiagramlibrary{additions}
%\usepackage[babel=true,kerning=true]{microtype}
\newtheorem{bloc}{}
\newcommand{\ztu}{\psi}
\newtheorem{alertbloc}{}
\beamersetuncovermixins{\opaqueness<1>{25}}{\opaqueness<2->{15}}
%\newcommand{\rouge}[1]{{\color{red}#1}}
%\newcommand{\bleu}[1]{{\color{blue}#1}}
%\newcommand{\green}[1]{{\color{green}#1}
\usepackage{eso-pic}
\begin{document}
\begin{frame}
\begin{center}
\begin{tikzpicture}
\tikzset{sun/.style={rectangle,
color = black!70,
fill = black!15,
minimum size = 2.75cm,
inner sep = 0.1cm}}
\tikzset{satellite/.style={rectangle,
color = black!70,
minimum size = 1.8cm,
inner sep = 0.1cm}}
\tikzset{satellitearrow/.style={-latex,
line width = 0.125cm}}
\draw (0,0) node (frame) [shape=regular polygon, minimum size=7cm, rotate=-15] {};
\node (sun) at (frame.center) [sun] {SUN};
\node (satellitea) at (frame.corner 1) [satellite, rectangle, inner sep=0cm, fill=yellow!50]
{{In 1974 J.Maynard. Smith},
{\begin{itemize}
\item $x^{'}_1(t)= x_1(t)[K_1-a_1 x_1(t)-b_{12}x_2(t)-\gamma_1x_1(t)x_2(t)]$
\item $x^{'}_2(t) = x_1(t)[K_2-a_2 x_2(t)-b_{21}x_1(t)-\gamma_2x_1(t)x_2(t)]$
\end{itemize}}};
\node (satelliteb) at (frame.corner 2) [satellite, rectangle, inner sep=0cm, fill=blue!50] {B-STAR};
\node (satellitec) at (frame.corner 3) [satellite, rectangle, inner sep=0cm, fill=green!50] {C-STAR};
\node (satellited) at (frame.corner 4) [satellite, rectangle, inner sep=0cm, fill=red!50] {D-STAR};
\node (satellitee) at (frame.corner 5) [satellite, rectangle, inner sep=0cm, fill=orange!50] {E-STAR};
\draw [satellitearrow, draw=yellow!50] (sun) -- (satellitea);
\draw [satellitearrow, draw=blue!50] (sun) -- (satelliteb);
\draw [satellitearrow, draw=green!50] (sun) -- (satellitec);
\draw [satellitearrow, draw=red!50] (sun) -- (satellited);
\draw [satellitearrow, draw=orange!50] (sun) -- (satellitee);
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
我只想显示我的方法的名称,后面跟着一些方程式和项目,但是我出现了这个错误:
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.75 \end{frame}
因此我想问一下有什么方法可以实现它吗?
答案1
为了itemize
在节点中使用类似的东西,您需要使用类似 的选项text width
。下面的方法有效,但输出肯定还有一些改进的空间。如果你给我提示,我可能会尝试帮助你实现更好的输出。有一件事很难不被注意到,那就是你正在加载smartdiagram
但没有使用它。相反,你正在使用和覆盖这个不错的包(例如 satellite)中的样式。
\documentclass[8pt]{beamer}
\setbeamertemplate{navigation symbols}{}
\usetheme{Madrid}
\usecolortheme[named=magenta]{structure}
\date{}
% ANIMATION AND GRAPHIC PACKAGES
\usepackage{tikz}
%\usetikzlibrary{mindmap,trees}
\usepackage{verbatim}
%\usepackage{smartdiagram}
\usetikzlibrary{mindmap,trees,shapes.geometric,overlay-beamer-styles} % tikz library for node shapes...
%\usesmartdiagramlibrary{additions}
\newtheorem{bloc}{}
\newcommand{\ztu}{\psi}
\newtheorem{alertbloc}{}
\beamersetuncovermixins{\opaqueness<1>{25}}{\opaqueness<2->{15}}
\usepackage{eso-pic}
\begin{document}
\begin{frame}
\begin{center}
\begin{tikzpicture}
\tikzset{sun/.style={rectangle,
color = black!70,
fill = black!15,
minimum size = 2.75cm,
inner sep = 0.1cm}}
\tikzset{satellite/.style={rectangle,
color = black!70,
minimum size = 1.8cm,
inner sep = 0.1cm}}
\tikzset{satellitearrow/.style={-latex,
line width = 0.125cm}}
\draw (0,0) node (frame) [shape=regular polygon, minimum size=7cm, rotate=-15] {};
\node (sun) at (frame.center) [sun] {SUN};
\node (satellitea) at (frame.corner 1)
[satellite,anchor=west,xshift=-2.5cm, rectangle, inner sep=0cm,
fill=yellow!50,text width=7.5cm]
{{In 1974 J.Maynard. Smith},
{\begin{itemize}
\item $x^{'}_1(t)= x_1(t)[K_1-a_1 x_1(t)-b_{12}x_2(t)-\gamma_1x_1(t)x_2(t)]$
\item $x^{'}_2(t) = x_1(t)[K_2-a_2 x_2(t)-b_{21}x_1(t)-\gamma_2x_1(t)x_2(t)]$
\end{itemize}}};
\node (satelliteb) at (frame.corner 2) [satellite, rectangle, inner sep=0cm, fill=blue!50] {B-STAR};
\node (satellitec) at (frame.corner 3) [satellite, rectangle, inner sep=0cm, fill=green!50] {C-STAR};
\node (satellited) at (frame.corner 4) [satellite, rectangle, inner sep=0cm, fill=red!50] {D-STAR};
\node (satellitee) at (frame.corner 5) [satellite, rectangle, inner sep=0cm, fill=orange!50] {E-STAR};
\draw [satellitearrow, draw=yellow!50] (sun) -- (satellitea);
\draw [satellitearrow, draw=blue!50] (sun) -- (satelliteb);
\draw [satellitearrow, draw=green!50] (sun) -- (satellitec);
\draw [satellitearrow, draw=red!50] (sun) -- (satellited);
\draw [satellitearrow, draw=orange!50] (sun) -- (satellitee);
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
如果你想利用smartdiagram
,你可以(再次)“破解”它(这里的一些元素来自这里)。
\documentclass{beamer}
\usepackage{smartdiagram}
\smartdiagramset{%
planet size=2cm,
planet text width=2cm,
planet font= \normalsize,
satellite size=1.5cm,
satellite text width=2cm,
satellite font= \normalsize,
distance planet-text=0,
distance planet-satellite=3.2cm,
/tikz/connection planet satellite/.append style={<->}
}
\begin{document}
\begin{frame}[plain]
\begingroup%<- keep hacks local
\tikzset{satellite/.append style={/utils/exec={\ifnum\xi=2
\pgfkeysalso{shape=rectangle,text width=8.5cm,xshift=2cm,font=\small}
\else
\ifnum\xi<5
\pgfkeysalso{shape=rectangle}
\fi
\fi}}}
\smartdiagramanimated[constellation diagram]{%
Sun,
{In 1974 J.Maynard. Smith
\begin{itemize}
\item $x^{'}_1(t)= x_1(t)[K_1-a_1 x_1(t)-b_{12}x_2(t)-\gamma_1x_1(t)x_2(t)]$
\item $x^{'}_2(t) = x_1(t)[K_2-a_2 x_2(t)-b_{21}x_1(t)-\gamma_2x_1(t)x_2(t)]$
\end{itemize}},
Sat B,
Sat C,
Sat D,
Sat E
}\endgroup
\end{frame}
\begin{frame}
\frametitle{Back to normal}
\smartdiagramanimated[constellation diagram]{%
Sun,
Sat A,
Sat B,
Sat C,
Sat D,
Sat E
}
\end{frame}
\end{document}
当然,如果所有卫星都很庞大,你可以使用例如这个答案作为动画版本的起点。