# beamer: block inside itemize, how to horizontally align?

\documentclass{beamer}
\usepackage{lipsum}
\setbeamercolor{postit}{fg=black,bg=yellow}

\begin{document}
\begin{frame}
\begin{itemize}
\item some words
% possibly an empty line here
\begin{beamercolorbox}[rounded=true]{postit}
\lipsum[1-1]
\end{beamercolorbox}
\item some words
\end{itemize}
\end{frame}
\end{document}


I'd like the box to be horizontally aligned with the items, both on the left and right, and not to occupy the full page width. I could do it with two colums (0.075 and 0.97), but that would be pretty ad hoc and not perfect, in the fact that the box would extend too much on the right. In the same fashion, if I put an extra line between \item some words and \begin, it gets correctly aligned on the right (no overfull hbox 22pt on the right), but too wide on left.

Any ideas?

-
Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. –  Jubobs Feb 24 at 11:46

## 1 Answer

You can set the width to \linewidth using wd=\linewidth:

\documentclass{beamer}
\usepackage{lipsum}
\setbeamercolor{postit}{fg=black,bg=yellow}

\begin{document}
\begin{frame}
\begin{itemize}
\item some words
% possibly an empty line here
\begin{beamercolorbox}[rounded=true,wd=\linewidth]{postit}
\lipsum[1-1]
\end{beamercolorbox}
\item some words
\end{itemize}
\end{frame}
\end{document}


-
Thanks, that's precisely what I couldn't remember; I was tampering with .9\textwidth and similar, but this is better –  jj_p Feb 24 at 15:11