%%
%% The LaTeX Companion, 3ed
%%
%% Example 7-4-10 on page I-552 in "subcaption --- Substructuring floats".
%%
%% Copyright (C) 2022 Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%%
%% See https://www.latex-project.org/lppl.txt for details.
%%

\documentclass{tlc3exa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{207.0pt}

%StartShownPreambleCommands
\usepackage{lipsum,subcaption}
%StopShownPreambleCommands

\begin{document}
\begin{figure}
 \centering
   \subcaptionbox{default behavior
                          (centered)}
                 [\linewidth]
                 {\lipsum[3][1-3]}
 \par\medskip
   \subcaptionbox{left aligned}
                 [.45\linewidth][l]
                 {\lipsum[2][1-2]}
   \subcaptionbox{right aligned}
                 [.45\linewidth][r]
                 {\lipsum[2][1-2]}
 \par\medskip
   \subcaptionbox{centerfirst}
                 [\linewidth][centerfirst]
                 {\lipsum[1][1-2]}
 \caption{Justification tests}
\end{figure}
\end{document}
