Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

I'm working on a document on how to solve some basic integral problems. However, I'm having difficulty getting \begin{equation}\end{equation} to do what I need it to do. I would like all of my equations to be aligned (why I started looking at the equation environment) and numbered, but I would also like to put lines of text between parts of the equation to document what is happening.

My problem is, lines of text are inline with equations no matter what I type. Here's what I've tried.

\begin{equation}
\vec{F_{net}} = m \vec{a}\\
\text{This is a basic equation, and is also on the same line as the previous example}
\end{equation}

This code compiles fine, but everything is on one line and runs off the page. What's the best way to fix this?

share|improve this question

marked as duplicate by Mico, egreg, Werner, Heiko Oberdiek, Stefan Kottwitz Apr 26 '13 at 19:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You should just put the \text outside the equation. Why not? –  Werner Apr 26 '13 at 18:22
    
@Werner - the OP's write-up wasn't very clear on this point, but he/she may have meant to write that the text is to be inserted between equations that are to be aligned (say, on some equal sign)... –  Mico Apr 26 '13 at 18:31
    
@Mico: Then the OP should see Is it possible to break up an align environment and keep the tab positions? and its associated duplicates... –  Werner Apr 26 '13 at 18:34

2 Answers 2

up vote 0 down vote accepted

If you have more than one equation and some running text between the equations, you should probably use either the \intertext macro of the amsmath package or the \shortintertext macro of the mathtools package. As the second macro name suggests, it's meant for cases of only a few words between successive equations.

Separately, to have several equations aligned vertically, you should look into using the align environment (provided by the amsmath package).

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\vec{F}_{\text{net}} &= m \vec{a} \label{eq:fnet}\\
\intertext{This is a basic equation, and is also on the same line as the previous example. And some more text. And still more text.} 
E &= mc^2 \label{eq:einstein}
\end{align}

Here are some cross-references to equations \eqref{eq:fnet} and \eqref{eq:einstein}.
\end{document}
share|improve this answer

Option 1:

enter image description here

\documentclass[preview,border=12pt]{standalone}

\usepackage{amsmath}

\begin{document}

\begin{gather}
\vec{F}_\text{net} = m \vec{a}\\
\intertext{This is the Newton's second law of motion when the mass does not change with time. But for time-varying mass, we have to use}
\vec{F}_\text{net} = \frac{\textrm{d}(m\vec{v})}{\textrm{d}t}
\end{gather}

\end{document}
share|improve this answer
    
The OP's write-up wasn't entirely clear, but he/she may be looking to place text between equations that are to be aligned vertically. –  Mico Apr 26 '13 at 18:28

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