# labelling a condition in LaTeX

I need to label two textual conditions in LaTeX. I found some hacks to make them label as equations, but what I want is something like this:

(D1) Some statement
(D2) Some other condition


I have these two conditions under itemize. Is there a consistent way to label and then later refer to these statements without numbering them as equation (1) and (2)?

You may be best served by setting up a custom enumerated list using the machinery of the enumitem package.

\documentclass{article}
\usepackage{enumitem} % for '\newlist' and '\setlist' macros
\newlist{condenum}{enumerate}{1} % 'condenum': a new, enumerate-like list env.
\setlist[condenum]{label=\bfseries Condition \arabic*.,
ref=\arabic*, wide}
\begin{document}
The following conditions apply:
\begin{condenum}
\item Some statement. \label{cond:some}
\item Some other statement.
\end{condenum}

\noindent
A cross-reference to Condition~\ref{cond:some}.
\end{document}


If you want the condition labels to look like (D1), (D2), etc., simply change label=\bfseries Condition \arabic*. to label=(D\arabic*).

• Thats lovely. May I suggest adding the little modification for future visitors? You can actually customize condenum while calling it because of versatility of enumitem package. I can produce output like (D1) at one call and (T1) at other call. – Vishal Gupta Dec 14 '16 at 12:24
• @VishalGupta - Indeed, the enumitem package makes it very straightforward to customize its environments, but up front and "on the fly" later on in the document. – Mico Dec 14 '16 at 13:08

Try the following coding with the package "enumitem" for your requirement:

\begin{enumerate}[label=(D\arabic*)]
\item\label{d1} Some statement cross reference: \ref{d1}
\item\label{d2} Some other condition cross reference: \ref{d2}
\end{enumerate}


Thanks!!!!

• Welcome to TeX.SE. Does your suggested solution require the use of any LaTeX packages? If so, which ones? – Mico Dec 14 '16 at 11:13
• No need of any packages. – Saravanan Dec 14 '16 at 11:16
• Are you sure? The [label=(D\arabic*)] code snippet would appear to be in conflict with the default (LaTeX) definition of the enumerate environment. – Mico Dec 14 '16 at 11:18
• Sorry!!! enumitem package used. – Saravanan Dec 14 '16 at 11:22
• You should post fully compilable code rather than code snippets. "Fully compilable" means, in practice, something that starts with \documentclass and ends with \end{document}. – Mico Dec 14 '16 at 13:32