I am currently getting into LaTeX, mainly for writing texts with formulas. I have already some experience writing in latex from other SE sites such as Physics or Mathematics. Now I started learning writing LaTeX in a dedicated software (I use TeXstudio, but this probably won't be relevant).
I noted that I cannot use the \tag command when using equations with $$...$$. For example, the following code:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$a=b\tag{1}$$
\end{document}
outputs "a=b" and not "a=b (1)". I also get a error code:
Package amsmath Error: \tag not allowed here. $$a=b\tag
After some more experimenting, I found that the only (?) way to use the \tag command is by using an equation workspace:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
a=b\tag{1}
\end{equation}
\end{document}
which outputs the correct result
Using the equation workspace, you get a default number tag, but this way, you can change it to whatever value you'd like to.
So I have two questions:
Why is it not possible to add a tag when using equations with $$...$$ or $...$?
Is there any workaround? Using an equation environment isn't much of an issue, but I sometimes find the "$" method more comfortable

$$...$$, use\[...\]that allows you to use\tag. – Werner Dec 03 '20 at 19:09$$should never be used in latex whether or not you use\tag– David Carlisle Dec 03 '20 at 21:34$$from the SE version of Latex and thought that it was "normal" – jng224 Dec 03 '20 at 21:48