====== Latex math symbols ====== * https://fr.sharelatex.com/learn/List_of_Greek_letters_and_math_symbols ===== - Latex Algorithm ===== * https://www.questarter.com/q/creating-sub-algorithms-in-latex-using-the-algorithm-package-24_66317.html \documentclass{article} \usepackage{algorithm} \usepackage{algpseudocode} \newcommand\Algphase[1]{% \vspace*{-.7\baselineskip}\Statex\hspace*{\dimexpr-\algorithmicindent-2pt\relax}\rule{\linewidth}{0.4pt}% --> hline \Statex\hspace*{-\algorithmicindent}\textbf{#1}% --> text \vspace*{-.7\baselineskip}\Statex\hspace*{\dimexpr-\algorithmicindent-2pt\relax}\rule{\linewidth}{0.4pt}% --> hline } \begin{document} \begin{algorithm} \caption{Euclid’s algorithm}\label{euclid} \begin{algorithmic}[1] \Require something \Ensure something \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b} \State $r\gets a\bmod b$ \While{$r\not=0$}\Comment{We have the answer if r is 0} \State $a\gets b$ \State $b\gets r$ \State $r\gets a\bmod b$ \EndWhile\label{euclidendwhile} \State \textbf{return} $b$\Comment{The gcd is b} \EndProcedure% \Algphase{Phase 1 - Gossip piece ids} \Require something \Function{somename}{someparams} \While{$x>-5$} \State $x\gets x-1$ \EndWhile \EndFunction \Algphase{Phase 2 - Require chunks} \Ensure something \Procedure{somename}{someparams} \While{$x>-5$} \State $x\gets x-1$ \EndWhile \EndProcedure \end{algorithmic} \end{algorithm} \end{document}