how to align texts in equation cases

I need to make an equation case with text following it. That text should be displayed in the middle of the two cases. This is my code:

 \begin{eqnarray}\label{eq13}
a_k =
\begin{cases}
1 & \text{if $f_i$ has a value $v_k$}, \\
0 & \text{otherwise}
\end{cases}
\text{$f_i$ is a non-binary feature, \\$k=1,...,n$}
\end{eqnarray}


It wouldn't work, I want to begin a new line with $k=1,...,n$, since it sticks out of the page. I am using ACM format. How can I solve the problem?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align}\label{eq13}
a_k =
\begin{cases}
1 & \text{if $f_i$ has a value $v_k$}, \\
0 & \text{otherwise}
\end{cases}
\text{\quad\parbox{0.4\linewidth}{$f_i$ is a non-binary feature,\\ $k=1,...,n$}}
\end{align}

\end{document}


If you want begin a new line, simply write

%\begin{eqnarray}\label{eq13}
$$\label{eq13} %what for eqnarray? a_k = \begin{cases} 1 & \text{if f_i has a value v_k}, \\ 0 & \text{otherwise} \end{cases} %\text{f_i is a non-binary feature, \\k=1,...,n} %\end{eqnarray}$$
$f_i$ is a non-binary feature, $k=1$, \ldots, $n$.

• I mean I still want the text '$f_i$ is a non-binary feature, $k=1$, \ldots, $n$.' to be part of the equation. May 4, 2013 at 19:15
• @daiyue So where should it be? Where should it begin? May 4, 2013 at 19:21