I would like to justify text inside an itemize
environment with the beamer
class. Text appears to be justified by default with the article
class, but not with the beamer
class.
The following code justifies text left and right:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\begin{itemize}
\item \lipsum[1-1]
\end{itemize}
\end{document}
The following code does not:
\documentclass{beamer}
\usepackage{lipsum}
\begin{document}
\begin{frame}
\begin{itemize}
\item \lipsum[1-1]
\end{itemize}
\end{frame}
\end{document}
I have tried this:
\documentclass{beamer}
\usepackage{ragged2e}
\usepackage{lipsum}
\let\olditemize=\itemize
\renewenvironment{itemize}{\olditemize\justify}{\endlist}
\begin{document}
\begin{frame}
\begin{itemize}
\item \lipsum[1-1]
\end{itemize}
\end{frame}
\end{document}
but it won't justify text on the right. Any suggestions welcome!
Best Answer
beamer
has its own ways and, in particular, it redefines many standard LaTeX environments/commands; in particular, it redefines the basic list-like environmentsitemize
,enumerate
anddescription
.Here's, for example, the definition of
\itemize
as given inbeamerbaselocalstructure.sty
:as you can see,
\itemize
internally uses\raggedright
. The best approach to keep things overlay specification-aware is to redefine\itemize
to use\justifying
(from theragged2e
package) instead; the following code shows this redefinition in an actual document:The output:
As a final note, I would suggest you to consider if this redefinition is really needed at all; frames with too much text (like the one I just build for the example) are to be avoided in a presentation.