1

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

1
  • 1
    Simply use \begin{equation} 36 - 12 = 24 \label{somelabel} \end{equation}, and later use \ref{somelabel}.
    – Bernard
    Jun 20 '21 at 8:45
0

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".


enter image description here

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

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

\lipsum[3][1-2]

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.