等式中的换行符

等式中的换行符

这是我想要用 LaTex 写的方程式: 在此处输入图片描述

我读过了这些建议,但对于拆分和多行命令,它说它们未定义(对于多行也是如此,但这对我来说并不适合)。还有其他断行的可能性吗?

答案1

empheq(加载mathtoolsamsmath)允许将任何内容放在一组方程的左侧或右侧。因此,这是另一个解决方案,具有环境gather*

    \documentclass[12pt,a4paper,bothsides]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[showframe, nomarginpar]{geometry}
    \usepackage[overload]{empheq}


    \begin{document}

    \begin{gather*}[left ={ V_{i,j} = \empheqlbrace},  right = \empheqrbrace ]
           a + b  = c + d \\
            ∫_0¹ x² \ \mathrm{d}x   = \dfrac{1}{3}\\
           \nabla u  =  0
    \end{gather*}

    \end{document}

在此处输入图片描述

答案2

由于您已经在评论中指出分号是为了表示“如果...”的关系,我建议您将材料显示在两个单独的列中,并在第二列的开头;用 替换。if

此外,由于相同的、相当复杂的表达式在花括号之间出现了五次,我建议您事先定义它并给它一个简写,比如说。\widehat{W}(您显然可以自由地想出一个更合适的简写符号!)然后使用环境arraydcases环境来陈述V_{ij}是什么,\widehat{W}或者您最终选择的任何符号——让它出现五次。

这种设置——首先,定义复杂的表达式;其次,在陈述是什么时反复使用它V_{ij}——应该让读者更容易地关注论点的结构。

在此处输入图片描述

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}    
\begin{document}
Let $\displaystyle\widehat{W}\equiv W_{j}\ln\biggl( 1 + 
  \frac{G_{i,j} \abs{h_{i,j}}^2 P_{i,j}} {\sigma_{i,j}^2} \biggr)$. Then
\[
\renewcommand\arraystretch{1.5} % more space between lines to mimic display style
  V_{i,j} =
  \left\{\begin{array}{ll}
     (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o}) \widehat{W}
        & \text{if } D_{i}^{d} + D_{i}^{o} \leq \widehat{W}\\
     Q_{1}D_{i}^{d} \widehat{W}
        & \text{if } D_{i}^{d} \leq \widehat{W} < D_{i}^{d} + D_{i}^{o}\\
     0 
        & \text{if } \widehat{W} < D_{i}^{d}
  \end{array}\right\}
\]

Or, using the \texttt{dcases} environment:
\[
  V_{i,j} =
  \begin{dcases} % dcases environment is provided by the mathtools package
     (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o}) \widehat{W}
        & \text{if } D_{i}^{d} + D_{i}^{o} \leq \widehat{W}\\
     Q_{1}D_{i}^{d} \widehat{W}
        & \text{if } D_{i}^{d} \leq \widehat{W} < D_{i}^{d} + D_{i}^{o}\\
     0 
        & \text{if } \widehat{W} < D_{i}^{d}      
  \end{dcases}
\]
\end{document}

答案3

另一个解决方案:

\documentclass{article}

\usepackage{geometry}
\usepackage{mathtools}

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}


\begin{document}

\begin{equation*}
  V_{i,j} =
  \begin{Bmatrix}
    \displaystyle (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o})W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} + D_{i}^{o} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}\\[3ex]
    \displaystyle Q_{1}D_{i}^{d}W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d} + D_{i}^{o}\\[3ex]
    \displaystyle 0; W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d}
  \end{Bmatrix}
\end{equation*}

\end{document}

输出2

PS 我添加了geometry以避免方程进入边缘。

更新

如果希望文档中的所有数学运算都以显示样式书写,可以声明\everymath{\displaystyle}

\documentclass{article}

\usepackage{geometry}
\usepackage{mathtools}

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\everymath{\displaystyle}


\begin{document}

\begin{equation*}
  V_{i,j} =
  \begin{Bmatrix}
    (Q_{1}D_{i}^{d} + Q_{2}D_{i}^{o})W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} + D_{i}^{o} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}\\[3ex]
    Q_{1}D_{i}^{d}W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu}; D_{i}^{d} \leq W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d} + D_{i}^{o}\\[3ex]
    0; W_{j}\ln{\mkern -7mu}\left(1 + \frac{G_{i,j}\abs{h_{i,j}}^{2}P_{i,j}}{\sigma_{i,j}^{2}}\right){\mkern -5mu} < D_{i}^{d}
  \end{Bmatrix}
\end{equation*}

\end{document}

答案4

您必须加载该mathtools包才能获取multlined环境。

无论如何,Bmatrix来自同一个包(以及来自的amsmath,它mathtools是一个扩展)的环境可能适合您:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
V_{i,j}=\begin{Bmatrix} Q_1 \\ Q_2 \\ Q_3\end{Bmatrix}
\]
\end{document}

在此处输入图片描述

除了Q_1Q_2Q_3,您还可以输入自己的公式。

相关内容