
Un nuevo entorno se define utilizando varwidth y tikz para obtener un bloque de ancho igual al contenido que contiene. Funciona bien, a menos que esté involucrado el desglose. Aquí se proporciona un MWE.
\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}
¿Alguien puede sugerir una forma de hacer que el ancho sea automático también para el desglose/enumeración? Gracias de antemano.