枚举中的案例内点填充

枚举中的案例内点填充

我想要两个(或三个)等式,并希望每行都有一些文本。文本应右对齐,我希望等式和文本之间有点,就像没有案例时一样。当我在枚举中使用 hspace(列表 1 和 2)以及在枚举中使用 wide(列表 2)时,我不知道如何进行正确对齐。文本将在右侧继续,太长了(图片中显示不起作用)。

在此处输入图片描述

以下是代码:

\documentclass[a4paper]{article} 
\usepackage[T1]{fontenc}         

\usepackage{amsmath}
\usepackage{tabularx}
\usepackage{enumitem}

\makeatletter

\newcommand*\Annadotfill{
    \leavevmode
    % 
    \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}% 
    \tabularx{\dimexpr \linewidth-\@Anna@brace@width \relax}%
                {>{$}r<{$}>{${}}X<{$}}%
}{%
    \endtabularx
    \right.%
    \kern -\nulldelimiterspace
}

\makeatother


\begin{document}


Some text before the enumeration. \Annadotfill works well;
\\~\\
\textbf{List 1:}
\begin{enumerate}
    \item $AB=CD$ Lorem ipsum dolor sit amet, consectetur adipiscing   elit. Sed a leo ut erat luctus scelerisque.\Annadotfill works well;
    \item $AB=CD$ \Annadotfill works well;
    \item $\begin{Annacases}
    &AB = CD \Annadotfill\text{works well;}\\
    &AB = CD+EF\Annadotfill\text{works well;}\\
    \end{Annacases}$
    \item\hspace{38pt}
    $\begin{Annacases}
    &AB = CD\Annadotfill\text{doesn't work;}\\
    &AB = CD+EF\Annadotfill\text{doesn't work;}\\
    \end{Annacases}$
\end{enumerate}
\textbf{List 2:}
\begin{enumerate}[wide, labelindent=0pt]
    \item $AB=CD$ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a leo ut erat luctus scelerisque.\Annadotfill works well;
    \item $\begin{Annacases}
    &AB = CD\Annadotfill\text{doesn't work;}\\
    &AB = CD+EF\Annadotfill\text{doesn't work;}\\
    \end{Annacases} $
    \item\hspace{38pt}
    $\begin{Annacases}
    &AB = CD\Annadotfill\text{doesn't work;}\\
    &AB = CD+EF\Annadotfill\text{doesn't work;}\\
    \end{Annacases}$
    \item because  $\begin{Annacases}
    &AB = CD\Annadotfill\text{doesn't work;}\\
    &AB = CD+EF\Annadotfill\text{doesn't work;}\\
    \end{Annacases} $
\end{enumerate}

\end{document}

相关内容