0
\begin{enumerate}
  \item[0.] \label{fst} Foo
  \item In \ref{fst} I said
\end{enumerate}

Want:

In 0 I said

Got:

In 1.2 I said

(happy to have extra full-stop; i.e., 0.)

2
  • Could you turn this into a complete example? I get "0. Foo" and "1. In I said" (with two spaces between "in" and "I"). So you're doing something you've not shown us.
    – Teepeemm
    Commented Feb 26 at 1:56
  • Double-checked, I'm in a \subsection{}, 1.2 subsection specifically, and that's what gets the 1.2 number from. So I guess the \item isn't \labelled? Commented Feb 26 at 4:04

2 Answers 2

1

\item[...] doesn't generate a number.

You can use enumitem and its start key.

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[start=0]
\item \label{zero} text
\item text
\end{enumerate}

Item~\ref{zero}

\end{document}

enter image description here

You can even start all your enumerate environments from 0.

\documentclass{article}
\usepackage{enumitem}

\setlist[enumerate]{start=0}

\begin{document}

\begin{enumerate}
\item \label{zero} text
\item text
\end{enumerate}

Item~\ref{zero}

\begin{enumerate}
\item another
\item test
\end{enumerate}

\end{document}

enter image description here

1
  • Perfect, the global setting is even better than what I was seeking. Commented Mar 2 at 1:31
1

As you've discovered, if you [] an item, then you remove its numbering for reference. If you want the entire list to start at zero, then the simplest would be to adjust the counter so that's what it does:

\documentclass{article}
\begin{document}
\begin{enumerate}\addtocounter{enumi}{-1}
  \item \label{fst} Foo
  \item In \ref{fst} I said
\end{enumerate}
\end{document}

gives "In 0 I said" (I assume that you want 1 to come after 0). If you want even more, I would encourage you to look into the enumitem package. For example, setlist[enumerate]{start=0} would allow all of your enumerates to start at 0, not just this one, while the ref key would allow your reference to have the full-stop.

1
  • Thanks, the \begin{enumerate}[start=1] was required for nested enumerations so that might be a good note to add also. Commented Mar 2 at 1:49

You must log in to answer this question.

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