# How to left-align cases inside an equation?

I am trying to left-align a cases inside an equation, like this:

and I need it to be inside equation because of the number (16). When I try this:

\label{eq:evaluate_metrics} \begin{align*} &\begin{cases} TPR=T_P/(T_P+F_N)\\ FPR=F_P/(F_P+T_N)\\ ACC=(T_P+T_N)/(T_P+F_N+F_P+T_N)\\ PRE=T_P/(T_P+F_P) \end{cases} \end{align*}


gives me an error:

Package amsmath Error: Erroneous nesting of equation structures;(amsmath) trying to recover with aligned'. \end{align*}

How can I make it look like the picture while including the equation number?

• It's wrong to use align* inside equation. Just remove \begin{align*}, \end{align*} and also the &. Commented Aug 7, 2020 at 15:56
• @egreg I did that, the cases are left-aligned, but the whole thing is in the center. Commented Aug 7, 2020 at 15:58
• That's where it should be, unless you left align all equations. Commented Aug 7, 2020 at 15:59
• @egreg I get it. It is not possible to left-align only one equation. Commented Aug 7, 2020 at 16:04
• Yes, but why? I see no reason to. If you really want it, change equation into flalign, add & in front of \begin{cases} and && after \end{cases}. But don't. Commented Aug 7, 2020 at 16:10

You can obtain locally left-aligned equations nesting them inside a fleqn environment from nccmath. This environment can take the distance from the text left margin at which it starts as an optional argument:

\documentclass{article}
\usepackage{amsmath, nccmath}
\usepackage[upright]{fourier}
\usepackage[reset, showframe]{geometry}

\begin{document}

\begin{fleqn}
$$\label{eq:evaluate_metrics} \begin{cases} TPR=T_P/(T_P+F_N)\\ FPR=F_P/(F_P+T_N)\\ ACC=(T_P+T_N)/(T_P+F_N+F_P+T_N)\\ PRE=T_P/(T_P+F_P) \end{cases}$$
\end{fleqn}

\begin{fleqn}[1em]
$$\label{eq:evaluate_metrics} \begin{cases} TPR=T_P/(T_P+F_N)\\ FPR=F_P/(F_P+T_N)\\ ACC=(T_P+T_N)/(T_P+F_N+F_P+T_N)\\ PRE=T_P/(T_P+F_P) \end{cases}$$
\end{fleqn}


\end{document}