Math & ScienceHow to align equation when it includes texts?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

How to align equation when it includes texts?

Post by yaozhao »

Code: Select all

10. a. The inverse supply is
\[P =\frac{Q^S}{10}\]
whereas the inverse demand is
\[P = 20 – \frac{1}{5}Q^D\]
The graph is shown below.
I want that two = align. How to do this? I know how to do when there are no texts (by using \begin{align*} and &).

Recommended reading 2024:

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

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

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

How to align equation when it includes texts?

Post by Stefan Kottwitz »

Hi,

you can use \intertext:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\noindent
The inverse supply is
\begin{align*}
      P &=\frac{Q^S}{10} \\
  \intertext{whereas the inverse demand is}
      P &= 20 – \frac{1}{5}Q^D
\end{align*}
The graph is shown below.
\end{document}
Stefan
LaTeX.org admin
Post Reply