¿Cómo se escribe este tipo de pseudocódigo en látex?

¿Cómo se escribe este tipo de pseudocódigo en látex?

No parece estar formateado utilizando instrucciones de las bibliotecas de algoritmos habituales de Latex.ingrese la descripción de la imagen aquí

Parece ser texto con formato simple, no estoy seguro.

Respuesta1

Una forma sencilla de hacer esto es utilizar el enumitempaquete para crear listas anidadas. El truco de comenzar la lista en una nueva línea está adaptado deesta respuesta. Esto no es necesario si cada elemento contiene algo de texto, pero sí si un paso está incrustado directamente como un elemento de la lista. Si un paso nunca se integrará de esta manera, entonces el before={\apptocmd{\item}{\mbox{}}{}{}}código no es necesario.

\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}

salida de código

información relacionada