# Controlling {numcases} horizontal right spacing after first column

\begin{numcases}
{Opt\left(P, i, \ell, s, r\right)=min }
\nonumber (3)\hspace{2 mm} Opt(P,i+1,''Skip'',r - 1) + C1\label{eq:3} & $r\geq1$ \\
\nonumber (4)\hspace{2 mm} 0  & $i = |P|$ and $r \geq 0$ \\
\nonumber (5)\hspace{2 mm} \infty & $r < 0$
\end{numcases}

but I want to control the amount of horizontal space it uses after the first column. The reason is that right now Latex uses too much and one of the conditions is not fully displayed and cut on the page.

Thank you!

-

A sloppy way is to decrease the width of the longest entry by adding negative space, see the first equation of the following example file.

Equations (2) and (3) use package amsmath and its environment cases instead. Also some other oddities (unrelated to the question) are resolved.

\documentclass{article}
\usepackage{amsmath}
\usepackage{cases}

\DeclareMathOperator{\Opt}{Opt}

\begin{document}

\subsection*{Original example with added \texttt{\textbackslash hspace*}:}

\begin{numcases}
{Opt\left(P, i, \ell, s, r\right)=min }
\nonumber (3)\hspace{2 mm} Opt(P,i+1,''Skip'',r - 1) + C1\label{eq:3}\hspace*{-1em}& $r\geq1$ \\
\nonumber (4)\hspace{2 mm} 0  & $i = |P|$ and $r \geq 0$ \\
\nonumber (5)\hspace{2 mm} \infty & $r < 0$
\end{numcases}

\subsection*{Example with \textsf{amsmath} and automatically shifted equation number:}

\begin{gather}
\label{eq:foo}
\Opt(P, i, \ell, s, r)=\min
\begin{cases}
\Opt(P,i+1,\text{Skip''},r - 1) + \text{C1} & r\geq1 \\
0  & \text{$i = |P|$ and $r \geq 0$} \\
\infty & r < 0
\end{cases}
\end{gather}

\subsection*{Example with \textsf{amsmath} and environment \textsf{multline}:}

\begin{multline}
\Opt(P, i, \ell, s, r)=\\
\min
\begin{cases}
\Opt(P,i+1,\text{Skip''},r - 1) + \text{C1} & r\geq1 \\
0  & \text{$i = |P|$ and $r \geq 0$} \\
\infty & r < 0
\end{cases}
\label{eq:bar}
\end{multline}

\end{document}

Result:

-