Math & ScienceSuppress new Line after Equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Suppress new Line after Equation

Post by Singularity »

Hello.

I would like have the period at the end of a sentence which ends with and equation to immediately follow the equation, not on a new line. But I don't want to include the period in the equation (which just doesn't seem right - the period is not part of the equation).

In other words, I want the period in this code to appear right after the equation, instead of where it appears (circled in the graphic):

Code: Select all

\documentclass[12pt,fleqn,reqno]{article}
\begin{document}
We do all kinds of manipulations which you guys in latex-community don't want to read about, and then we get

\begin{equation}
	\ddot{u}_n=k(u_{n-1}-2u_{n}+u_{n+1})
\label{theeEquation}
\end{equation}.

\end{document}
Thanks for your help.
SU

P.S. If putting the period inside the equation line is the only, or appropriate, way to do this, what about if you wanted something else on the same line?
Attachments
Move period to end of equation (without putting it in the equation).
Move period to end of equation (without putting it in the equation).
Capture.PNG (22.25 KiB) Viewed 13464 times
Last edited by Singularity on Wed Aug 17, 2011 9:14 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Suppress new Line after Equation

Post by Stefan Kottwitz »

Hi,

the equation environment is a displayed environment, with spacing before and after. If you wish to have a dot within that displayed environment, put the dot inside. It's logical from the typesetting view. If you don't want to mix text and math, don't embed a displayed formula in a sentence. If you would like, you could use inline math with \( ... \) or $...$.

Stefan
LaTeX.org admin
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Suppress new Line after Equation

Post by Singularity »

Stefan_K wrote:Hi,

the equation environment is a displayed environment, with spacing before and after. If you wish to have a dot within that displayed environment, put the dot inside. It's logical from the typesetting view. If you don't want to mix text and math, don't embed a displayed formula in a sentence. If you would like, you could use inline math with \( ... \) or $...$.

Stefan
Well, it seems like the standard is to write math as grammatically correct sentences (says my thesis adviser and a Latex tips site). Therefore, it needs a period where there should be one. If I want to write an equation which should stand out, is too big to use the inline math, or needs to be numbered, I still need the period.

Is the standard just to put the period into the equation environment? That just seems inconsistent with what LATEX I've learned (note that I am a newbie).

I want to write correctly because I have already been corrected as to how to type inline numbers (e.g. "there are 5 of them" should be written as "there are $5$ of them").

Thanks, Stefan.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Suppress new Line after Equation

Post by Stefan Kottwitz »

No problem, the best is with amsmath and \text:

Code: Select all

\usepackage{amsmath}
...
\begin{equation}
  \ddot{u}_n=k(u_{n-1}-2u_{n}+u_{n+1}) \text{ and that's all}.
  \label{theeEquation}
\end{equation}
You can also write

Code: Select all

\ddot{u}_n=k(u_{n-1}-2u_{n}+u_{n+1}) \text{.}
if you like to have the correct text font period.

Stefan
LaTeX.org admin
Singularity
Posts: 156
Joined: Sat Jan 22, 2011 9:55 pm

Re: Suppress new Line after Equation

Post by Singularity »

It seems most people just put the period in the equation (some examples I just see online). I'll use \text when necessary to include something.
Thanks.
Post Reply