How do you write a function in Latex that is defined differently on multiple sections

I am going to show how to write the following function in LaTeX

function defined on multiple sections

\[
f(x) = \left\{
\begin{array}{ll}
e^{-1/x^{2}}, & x \neq 0,\\
0, & x=0.
\end{array}
\right.
\]

We can write this function a little nicer (according to me), we will shorten the gap between the opening curly brace and the beginning of function definitions (we will use the gap space that LaTeX uses between for example a+b – defined in this case as @{\>}, which is a little bit smaller gap that a=b – which would be defined with @{\;}. We will also use a bigger gap between the function definitions and sections, by using \quad spacing – defined in this case with @{\quad}.

\[
f(x) = \left\{
\begin{array}{@{\>}l@{\quad}l}
e^{-1/x^{2}}, & x \neq 0,\\
0, & x=0.
\end{array}
\right.
\]

We can see the difference between spaces in the picture below.

Razlicni zamiki

Advertisements

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: