Beamer 中的描述子项格式

Beamer 中的描述子项格式

我正在尝试使用description某种格式在我的一个 Beamer 框架中包含一个子列表:

\documentclass[10pt]{beamer}
\mode<presentation>{
    \setbeamertemplate{itemize item}{\color{red}$\blacksquare$}
    \setbeamertemplate{itemize subitem}{\color{red}$\blacktriangleright$}
    \setbeamertemplate{description item}{{\color{red}$\blacksquare$}~\textbf{\insertdescriptionitem{}:}}
    \setbeamertemplate{description subitem}{{\color{red}$\blacktriangleright$}~\textbf{\insertdescriptionitem{}:}}
}

\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}

\begin{document}

\begin{frame}{Items, subitems, description}
    \begin{itemize}
        \item Item 1
        \begin{itemize}
            \item Item 1.1
            \item Item 1.2
        \end{itemize}
    \end{itemize}\vfill%
    \begin{description}
        \item[Description] This is the first description
        \item[Another description] This is the second description
    \end{description}
\end{frame}

\begin{frame}{Subdescription}
    \begin{itemize}
        \item Here's some item text
        \item And then this item needs a sublist with descriptions
        \begin{description}
            \item[Subitem] This is the explanation of the first subitem
            \item[Another subitem] And of the second subitem
        \end{description}
        \item Another item
    \end{itemize}\vfill%
    \begin{description}
        \item Second try
        \item Let's see the sublist again
        \begin{description}
            \item[Subitem] This is the explanation of the first subitem
            \item[Another subitem] And of the second subitem
        \end{description}
        \item Final item
    \end{description}
\end{frame}

\end{document}

使用 的列表和子列表itemize,以及使用 的列表(幻灯片 1)都可以正常工作(尽管和列表description之间的对齐也有点偏差):itemizedescription

但是,无论我description在一个itemize环境内部还是在另一个description环境内部使用,子描述(幻灯片 2)都未对齐并使用了错误的符号:

期望的输出将是这样的:

我如何让 Beamer 正确对齐和格式化我的所有列表descriptionitemize子列表?

答案1

description在你的情况下我不会使用,itemize环境看起来更合适:

\documentclass[10pt]{beamer}
\mode<presentation>{
    \setbeamertemplate{itemize item}{\color{red}$\blacksquare$}
    \setbeamertemplate{itemize subitem}{\color{red}$\blacktriangleright$}
}

\usepackage[english]{babel}

\setbeamerfont{structure}{series=\bfseries}

\begin{document}

\begin{frame}{Items, subitems, description}
    \begin{itemize}
        \item Item 1
        \begin{itemize}
            \item Item 1.1
            \item Item 1.2
        \end{itemize}
    \end{itemize}\vfill%
    \begin{itemize}
        \item \structure{Description: } This is the first description
        \item \structure{Another description: } This is the second description
    \end{itemize}
\end{frame}

\begin{frame}{Subdescription}
    \begin{itemize}
        \item Here's some item text
        \item And then this item needs a sublist with descriptions
        \begin{itemize}
            \item \structure{Subitem: } This is the explanation of the first subitem
            \item \structure{Another subitem:} And of the second subitem
        \end{itemize}
        \item Another item
    \end{itemize}\vfill%
    \begin{itemize}
        \item Second try
        \item Let's see the sublist again
        \begin{itemize}
            \item \structure{Subitem: } This is the explanation of the first subitem
            \item \structure{Another subitem: } And of the second subitem
        \end{itemize}
        \item Final item
    \end{itemize}
\end{frame}


\end{document}

在此处输入图片描述

相关内容