在当前行文本中输入数学公式:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
this formula : $f(x) = x^2$ is an example.
\end{document}
输入多个公式,并对齐公式:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
1 = 3 -2
\end{equation*}
\begin{equation*}
3 = 2 + 1
\end{equation*}
\begin{align*}
1 + 2 & = 3\\
1 & = 3-2
\end{align*}
\end{document}
幂函数,普通函数,积分函数等:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
f(x) & = x ^ 2\\
g(x) & = \frac{1}{x} \\
F(x) & = \int^a_b \frac{1}{3}x^3 \\
h(x) & = \frac{1}{\sqrt{x}} \\
a(x) & = \int^c_d
\end{align*}
\end{document}
输入矩阵:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation} %开始数学环境
\left( %左括号
\begin{array}{ccc} %该矩阵一共3列,每一列都居中放置
a11 & a12 & a13\\ %第一行元素
a21 & a22 & a23\\ %第二行元素
\end{array}
\right) %右括号
\end{equation}
$\left(
\begin{array}{ccc}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{array}
\right)$
$\left[
\begin{array}{cc}
1 & 0\\
0 & 1\\
\end{array}
\right]$
\end{document}
输入括号:
$\left(
\frac{1}{\sqrt{x}}
\right)$
总结:
1. Latex是一个强大的输入数学公式的工具
2. 使用$...$可以在一行中输入公式
3. align环境可以按照&对齐公式
4. 多个公式可以使用\\分开
5. 使用array环境可以输入矩阵
6. 使用\left和\right命令可以得到可扩放的括号
引用: