1

I want each item in a list of enumerated items to have a name which is right aligned. The third item has a lot of text. I would like the name to be centered between the two lines of text. In case this would be considered a typographic mistake, I would like to know that as well. Compiled Code Here is a mwe.

    \documentclass[paper=letter, 12pt]{scrbook}
    \usepackage{amsmath, enumitem}
    \begin{document}
    A list.
    \begin{enumerate}[itemsep=1pt]
    \item Some condition. \hfill (condition 1)
    \item Another condition. \hfill (condition 2)
    \item A horribly long and convoluted, not to mention \hfill (condition 3) 
    \\ overly wordy condition.
    \end{enumerate}
    \end{document}
    \end{document}
2
  • Why not just use a description?
    – Werner
    Commented Aug 7, 2021 at 19:47
  • Why not define a \newtheorem{condition}{Condition}? Such conditions will be numbered, you can add a descriptive label via the optional argument, and you can reference them.
    – gernot
    Commented Aug 7, 2021 at 20:03

2 Answers 2

2

If there's a chance that you may need to cross-reference one or more of the conditions, I think it's worth the effort to set up a bespoke enumerate-type list type for these conditions. This may be done easily with the help of the machinery of the enumitem package (which you load anyway).

enter image description here

\documentclass{scrbook}
\usepackage{enumitem,cleveref}
\newlist{condlist}{enumerate}{1} % create an enumerate-like list env. 
\setlist[condlist]{left=0pt, itemsep=1pt, % define its properties
         label=Condition \arabic*., ref=\arabic*}
\crefname{condlisti}{condition}{conditions}

\begin{document}
\begin{condlist}
\item Some condition. \label{cond:1}
\item Another condition. \label{cond:2}
\item A horribly long and convoluted, not to mention extremely dense and overly wordy condition.
\end{condlist}
A cross-reference to condition \ref{cond:1}.
Cross-references to \cref{cond:1,cond:2}.
\end{document}
2

When the line is long it may be better to align the number with the name. In that case, a tabular environment is adequate and leads to simpler code.

The environment {NiceTabular*} of nicematrix has its own built-in counter for the rows called iRow. The command \Block allows for \\ inside.

d

\documentclass[paper=letter, 12pt]{scrbook}
 
\usepackage{nicematrix}% only package needed <<

\begin{document}
    
 A list. \medskip   

\begin{NiceTabular*}{\linewidth}{>{\arabic{iRow}.}c l @{\extracolsep{\fill}}l}[cell-space-limits = 4pt]     
    & Some condition                                                                            & (condition 1)\\
    & Another condition.                                                                        & (condition 2)\\
    &\Block[l]{}{A horribly long and convoluted, not to mention  \\ overly wordy condition.}    & (condition 3)
\end{NiceTabular*}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .