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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
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