An easy way to obtain the desired result, namely
is to use the tabularx
environment (requires the tabularx
package). Indeed, the above printout has been produced with the following code:
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
\usepackage{amsmath}
\usepackage{tabularx}
\makeatletter
\newcommand*\Annadotfill{%
\leavevmode
% Do you really want "\cleaders"?
\cleaders \hb@xt@ .33em{\hss .\hss }\hfill
\kern \z@
}
\@ifdefinable\@Anna@brace@width{\newdimen\@Anna@brace@width}
\settowidth\@Anna@brace@width{%
$\left\{\vbox{\vskip \@m \p@}\right.\kern -\nulldelimiterspace$%
}
\newenvironment{Annacases}{%
\left\{%
\tabcolsep \z@
\def\arraystretch{1.2}% linespread: adjust as you please
\tabularx{\dimexpr \linewidth-\@Anna@brace@width \relax}%
{>{$}r<{$}>{${}}X<{$}}%
}{%
\endtabularx
\right.%
\kern -\nulldelimiterspace
}
\makeatother
\begin{document}
Some text before the enumeration.
\begin{enumerate}
\item $AB=CD$ \Annadotfill text;
\item $AB=CD$ \Annadotfill longer text;
\item
$
\begin{Annacases}
AB &= CD\Annadotfill\text{text;}\\
AB &= CD+EF+GH\Annadotfill\text{longer text;}\\
MN+XY &= PQ\Annadotfill\text{longer text, and more.}
\end{Annacases}
$
\end{enumerate}
Some text after the enumeration.
\end{document}
However, there must be a more efficient method, using primitive TeX commands…
Previous Attempt, Which I Had Deleted
Something like this?
This is the code:
% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly
% declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended.
% End of standard header. What follows pertains to the problem at hand.
\usepackage{mathtools} % also loads "amsmath"
\makeatletter
\newcommand*\annadotsfill{\leaders\hbox{.\,}\hskip 2em \@plus 1fill \relax}
\newcases{annacases}
{} % separation between columns
{$\m@th\displaystyle\hfil##$} % left preamble
{$\m@th\displaystyle{}##$} % right preambel
{\lbrace}{.} % delimiters
\makeatother
\begin{document}
Some text before the equation.
\[
\begin{annacases}
AB &= CD\annadotsfill\text{text}\\
AB &= CD+EF+GH\annadotsfill\text{longer text}\\
MN+XY &= PQ\annadotsfill\text{longer text, and more}
\end{annacases}
\]
Some text after the equation.
\end{document}
Unfortunately, I cannot dwell on explanations right now; I’ll try to edit this answer later on.