[Tex/LaTex] Giving an equation between \[ \]’s a number

equationsmath-modenumbering

I usually use \[ ... \] to typeset equations in latex and sometimes I come back and realize that I want to have an equation number and label. I have been coming back and editing it to \begin{equation} ... \end{equation} but this is annoying and time consuming. Is there a command to do something like \[ \addeqnumber{} \] which will work the same way as the equation environment? I am aware this probably isn't the best practice, but it would save me some annoyance.

Best Answer

\documentclass{article}
\usepackage{amsmath}
\newcommand\addtag{\refstepcounter{equation}\tag{\theequation}}

\begin{document}

\[
  1+1=2  \addtag
\]

\end{document}

See also: How can I add numbers to specific equations in an eqnarray*?