2

I set up my enumerated list with the character ")" so that it looks like this: 1) 2) 3) and so on.

Here is the code:

\documentclass{article}

\usepackage{enumitem}
\usepackage[most]{tcolorbox}
\usepackage{hyperref}

\begin{document}

\begin{enumerate}
    \item text text text
    \item text text text \eqref{item:i1} or \eqref{item:i2}, text text text
        \begin{enumerate}[label=Step \roman*)]
        \item\label{item:i1} text text text
        \item\label{item:i2} text text text
    \end{enumerate}
\end{enumerate}

\end{document}

This is what I get: (Step i)). I would like to have: (Step i)

Any ideas on how to fix this?

1
  • 1
    If you want to use \eqref you can try \begin{enumerate}[label=Step \roman*), ref=Step \roman*]. But I would probably prefer \ref over \eqref, in which case \begin{enumerate}[label=Step \roman*), ref=(Step \roman*)] might be nicer.
    – moewe
    Commented Aug 22, 2018 at 8:55

1 Answer 1

1

You can detach label from ref; I made some other improvements.

\documentclass{article}

\usepackage{enumitem}
\usepackage[most]{tcolorbox}
\usepackage{calc}
\usepackage{hyperref}

\newlist{steps}{enumerate}{1}
\setlist[steps]{
  label=Step \roman*),
  ref=Step~\roman*,
  labelwidth=\widthof{Step vi)},
  align=left,
  leftmargin=*,
  labelsep=0pt,
}

\begin{document}

\begin{enumerate}
\item text text text

\item text text text \eqref{item:i1} or \eqref{item:i2}, text text text
\begin{steps}
  \item\label{item:i1} text text text
  \item\label{item:i2} text text text
\end{steps}
\end{enumerate}

\end{document}

enter image description here

You must log in to answer this question.

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