I need to add an indent in front of 'climate' and 'each region' so that the overflowing lines aren't confused for a new line of pseudocode.
I have tried everything including this (the algorithm2e package wasn't working for me for some reason) and I've tried the usual \ to add a space, $\thinmuskip$, \indent to add an indent, and other things that didn't work. My latex code is below
\documentclass{article}
\usepackage[ruled,vlined]{algorithm2e}
\usepackage{algorithm}
\begin{document}
\begin{algorithm}[H]
\SetAlgoLined
initialisation: choose initial emission control rates $\boldsymbol{\mu^k}=[\mu^k(1) \ ... \ \mu^k(Tmax)]$ for each region $k \in 1,...,12$;
store initial $\boldsymbol{\mu} ^k$ in vector $CR$;
\For{\textup{each region $i \in 1,...,12$}}{{\nosemic find $\boldsymbol{\mu^i}$ that maximises $\sum_{t=1}^{Tmax} U[c^{i}(t), L^{i}(t)]R(t)$ subject to economic and ;
climate equations, with all other $\boldsymbol{\mu} ^k$ fixed from $CR$;
replace the old value of $\boldsymbol{\mu^i}$ in $CR$ with the new optimal $\boldsymbol{\mu^i}$;
}
}
\While{\textup{|$\boldsymbol{\mu^i}-\boldsymbol{\mu^j}$|>threshold for some regions $i,j$}}{
{repeat \textbf{for} loop;
}
}
\caption{Noncooperative Equilibrium for RICE}
\end{algorithm}
\end{document}


\documentclass{article}and end with\end{document}and include\usepackage{xxx}for necessary packages likealgorithm2eto ensure that your .tex file is compilable. – citsahcots Jul 21 '21 at 15:19\SetAlgoHangIndent{<len>}providing the solution. – Werner Sep 01 '21 at 21:36