[Tex/LaTex] Justify text in memoir class margintable environment

horizontal alignmentmarginparmemoir

In page 181 of texdoc memoir,

The marginfigure and margintable environments can of course be adjusted using \setfloatadjustment, default

\setfloatadjustment{marginfigure}{\centering}
\setfloatadjustment{margintable}{\centering}

The default alignment is \centering. I want to justify the text of a margintable. But I don't know what the command for explicit justification, so I tried the following

\setfloatadjustment{margintable}{\raggedright}

Of course that is only flushed to the left, with a ragged right edge. How do I justify the text inside a margintable environment of the memoir class?

Best Answer

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}

enter image description here

Related Question