2017-05-16 110 views

回答

0

使用amsmathcases環境:

enter image description here

\documentclass{article} 

\usepackage{amsmath} 

\begin{document} 

\[ 
    \Delta(x) = \begin{cases} 
    1 & \text{if $x > 0$} \\ 
    -1 & \text{if $x < 0$} \\ 
    0 & \text{otherwise} 
    \end{cases} 
\] 

\end{document} 
0

這裏是一個方式:

$ 
\Delta(x)= 
    \left\{ 
     \begin{matrix} 
      1 & \mathrm{if}~x>0 \\ 
      -1 & \mathrm{if}~x<0 \\ 
      0 & \mathrm{otherwise} 
     \end{matrix} 
    \right. 
$ 

將會產生你想要像這樣的公式:

The example LaTeX equation

這種類型的方程中有幾個關鍵技巧:

  1. 在左側托架都將被聲明爲\{爲了讓LaTeX知道 顯示它,因爲它是一個特殊字符
  2. 此外,左大括號必須調整大小t o匹配您公式中包含的許多行,這是通過其前面的\left命令完成的。這也可以做了([
  3. 既然你有一個\left命令,它必須由\right}陪伴,但你不希望顯示右括號,所以\right.結束部分,而不顯示右括號。
  4. \mathrm命令將其中的文本恢復爲普通文本(臨時刪除數學模式),以便您的「if」和「otherwise」不會被斜體。
  5. ~只是增加了一點點空間,讓你的「如果」不與x > 0,使用mathrm

或者時經常發生碰撞,你可以檢查出this post for other ways to write piecewise functions in LaTeX。我希望這有幫助。