latex之行内公式与行间公式

时间:2024-05-03 20:33:38

1、行内公式

我是对行内公式的测试$f(x)=1+x+x^2$

latex之行内公式与行间公式

2、行间公式

  • 单行不编号
    \begin{equation}
      \int_0^1(1+x)dx
    \end{equation}

    结果为:latex之行内公式与行间公式

  • 单行编号
    \begin{equation}\label{}
        \int_0^1(1+x)dx
    \end{equation}或者:\[\int_0^1(1+x)dx\]

    latex之行内公式与行间公式

  • 多行编号
    \begin{equation}\label{}
       \begin{cases}
        f(x)=1+x+x^2\\
        g(x)=a_nx^n+a_{n-1}x^{n-1}+...+a_1x^1
       \end{cases}
    \end{equation}

    latex之行内公式与行间公式

    \begin{equation}\label{}
       \begin{split}
        f(x)=\cos(x+y)+\sin(x+y)=\cos x \cos y- \sin x \sin y \\
        +\sin x \cos y+\cos x \sin y
       \end{split}
    \end{equation}

    latex之行内公式与行间公式

    \begin{equation}\label{...}
    D(x) =
    \begin{cases}
    1, & \text{if } x \in \mathbb{Q};\\
    0, & \text{if } x \in \mathbb{R}\setminus\mathbb{Q}.
    \end{cases}
    \end{equation}

    latex之行内公式与行间公式

  • 多行不编号:
    \begin{equation}
    ...
    \end{equation}
    改成
    \begin{equation*}
    ...
    \end{equation*}或者使用:\begin{align*}...
    \end{align*}