# Horizontal spacing after cases bracket in equation

How can I add a little horizontal spacing after the cases bracket, at the depicted position, so that 1 and 0 move to the right (the given screenshot looks okayish, but I'm using a different font where the spacing is too tight):

MWE:

\documentclass[ngerman]{scrbook}
\usepackage{amsmath}
\begin{document}
$$f(x) = \begin{cases} 1 & \text{if } x \text{ is even}\\ 0 & \text{else} \end{cases}$$
\end{document}

-

You can redefine the way amsmath defines the cases specification by updating \env@cases. Below I removed the zero-width column padding that was stripped from the array column specification:

\documentclass{scrbook}
\usepackage{amsmath}
\makeatletter
\def\env@cases{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{1.2}%
}
\makeatother
\begin{document}
$$f(x) = \begin{cases} 1 & \text{if x is even} \\ 0 & \text{else} \end{cases}$$
\end{document}


Alternatively, you can define your own width using something like

@{\hspace{<len>}}l@{\quad}l@{}


where you specify the length <len>. The above manages the spacing for cases at a document-wide level. If you want to make a one-off change, you can write your own case manually:

\documentclass{scrbook}
\usepackage{amsmath}
\begin{document}
$$\renewcommand{\arraystretch}{1.2} f(x) = \left\{ \begin{array}{@{\quad}l@{\quad}l@{}} 1 & \text{if x is even} \\ 0 & \text{else} \end{array} \right.$$
\end{document}


For more on the use of the @{...} specification, see Column and row padding in tables.

-

You can use \hspace{} to do it.

-

I propose a simple solution relying on the empheq package (that loads amsmath and mathtools) and the align(ed) or align(ed)at environments. It lets you define what's on the left or on the right of a math environment.I give 5 variation on how to control the horizontal spacing, not only between the brace and the subsequent formulae (with extravagant value) but also between the numerical values and the conditions, and different alignments for the conditions.

\documentclass[ngerman]{scrbook}

\usepackage[utf8]{inputenc}
\usepackage{fourier}

\begin{document}

[left = {f(x) =} \empheqlbrace\qquad ] \begin{aligned} & 1 & & \text{if } x \text{ is even}\\ & 0 & & \text{else} \end{aligned}
\bigskip

Controlling the horizontal spacing between the numerical values and the conditions:

[left = {f(x) =} \empheqlbrace\qquad ] \begin{alignedat}{2} & 1 & \qquad & \text{if } x \text{ is even}\\ & 0 & & \text{else} \end{alignedat}

Condition right aligned:

[left = {f(x) =} \empheqlbrace\qquad ] \begin{alignedat}{2} 1 & \qquad & \text{if } x \text{ is even}\\ 0 & & \text{else} \end{alignedat}
\bigskip

If there is no equation numbering,   the syntax is slightly simpler.

\begin{alignat*}{2}[left = {f(x) =} \empheqlbrace\qquad ]
1 & \quad  & \text{if  }   x \text{ is even}\\
0  &  &    \text{else}
\end{alignat*}

\begin{alignat*}{3}[left = {f(x) =} \empheqlbrace\qquad ]
1 &  & \quad  \text{if  }   x \text{ is even}&\\
0  &   & \text{else}&
\end{alignat*}


\end{document}

-