3

Within theorems, I have nested enumeration lists:

1.1, 1.2, 1.3, 1.4, etc.

2.1, 2.2, 2.3, 2.4, etc.

For referencing to

1.1 to 1.3 and 2.4

I tried to use the usual command \cref{en1-1,en1-2,en1-3,en2-4}. However, it does not work correctly since it ignores the first level of numbering and thus yields the wrong result

1.1 to 2.4

Is there way to fix that so that higher levels of numbering are considered as well? I am looking for an automated solution and not the manual workaround \cref{en1-1,en1-2,en1-3} and \cref{en2-4}.

Here is an MWE:

\documentclass[12pt]{article}
\usepackage{enumitem}
\usepackage{cleveref}
\parindent0pt

\newtheorem{Theorem}{Theorem}

\setlist[1]{leftmargin=*, labelsep=10pt, itemsep=1pt, label=\theTheorem.\arabic*, align=parleft}

\begin{document}

\begin{Theorem}
This is the first Theorem.
\end{Theorem} 

\begin{enumerate}
\item \label{en:1-1} This is item 1.1
\item \label{en:1-2} This is item 1.2
\item \label{en:1-3} This is item 1.3
\item \label{en:1-4} This is item 1.4
\end{enumerate}

\begin{Theorem}
This is the second Theorem.
\end{Theorem} 

\begin{enumerate}
\item \label{en:2-1} This is item 2.1
\item \label{en:2-2} This is item 2.2
\item \label{en:2-3} This is item 2.3
\item \label{en:2-4} This is item 2.4
\end{enumerate}

The references to \cref{en:1-1,en:1-2,en:1-3,en:2-4} go wrong.

The references to \cref{en:1-2,en:1-3,en:1-4,,en:2-1} are even more strange.

\end{document}
4
  • @JohnKormylo If I use \label[thoerem]{...} in my MWE then only "items" is replaced by "theorems", but it still references to "1.1 to 2.4" instead of "1.1 to 1.3 and 2.4"
    – Jack
    Commented Dec 14, 2019 at 17:47
  • @JohnKormylo It only considers the lowest level of numbering, so it assumes en:1-1 and en:2-1 to be the same and thus ignores it the second time. Thus, I am looking for a solution that indeed considers the higher levels as well.
    – Jack
    Commented Dec 14, 2019 at 19:45
  • From page 8 of the manual, you need a double comma to get and instead of to. Commented Dec 15, 2019 at 1:24
  • @John Kormylo: In this specific case, it would work, but it is a manually "forced" solution that does not work in general, because if you, for example, reference to \cref{en:1-2,en:1-3,en:1-4,,en:2-1}, the result is still wrong and rather strange (see edited MWE).
    – Jack
    Commented Dec 15, 2019 at 15:11

0

You must log in to answer this question.

Browse other questions tagged .