latex math units code example
Example: latex units in equation
%In preamble, add the following command:
\makeatletter
\providecommand\add@text{}
\newcommand\tagaddtext[1]{%
\gdef\add@text{#1\gdef\add@text{}}}%
\renewcommand\tagform@[1]{%
\maketag@@@{\llap{\add@text\quad}(\ignorespaces#1\unskip\@@italiccorr)}%
}
\makeatother
% In your equation, add this:
\begin{equation}
E = mc^2 \tagaddtext{[your unit]}
\end{equation}