The following algorithm appears on p. 152 of Boyd and Parikh's book Proximal Algorithms.

I'd like to know how this was written in Latex, so that I can write my own algorithms in the same style. Which algorithm environment (if any) was used? Can anyone guess how this was written?

• – yoki Sep 7 '15 at 8:14
• @yoki If I use the algorithmic environment, then how do I get the "repeat" statement without an "until", and how do I get the numbered, indented steps after the repeat? And how do I get the "break if" statement? – littleO Sep 7 '15 at 8:21
• – jub0bs Sep 7 '15 at 11:07

I'm afraid no specialized package has been used:

\documentclass{article}
\usepackage{enumitem,amsmath}

\DeclareMathOperator{\prox}{\mathbf{prox}}

\begin{document}

\noindent
\begin{minipage}{\columnwidth}
\normalfont
\hrule
\vspace{2ex}
\textbf{given} $y^k$, $\lambda^{k-1}$, and parameter $\beta\in(0,1)$.

\medskip

Let $\lambda:=\lambda^{k-1}$.

\medskip

\textbf{repeat}
\begin{enumerate}[nosep,leftmargin=3.5em]
\item Let $z:=\prox_{\lambda g}(y^k-\lambda\nabla f(y^k))$.
\item \textbf{break if} $f(z)\le \hat{f}_\lambda(z,y^k)$.
\item Update $\lambda:=\beta\lambda$.
\end{enumerate}

\medskip

\textbf{return} $\lambda^k:=\lambda$, $x^{k+1}:= z$.

\vspace{2ex}
\hrule
\end{minipage}

\end{document}