Cambiar el ancho del bloque del teorema en beamer: tema de Boadilla
Aug 21 2020
¿Puedo preguntar cómo se cambia el ancho del bloque del teorema (o lema, etc.) en el tema del proyector de Boadilla? El bloque predeterminado es un poco demasiado ancho y no coincide con el ancho del elemento. ¿Cómo puedo hacer algo como se muestra en la figura?

\documentclass[9pt]{beamer}
\usefonttheme{serif}
\usepackage[english]{babel}
\usetheme{Boadilla}
\begin{document}
\begin{frame}{A Lemma and a Theorem}{}
\begin{itemize}
\item This is one lemma and one theorem:
\end{itemize}
\begin{lemma}[Name of Lemma 1]
Lemma
\begin{equation}
x + y = z
\end{equation}
\end{lemma}
\begin{theorem}[Name of Theorem 1]
\begin{equation}
x - z = w
\end{equation}
\end{theorem}
\end{frame}
\end{document}
Respuestas
muzimuzhiZ Aug 21 2020 at 18:14
Prueba este parche:
\documentclass[9pt]{beamer}
\usefonttheme{serif}
\usepackage[english]{babel}
\usetheme{Boadilla}
\usepackage{xpatch}
\newlength{\thmwidth}
\setlength{\thmwidth}{0.85\textwidth}
\makeatletter
% patch beamer template "block begin"
\expandafter\xpatchcmd\csname beamer@@tmpl@block begin\endcsname
{\begin{beamerboxesrounded}[}
{%
\hspace*{\dimexpr .5\textwidth-.5\thmwidth}% insert left skip
\begin{beamerboxesrounded}[width=\thmwidth,% set width
}
{}{\fail}
\makeatother
\begin{document}
\begin{frame}{A Lemma and a Theorem}{}
\begin{itemize}
\item This is one lemma and one theorem:
\end{itemize}
\begin{lemma}[Name of Lemma 1]
Lemma
\begin{equation}
x + y = z
\end{equation}
\end{lemma}
\begin{theorem}[Name of Theorem 1]
\begin{equation}
x - z = w
\end{equation}
\end{theorem}
\end{frame}
\end{document}
