答案1
这是通过软件包完成的algorithm2e
。这只是制定所需的软件包选项并定义几个关键词的情况。
\documentclass{article}
\usepackage[ruled, noend, noline]{algorithm2e}
\usepackage{amsmath, amsfonts, MnSymbol}
\begin{document}
\begin{algorithm}
\SetKw{KwInitialisation}{Initialisation:}
\SetKw{KwReturn}{return}
\KwInitialisation \(X_0 \sim \mu\), \((\xi_k)\) i.i.d., \(X_0 \upmodels (\xi_k)\)
\For{\(k = 0, 1, 2, \dotsc\)}{
\(X_{k+1} = T_{\xi_k} X_k\)
}
\KwReturn{\(\{X_k\}_{k\in\mathbb{N}}\)}
\caption{Random Function Iteration (RFI)}
\end{algorithm}
\end{document}