It doesn't seem to be formatted using instructions from the usual algorithm libraries of Latex.
It seems to be simply formatted text, I am uncertain.
It doesn't seem to be formatted using instructions from the usual algorithm libraries of Latex.
It seems to be simply formatted text, I am uncertain.
A simple way to do this is to use the enumitem package to make nested lists. The trick of starting the list on a new line is adapted from this answer. This is not needed if every item contains some text, but is necessary if a step is embedded directly as an item of the list. If a step will never be embedded like this, then the before={\apptocmd{\item}{\mbox{}}{}{}} code is not required.
\documentclass{article}
\usepackage{enumitem}
\usepackage{etoolbox}
\newlist{algolist}{enumerate}{3}
\setlist*[algolist]{leftmargin=*,before={\apptocmd{\item}{\mbox{}}{}{}}}
\setlist*[algolist,1]{label={\itshape Step \arabic*:}}
\setlist*[algolist,2]{label={\itshape Step \arabic{algolisti}.\arabic*:}}
\setlist*[algolist,3]{label={\itshape Step \arabic{algolisti}.\arabic{algolistii}.\arabic*:}}
\begin{document}
\begin{algolist}
\item This is the first step of the algorithm. It can have many lines in it and they will wrap as you would expect.
\item This is the second step of the algorithm.
\begin{algolist}
\item This is the first substep of the second step of the algorithm.
\item This is the second substep of the second step of the algorithm.
\begin{algolist}
\item This is the first substep of the second substep of the algorithm.
\item This is the second substep of the second substep of the algorithm.
\end{algolist}
\end{algolist}
\end{algolist}
\end{document}
noitemsep at level 1 and nosep at levels 2 and 3, in order to match the picture.
– egreg
Feb 05 '24 at 21:56
\item \mbox{} by the user. It also affects somehow spacing, if you comment it out, you see the difference in 2.2.1 and 2.2.2 become one liners.
– yannisl
Feb 06 '24 at 03:13
enumitem. – Alan Munn Feb 05 '24 at 19:56\textbf{n}thrown in. – John Kormylo Feb 05 '24 at 21:07