程序:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}
\title{Math: using align environment}
\author{he}
\maketitle
%align for equation numbering
%align* for no equation numbering
% & means "line up here"
% \\ means "break line"
solve the equation $0 = 3x^3 + 3x^2 - 6x$.
\begin{align}
0 &= 3x^3 + 3x^2 - 6x \\
&= 3(x^3 + x^2 + 2x)\\
&= 3x(x^2 + x - 2)\\
&= 3x(x + 2)(x - 1)\\
&\therefore\\
x &= 0, -2, 1
\end{align}
\end{document}
运行结果:
不想要出现后面的line numbering, 修改如下:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}
\title{Math: using align environment}
\author{he}
\maketitle
%align for equation numbering
%align* for no equation numbering
% & means "line up here"
% \\ means "break line"
solve the equation $0 = 3x^3 + 3x^2 - 6x$.
\begin{align*}
0 &= 3x^3 + 3x^2 - 6x \\
&= 3(x^3 + x^2 + 2x)\\
&= 3x(x^2 + x - 2)\\
&= 3x(x + 2)(x - 1)\\
&\therefore\\
x &= 0, -2, 1
\end{align*}
\end{document}
运行结果如下: