![Desalineación con paquete enmarcado y columna](https://rvso.com/image/286356/Desalineaci%C3%B3n%20con%20paquete%20enmarcado%20y%20columna.png)
Estoy intentando utilizar el entorno sombreado de la siguiente manera:
\documentclass[11pt]{beamer}
\usepackage{xcolor}
\usepackage{framed}
\definecolor{shadecolor}{rgb}{1,0.8,0.3}
\begin{document}
\begin{frame}
\begin{columns}[t, totalwidth=\linewidth]
\begin{column}{0.5\linewidth}
\begin{shaded}
Foo
\end{shaded}
\end{column}
\begin{column}{0.5\linewidth}
Foo
\end{column}
\end{columns}
\end{frame}
\end{document}
Obtengo el siguiente resultado (aunque, curiosamente, no hay ningún error de Overfull hbox):
Sin el entorno sombreado alrededor del primer "foo", obtengo
¿Tengo que renunciar al entorno sombreado o estoy haciendo algo mal?
Respuesta1
Usar minipage
s en lugar del columns
entorno resuelve el problema. Te sugiero que usesmdframed
otcolorbox
en lugar de framed
; Los primeros paquetes son más versátiles y fácilmente personalizables:
\documentclass[11pt]{beamer}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{tcolorbox}
\usepackage{framed}
\definecolor{shadecolor}{rgb}{1,0.8,0.3}
% for mdframed
\newmdenv[
hidealllines=true,
backgroundcolor=shadecolor,
userdefinedwidth=.6\linewidth
]{mybox}
% for tcolorbox
\newtcolorbox{mytbox}[1][]{
colback=shadecolor,
colframe=shadecolor,
arc=0pt,
outer arc=0pt,
#1
}
\begin{document}
\begin{frame}
With \texttt{framed} package:
\begin{minipage}{0.5\linewidth}
\begin{shaded}
Foo
\end{shaded}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
Foo
\end{minipage}\vfill
With \texttt{mdframed} package:
\begin{minipage}{0.5\linewidth}
\begin{mybox}[userdefinedwidth=.95\linewidth]
Foo
\end{mybox}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
Foo
\end{minipage}\vfill
With \texttt{tcolorbox} package:
\begin{minipage}{0.5\linewidth}
\begin{mytbox}[width=.95\linewidth]
Foo
\end{mytbox}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
Foo
\end{minipage}
\end{frame}
\end{document}