9

I would like to write a sentence that is centered and numbered automatically at the end. If what I am trying to type is just an equation, \begin{equation} works very nicely. However, since what I write involves a lot of words, I do not want to use \begin{equation}. Right now, all I can think of is using \textrm every time I write a regular word, but there must be another solution. As we keep the automatic numbering, is there any way to do what I am trying to do?

The following is the sample. Appreciate it.

\documentclass{article}
\begin{document}
\begin{equation}
\textrm{The derivative }y'\textrm{ of }y=\ln x\textrm{ is }y'=\frac{1}{x}
\end{equation}
\end{document}
15

You should type that like any other math component, only in text with interspersed math:

enter image description here

\documentclass{article}
\usepackage{amsmath,lipsum}
\begin{document}
\lipsum[1]
\vspace{\dimexpr-\abovedisplayskip+\abovedisplayshortskip}% May be needed
\begin{equation}
  \text{The derivative $y'$ of $y = \ln x$ is $y' = \tfrac{1}{x}$.}
\end{equation}
\lipsum[2]
\end{document}

You may wish to use a shorter space above, depending on the \abovedisplayshortskip depending on how the previous paragraph ends.

  • This works great as well. Thank you for the response. – BzTAK178 May 5 '14 at 22:57
10

You can use \mbox inside equation.

\documentclass{article}
\usepackage{amsmath} % recommended for math

\begin{document}

\begin{equation}
\mbox{The derivative $f'(x)$ of $f(x)=\log x$ is $f'(x)=\dfrac{1}{x}$}
\end{equation}

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