方程式中的換行

方程式中的換行

這是我想用 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 ...”關係,因此我建議您將材料顯示在兩個單獨的列中,並在第二列的開頭;替換為。if

此外,由於相同的、相當複雜的表達式在大括號之間出現了五次,我建議您預先定義它並給它一個簡寫,例如,\widehat{W}。 (顯然,您可以自由地想出一個更合適的速記符號!)然後使用一個array環境或一個dcases環境來說明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_2和。Q_3

相關內容