I'm using package amsthm to define a "Definition" environment as follows:
\theoremstyle{definition}
\newtheorem{definition}{Definition}
In brackets, a name for the definition is supplied:
\begin{definition}[Modularity]
For a graph $G = (V,E)$ and disjoint communities $\zeta = \{C_1, \dots, C_k \}$ of $G$, \term{modularity} is defined as
$$M(G, \zeta) := \underbrace{\sum_{C \in \zeta} \frac{|E(C)|}{|E|}}_{\text{coverage}} - \underbrace{\sum_{C \in \zeta} \frac{ \left ( \sum_{v \in C} deg(v) \right )^2}{(2 \cdot |E|)^2}}_{\text{expected coverage}}$$
\end{definition}
Now, I'd like to label these definitions. Do I actually have to manually \label each one? Wouldn't it be nice and clean to be able to automatically generate a label from the supplied name argument?
$$in LaTeX; see Why is\[ … \]preferable to$$? – egreg Dec 30 '15 at 22:53