# Label text as equation

I want to label a piece of text as a mathematical equation to refer to below. Thanks for everyone's guidance.

• Simply use $$36 - 12 = 24 \label{somelabel}$$, and later use \ref{somelabel}. Jun 20 '21 at 8:45

I take it that you want the entire paragraph below the first displayed equation to be treated as "equation (2)". If this assumption is correct, you may achieve your formatting objective by appending the instruction

\hfill\refstepcounter{equation}\label{eq:second}(\theequation)


to the paragraph in question. If you need to do this several times, it's probably a good idea to create a shortcut macro, say,

\newcommand\appendeqnum[1]{%
\hfill\refstepcounter{equation}\label{#1}(\theequation)}


The first (and only) argument of \appendeqnum is the label you wish to assign to this "equation".

\documentclass{article}
\usepackage{lipsum}  % for filler text
\newcommand\appendeqnum[1]{%
\hfill\refstepcounter{equation}\label{#1}(\theequation)}

\begin{document}
\lipsum[1][1-2]
$$\label{eq:first} 36-12=24$$
\lipsum[2][1-2]\appendeqnum{eq:second}

\lipsum[3][1-2]

A cross-reference to equation (\ref{eq:second}).
\end{document}