
Um novo ambiente é definido usando varwidth e tikz para obter um bloco de largura igual ao conteúdo dentro dele. Funciona bem, a menos que a especificação de itens esteja envolvida. Um MWE é fornecido aqui.
\documentclass[]{beamer}
\usepackage{tikz}
\usepackage{varwidth}
\tikzstyle{example-box} = [fill=yellow, rectangle]
\newenvironment{autowidthblock}{
\begin{tikzpicture}
\node [example-box] (box)
\bgroup
\begin{varwidth}{\linewidth}
}{
\end{varwidth}
\egroup;
\end{tikzpicture}
}
\begin{document}
\begin{frame}
\begin{autowidthblock}
With normal sentences, the width is rightly fit
\end{autowidthblock}
\begin{autowidthblock}
\begin{itemize}
\item With itemize environment,
\item The width is not auto-set
\item Instead spans the entire textwidth
\end{itemize}
\end{autowidthblock}
\end{frame}
\end{document}
Alguém pode sugerir uma maneira de tornar a largura automática para itemização/enumeração também? Desde já, obrigado.