\filldraw 无法与 beamer 配合使用

\filldraw 无法与 beamer 配合使用

\filldraw 命令没有执行,我不知道为什么。完全相同的代码在我的报告中运行良好。

我有一个最低限度的工作示例:

\documentclass{beamer}

\usepackage{tikz}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{booktabs} % \toprule, \midrule and \bottomrule in tables

\mode<presentation> {\usetheme{Madrid}\setbeamertemplate{navigation symbols}{}}

\begin{document}

\begin{frame}{Extending To Hypergraphs}
    A \emph{hypergraph} $H$ is a generalization of a graph:

\begin{center}
    \begin{tikzpicture}
        \node (v1) at (0,2) {};
        \node (v2) at (1.5,3) {};
        \node (v3) at (4,2.5) {};
        \node (v4) at (0,0) {};
        \node (v5) at (2,0.5) {};
        \node (v6) at (3.5,0) {};
        \node (v7) at (2.5,-1) {};
        \begin{scope}[fill opacity=0.8]
            \filldraw[fill=red] ($(v1)+(-0.5,0)$) to[out=90,in=180] ($(v2) + (0,0.5)$) to[out=0,in=90] ($(v3) + (1,0)$) to[out=270,in=0] ($(v2) + (1,-0.8)$) to[out=180,in=270] ($(v1)+(-0.5,0)$);
            \filldraw[fill=blue] ($(v4)+(-0.5,0.2)$) to[out=90,in=180] ($(v4)+(0,1)$) to[out=0,in=90] ($(v4)+(0.6,0.3)$) to[out=270,in=0] ($(v4)+(0,-0.6)$) to[out=180,in=270] ($(v4)+(-0.5,0.2)$);
            \filldraw[fill=green] ($(v5)+(-0.5,0)$) to[out=90,in=225] ($(v3)+(-0.5,-1)$) to[out=45,in=270] ($(v3)+(-0.7,0)$) to[out=90,in=180] ($(v3)+(0,0.5)$) to[out=0,in=90] ($(v3)+(0.7,0)$) to[out=270,in=90] ($(v3)+(-0.3,-1.8)$) to[out=270,in=90] ($(v6)+(0.5,-0.3)$) to[out=270,in=270] ($(v5)+(-0.5,0)$);
            \filldraw[fill=yellow] ($(v2)+(-0.5,-0.2)$) to[out=90,in=180] ($(v2) + (0.2,0.4)$) to[out=0,in=180] ($(v3) + (0,0.3)$) to[out=0,in=90] ($(v3) + (0.3,-0.1)$) to[out=270,in=0] ($(v3) + (0,-0.3)$) to[out=180,in=0] ($(v3) + (-1.3,0)$) to[out=180,in=270] ($(v2)+(-0.5,-0.2)$);
        \end{scope}
        \foreach \v in {1,2,...,7} {\fill (v\v) circle (0.1);}

        \fill (v1) circle (0.1) node [right] {$v_1$};
        \fill (v2) circle (0.1) node [below left] {$v_2$};
        \fill (v3) circle (0.1) node [left] {$v_3$};
        \fill (v4) circle (0.1) node [below] {$v_4$};
        \fill (v5) circle (0.1) node [below right] {$v_5$};
        \fill (v6) circle (0.1) node [below left] {$v_6$};
        \fill (v7) circle (0.1) node [below right] {$v_7$};

        \node at (0.2,2.8) {$e_1$};
        \node at (2.3,3) {$e_2$};
        \node at (3,0.8) {$e_3$};
        \node at (0.1,0.7) {$e_4$};
    \end{tikzpicture}
\end{center}
\end{frame}
\end{document}

相关内容