beamer
has its own ways and, in particular, it redefines many standard LaTeX environments/commands; in particular, it redefines the basic list-like environments itemize
, enumerate
and description
.
Here's, for example, the definition of \itemize
as given in beamerbaselocalstructure.sty
:
\renewcommand{\itemize}[1][]{%
\beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
\ifnum \@itemdepth >2\relax\@toodeep\else
\advance\@itemdepth\@ne
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
\usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
\usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
\list
{\usebeamertemplate{itemize \beameritemnestingprefix item}}
{\def\makelabel##1{%
{%
\hss\llap{{%
\usebeamerfont*{itemize \beameritemnestingprefix item}%
\usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
}%
}%
}
\fi%
\beamer@cramped%
\raggedright%
\beamer@firstlineitemizeunskip%
}
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 the ragged2e
package) instead; the following code shows this redefinition in an actual document:
\documentclass{beamer}
\usepackage{ragged2e}
\usepackage{lipsum}
\makeatletter
\renewcommand{\itemize}[1][]{%
\beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
\ifnum \@itemdepth >2\relax\@toodeep\else
\advance\@itemdepth\@ne
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
\usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
\usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
\list
{\usebeamertemplate{itemize \beameritemnestingprefix item}}
{\def\makelabel##1{%
{%
\hss\llap{{%
\usebeamerfont*{itemize \beameritemnestingprefix item}%
\usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
}%
}%
}
\fi%
\beamer@cramped%
\justifying% NEW
%\raggedright% ORIGINAL
\beamer@firstlineitemizeunskip%
}
\makeatother
\begin{document}
\begin{frame}
\begin{itemize}
\item<1->\lipsum[2]
\item<2>\lipsum[2]
\end{itemize}
\end{frame}
\end{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.
you could load the ragged2e
package and add a \justifying
at the end of the block begin
template:
\documentclass{beamer}
\usepackage{ragged2e} %new code
\usetheme{default}
\addtobeamertemplate{block begin}{}{\justifying} %new code
\begin{document}
\begin{frame}{Test}
\begin{block}{Test}
The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog. The brown fox jumped over the lazy dog.
\end{block}
\end{frame}
\end{document}
Best Answer
You can use
\justifying
from the ragged2e package; you can patch the\frame
command to use\justyfing
, but you will also have to invoke\justifying
for some other environments which internally use\raggedleft
(for example, the beamer blocks, and the list-like environmentsenumerate
,itemize
, etc.). A little example: