Monday 12 September 2011

How to write the piecewise equation in latex?

When you are writing a paper, especially with a lot of mathematical equations, like piecewise equation, to know some ways to achieve this is quite a fun. To myself, I prefer using "cases environment" . Feel free to take place "\[ ... \]" by "\begin{equation}...\end{equation}"  

The cases environment

The cases environment[1] allows the writing of piecewise functions:
\[
 u(x) =
  \begin{cases}
   \exp{x} & \text{if } x \geq 0 \\
   1       & \text{if } x < 0
  \end{cases
}
\
]

u(x) = 
\begin{cases}
\exp{x} & \text{if } x \geq 0 \\
1       & \text{if } x < 0
\end{cases}

More information about editing advanced math in Latex can be referred here!

No comments:

Post a Comment