在 beamer 中自定义节点内的项目

在 beamer 中自定义节点内的项目

我正在使用下面的 MWE,并尝试做一些看似简单但我无法弄清楚的事情。

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{positioning,calc,decorations.pathreplacing}

\begin{document}



\begin{frame}

\begin{tikzpicture}
    \node (B) at (0,0) {\includegraphics[scale=.2]{example-image}};


    \node[circle, fill=red!50!black, opacity=.5, minimum size=.4cm] (nuc) at (B) {};
    \node[circle, fill=red!50!black, opacity=.5, minimum size=.4cm] (cyt) at ($(B)+(.4,.4)$) {};
    \node[circle, fill=green!25!black, opacity=.5, minimum size=.4cm] (cha) at ($(B)+(.8,-.6)$) {};
    \node[circle, fill=green!25!black, opacity=.5, minimum size=.4cm] (mem) at ($(B)+(.4,-1)$) {};


    \node[right=1cm of B.north east, align=left, text width=3cm, font=\tiny, fill=yellow] (C1) {
        \begin{itemize}
         \item RNA processing
         \item DNA repair
         \item cell cycle regulation
         \item cellular component organization
         \item metabolic pathways
        \end{itemize}
    };
    \draw[thick,decorate,decoration={brace,mirror,amplitude=5pt}, color=red!50!black] (C1.north west) -- (C1.south west) node[midway] {};

    \node[right=0.5cm of B.east, align=left, shift={(0cm,-1.5cm)}, text width=4cm, font=\tiny, fill=yellow] (C2) {
        \begin{itemize}
         \item bind growth factors, receptors and metal ions
         \item cell signaling and communication
         \item cell migration, motility, localization and adhesion
        \end{itemize}
    };
    \draw[thick,decorate,decoration={brace,mirror,amplitude=5pt}, color=green!25!black] (C2.north west) -- (C2.south west) node[midway] {};

    \path[->, >=latex, red!50!black, opacity=.6, line width=1pt] {[out=350,in=180]
        (nuc) edge ($(C1.west)-(.2,0)$)
        (cyt) edge ($(C1.west)-(.2,0)$)};
    \path[->, >=latex, green!25!black, opacity=.6, line width=1pt] {[out=350,in=180]
        (cha) edge ($(C2.west)-(.2,0)$)
        (mem) edge ($(C2.west)-(.2,0)$)};

\end{tikzpicture}
\end{frame}

\end{document}

它产生以下输出:

我只想要:

  1. 上方黄色框中为红色文字,下方黄色框中为绿色文字

  2. 每个项目代表红色和绿色圆圈

  3. 项目之间没有垂直空间

  4. 项目无缩进

  5. 项目圆圈和文本之间没有水平空间

任何帮助,将不胜感激。

答案1

稍微玩一下:

\setbeamertemplate{itemize items}[circle]

\setbeamercolor{local structure}{fg=red!50!black}\color{red!50!black}

\setlength{\leftmargini}{6pt}

\setlength{\labelsep}{1pt}

\color{red!50!black}

\itemsep1pt

我想出了以下 MWE:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{positioning,calc,decorations.pathreplacing}

\begin{document}



\begin{frame}

\begin{tikzpicture}[every node/.style={inner sep=0,outer sep=0}]
    \node (B) at (0,0) {\includegraphics[scale=.2]{example-image}};


    \node[circle, fill=red!50!black, opacity=.5, minimum size=.4cm] (nuc) at (B) {};
    \node[circle, fill=red!50!black, opacity=.5, minimum size=.4cm] (cyt) at ($(B)+(.4,.4)$) {};
    \node[circle, fill=green!25!black, opacity=.5, minimum size=.4cm] (cha) at ($(B)+(.8,-.6)$) {};
    \node[circle, fill=green!25!black, opacity=.5, minimum size=.4cm] (mem) at ($(B)+(.4,-1)$) {};


    \node[right=1cm of B.north east, align=left, text width=3.2cm, font=\tiny, fill=yellow] (C1) {
    \setbeamertemplate{itemize items}[circle]
    \setbeamercolor{local structure}{fg=red!50!black}\color{red!50!black}
    \setlength{\leftmargini}{6pt}
    \setlength{\labelsep}{1pt}
        \begin{itemize}
        \color{red!50!black}
        \itemsep1pt
            \item RNA processing
            \item DNA repair
            \item cell cycle regulation
            \item cellular component organization
            \item metabolic pathways
        \end{itemize}
    };
    \draw[thick,decorate,decoration={brace,mirror,amplitude=5pt}, color=red!50!black] (C1.north west) -- (C1.south west) node[midway] {};

    \node[right=0.5cm of B.east, align=left, shift={(0cm,-1.5cm)}, text width=4.8cm, font=\tiny, fill=yellow] (C2) {
        \setbeamertemplate{itemize items}[circle]
        \setbeamercolor{local structure}{fg=green!25!black}\color{red!50!black}
        \setlength{\leftmargini}{6pt}
        \setlength{\labelsep}{1pt}
        \begin{itemize}
        \color{green!25!black}
        \itemsep1pt
            \item bind growth factors, receptors and metal ions
            \item cell signaling and communication
            \item cell migration, motility, localization and adhesion
        \end{itemize}
    };
    \draw[thick,decorate,decoration={brace,mirror,amplitude=5pt}, color=green!25!black] (C2.north west) -- (C2.south west) node[midway] {};

    \path[->, >=latex, red!50!black, opacity=.6, line width=1pt] {[out=350,in=180]
        (nuc) edge ($(C1.west)-(.2,0)$)
        (cyt) edge ($(C1.west)-(.2,0)$)};
    \path[->, >=latex, green!25!black, opacity=.6, line width=1pt] {[out=350,in=180]
        (cha) edge ($(C2.west)-(.2,0)$)
        (mem) edge ($(C2.west)-(.2,0)$)};

\end{tikzpicture}
\end{frame}

\end{document}

它产生以下内容: 在此处输入图片描述

不过,似乎项目符号与文本不对齐... 是我的问题,还是它们明显位于文本上方?有办法解决吗?

相关内容