In LaTeX, when I need to create an equation without a number, I write
\[ x=y \]
(or using equation*) and when I need an equation with a number/label I do
\begin{equation}
x=y \label{eq:myeq}
\end{equation}
My question is: is there a way to somehow combine both modes, so that only the label is required to have an equation number?
In other words, I want to somehow make it so that writing something like this
\[ x=y \label{eq:myeq} \]
produces an equation with a number and a label, but writing \[ x=y \] still produces just an equation. This seems to me to be a more elegant way of doing things.
equationenvironment very helpful. If you mess around with any re-definitions chances are that you will end up with some error. This will be particularly annoying if you are writing a long thesis. You don't want to correct a source code for 30+ pages, do you. Stick withequation. – God bless Jun 05 '17 at 13:13\[\]to typeset. Making it reference-able requires not only adding the label, but also changing the environment (the same is true if I had been usingequation*). Which is both annoying and wasteful. I guess just don't the reason behind the original design requiring two modification to the script to have a label, instead of an obvious one. – Tohiko Jun 05 '17 at 13:21\[...\]is the better LaTeX form of$$...$$, which is plain TeX, which does not not know of labels as you want to have them. – Jun 05 '17 at 13:24\let\[\equationand\let\]\endequationI get the desired effect even with amsmath. – Tohiko Jun 05 '17 at 15:32