3

I'm having a problem. I am writing my thesis in physics, so I use a lot of equations. Since equations are to be treated as part of a sentence they include punctuation in the end. I have all the equations numbered, but punctuation makes the equation number appear on a new line. I use the following code to introduce equations into the paper:

\begin{equation}

\label{ix}

\centerline{$I_{aligned} = I - I_{rot}$.}

\end{equation}

This makes equations appear as follows:

enter image description here

But I want the equation number to be on the same line as the equation.

  • 3
    Don't use \centerline. The equation environment is already centered. Also, you can't have blank lines inside the equation environment. Finally, use I_\mathrm{aligned}, as the "aligned" is a word (or acronym) and not a math variable. Likewise on "rot". – Steven B. Segletes Oct 21 '15 at 10:43
  • Ah, I did not realize that. Thank you! That solved it. Now to change 140 pages of equations! – Nikolay Sosnin Oct 21 '15 at 10:45
  • Don't you just hate it when that happens?? – Steven B. Segletes Oct 21 '15 at 10:46
  • you need a very good regex search/replace ;-) for your 140 pages ... – user4686 Oct 21 '15 at 10:53
  • Welcome, you could have asked the question a bit earlier to save some time replacing stuff ;-) – Johannes_B Oct 21 '15 at 11:01
4

The presence of the full stop is not relevant at all. You get exactly the same effect with

\begin{equation}
\centerline{$a=b$}
\end{equation}

and

\begin{equation}
\centerline{$a=b$}
\end{equation}

enter image description here

The fact is that the input is wrong to begin with: \centerline is a Plain TeX macro and should not be used in LaTeX, unless very special effects are needed.

An equation environment already centers the math material without any further effort. So your input should be

\documentclass{article} % this class just for producing the example

\usepackage{amsmath} % for math typesetting

\begin{document}

\begin{equation}
\label{ix}
I_{\textup{aligned}} = I - I_{\textup{rot}}.
\end{equation}

\end{document}

Note that blank lines are not allowed inside equation and that the textual subscript should be in the upright font.

enter image description here

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.