1 つの項目に対して複数の番号 (カンマ区切り) を列挙します。

1 つの項目に対して複数の番号 (カンマ区切り) を列挙します。

次のようなリストを取得したいと思います。

1. Text addressing #1.

2,3. Text addressing #2 and #3 together.

4. Text addressing #4.

理由は、リスト項目が前のリストを参照しているからです。enumerate でこれを簡単に行う方法をご存知ですか? (または、enumerate 環境と一貫性があるように見える他の方法、つまり、そのすぐ上に enumerate リストがある場合、2、3 の部分を除いて 2 つが同じようにフォーマットされているように見えるなど)。

答え1

より一般的なものを必要としない場合は、次のようにするとうまくいくかもしれません:

\documentclass{article}
\newcommand{\doubleitem}{%
  \begingroup
  \stepcounter{enumi}%
  \edef\tmp{\theenumi, }%
  \stepcounter{enumi}
  \edef\tmp{\endgroup\noexpand\item[\tmp\labelenumi]}%
  \tmp}

\begin{document}
\begin{enumerate}
\item A
\item B
\item C
\item D
\end{enumerate}
Another
\begin{enumerate}
\item about A
\doubleitem about B and C
\item D
\end{enumerate}
\end{document}

ここに画像の説明を入力してください

関連情報