7

I have seen here how roman numerals can be used in enumerate lists. How could I create nested lists with roman numerals, to get something like this?

(i) ...
    (i.i) ...
    (i.ii) ...
(ii) ...
5
  • 1
    Should not be too hard, but in case you didn't know the documentation is available on ctan
    – user202729
    Apr 22 at 12:12
  • Do you want this to apply in one case or for the whole document? Apr 22 at 12:18
  • Does this answer your question? Enumerate with all lists as arabic numerals Apr 22 at 12:19
  • 1
    @jessexknight just in one case
    – Invenietis
    Apr 22 at 12:22
  • 1
    @jessexknight This one does not cover referring to enumi from the second level though.
    – user202729
    Apr 22 at 12:23

2 Answers 2

6

Since you mention that the roman-lowercase enumeration style is a one-off requirement for your document, I suggest you (a) load the enumitem package and (b) use its machinery to provide the formatting requirements as optional arguments to the respective instances of \begin{enumerate}.

When creating cross-references to items in roman-enumerated lists, I suggest you omit the round parentheses. As the following example shows, the setup recommended in the preceding paragraph is sufficiently general/robust to allow the use of \cref directives to create cross-references.

enter image description here

\documentclass{article}
\usepackage{enumitem}
\usepackage[colorlinks,allcolors=blue]{hyperref} % optional
\usepackage[nameinlink]{cleveref} % optional, for \cref macro

\begin{document}
\begin{enumerate}[label=(\roman*),ref=\roman*]
\item \dots \label{list:1}
   \begin{enumerate}[label=(\theenumi.\roman*),ref=\theenumi.\roman*]
      \item \dots
      \item \dots \label{list:2.b}
   \end{enumerate}
\item \dots
\end{enumerate}

Cross-references to items \ref{list:1} and \ref{list:2.b}.

Cross-references to \cref{list:1,list:2.b}.
\end{document}
1
  • 1
    Messing around a bit you can also do \begin{enumerate}[ ref=\roman* , label=(\noexpand\theenumi) ]. This is likely highly dependent on the exact implementation of the package though, so do not recommend (that noexpand is even necessary)
    – user202729
    Apr 22 at 15:08
5

Like this.

%! TEX program = pdflatex
\documentclass{article}

\usepackage[shortlabels]{enumitem}

\begin{document}

\setlist[enumerate,1]{label=(\roman*)}
\setlist[enumerate,2]{label=(\roman{enumi}.\roman*)}
\begin{enumerate}
    \item
        \begin{enumerate}
            \item 1
            \item 2
        \end{enumerate}
    \item
        \begin{enumerate}
            \item 1
            \item 2
        \end{enumerate}
\end{enumerate}

\end{document}

Turns out the documentation is a bit lacking, for more complex operations it presupposes knowledge of the enumerate environment in LaTeX. Read "printing counters" and "enumerate [environment]" chapter in LaTeX unofficial reference manual for details on \roman and enumi.

There's a similar example from the manual

manual screenshot

2
  • no code as text, neither page num Apr 23 at 8:51
  • @SaveUkraine-StartPeaceTalk That is to show that "the manual contain the code" not "here is the code". The main part is in text anyway
    – user202729
    Apr 23 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.