How can I get LaTeX to apply line breaks in display math mode for a long equation?
I created a table of:
% \usepackage{booktabs}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{@{}|l|l|l|@{}}
\toprule
& Actual Positive $(y_i=1)$ & Actual Negative $(y_i=0)$ \\ \midrule
Predicted Positive $c_i=1$ & $C_{TP_i}=0$ & $C_{FP_i}=r_i+C^m_{FP_i}$ \\ \midrule
Predicted Negative $c_i=0$ & $C_{FN_i}=C_{device_i} + C_{marketInvest_i} + C_{usage_i}-Downpayment_i$ & $C_{TN_i}=0$ \\ \bottomrule
\end{tabular}
\end{table}
where
$C_{FN_i}=C_{device_i} + C_{marketInvest_i} + C_{usage_i}-Downpayment_i$
denotes the equation which is too long.
How can I split it e.g. like
$C_{FN_i}=C_{device_i} +
C_{marketInvest_i} +
C_{usage_i}-Downpayment_i$
When using align
in the table
\begin{align*}
C_{FN_i}=C_{device_i} &+\\
C_{marketInvest_i} &+\\
C_{usage_i} &-\\
Downpayment_i
\end{align}
the result is a compilation error in latex.
\begin{table}[]
\centering
\caption{Cost matrix proposed for telecommunication industry.}
\label{tbl:tma-costmat}
\begin{tabular}{@{}l|l|l@{}}
& Actual Positive $(y_i=1)$ & Actual Negative $(y_i=0)$ \\ \midrule
Predicted Positive $c_i=1$ & $C_{TP_i}=0$ & $C_{FP_i}=r_i+C^m_{FP_i}$ \\ \midrule
Predicted Negative $c_i=0$ & \begin{align*}
C_{FN_i}=C_{device_i} &+\\
C_{marketInvest_i} &+\\
C_{usage_i} &-\\
Downpayment_i
\end{align} & $C_{TN_i}=0$ \\
\end{tabular}
\end{table}
\begin{align*}
is paired with\end{align}
.