Use the ragged2e package and its \justifying
macro.
EDIT: I should have guessed that memoir
provides its own macro for the task: \flushleftright
.
\documentclass{memoir}
% Variant A
% \usepackage{ragged2e}
% \setfloatadjustment{marginfigure}{\justifying}
% Variant B
\setfloatadjustment{marginfigure}{\flushleftright}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{marginfigure}
\lipsum[1]
\end{marginfigure}
\end{document}
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.
Best Answer
I recommend you load the
ragged2e
package (part of the ms suite of packages) with thedocument
option:With this setup, all parts of the document will be typeset left-justified (or "flush-left") rather than fully-justified. The term "all parts of the document" includes:
minipage
environmentsp
-type columns intabular
-like andarray
environments\parbox
es\marginpar
directives.In contrast, inserting the "standard LaTeX"
\raggedright
directive immediately after\begin{document}
affects only the "regular" material; it does not affect any of other five types of material, at least not when executed solely after\begin{document}
.Relative to the
\raggedright
directive, employing theragged2e
package also preserves TeX's ability to hyphenate words. This, in turn, avoids creating the excessive line raggedness that almost invariably results from using\raggedright
.A separate observation: In the standard LaTeX document classes, material contained in a "floating" environment -- such as
figure
andtable
-- is aligned flush-left by default. If you want to center the contents of these environments, you may do so by issuing a\centering
instruction after the\begin{figure}
and\begin{table}
directives. (The scope of the\centering
instruction ends automatically when LaTeX processes the\end{figure}
and\end{table}
statements.)