I have a bunch of text in an align environment which is overflowing to the margin. I would like to wrap it. Note I'm using a different document class than the one state below.
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
e_i &= \varepsilon(d_i, y_i) + \lambda\frac{1}{2} \vert w \vert ^2\label{eq:regularisation} \\
\textnormal{where:} & \nonumber \\
\varepsilon(\cdot) &= \textnormal{cost function} \nonumber \\
w &= \textnormal{weights matrix of connection from immediate right layer (towards output layer)} \nonumber
\end{align}
\end{document}
Only solution I can think of is:
w &= \textnormal{weights matrix of connection from immediate right} \nonumber \\
&= \textnormal{layer (towards output layer)} \nonumber
Was hoping for a better solution as I don't want to have to change this every time the length of sentence changes.
\parbox[t]{3cm}{weights of ....}