我正在准备一个演示文稿beamer
,并希望有一个类似以下示例的列表:
谁能告诉我如何在 LaTeX 中实现这一点?
谢谢您的任何提示:-)。
答案1
这是一种可能性(我处理了两层嵌套,但同样的想法也适用于第三层):
\documentclass{beamer}
\usepackage{tikz}
\usepackage{etoolbox}
\definecolor{enumitem}{RGB}{31,51,87}
\makeatletter
\AtBeginEnvironment{enumerate}{%
\apptocmd{\@item}{%
\tikz[overlay]\draw[gray!60] ([yshift=-0.5ex]0,0) -- ++(\linewidth,0);%
}{}{}}
\defbeamertemplate{enumerate item}{mysquare}
{
\hbox{%
\usebeamerfont*{item projected}%
\usebeamercolor[bg]{item projected}%
\tikz[baseline=(nodnum.base)]
\node[
draw=black,
anchor=east,
overlay,
fill=enumitem,
text width=3.25ex,
align=center,
minimum height=5ex,
font=\scriptsize
] (nodnum)
{\color{fg}\insertenumlabel};%
}%
}
\defbeamertemplate{enumerate subitem}{mysquare}
{
\hbox{%
\usebeamerfont*{subitem projected}%
\usebeamercolor[bg]{subitem projected}%
\tikz[baseline=(nodnum.base)]
\node[
draw=black,
anchor=east,
overlay,
fill=enumitem,
text width=4ex,
align=center,
minimum height=4ex,
font=\tiny
] (nodnum)
{\color{fg}\insertenumlabel.\insertsubenumlabel};%
}%
}
\setbeamertemplate{enumerate items}[mysquare]
\makeatother
\setbeamercovered{transparent}
\begin{document}
\begin{frame}
\begin{enumerate}[<+->]
\item First item.
\item Second item.
\item Third item.
\begin{enumerate}
\item First subitem.
\item Second subitem.
\item Third subitem.
\item Fourth subitem.
\end{enumerate}
\item Fourth item.
\end{enumerate}
\end{frame}
\end{document}
第四张幻灯片的图片: