Im very new to latex and I want to write an algorithm like the picture below:
How can I write the Function of the algorithm like so?
I saw alternatives such as \Procedure
or \function
but they give me the words "Function" Or "Procedure" in front. How can I achieve the headers' results as below for my function wrapper?
Is there another tag for this?
Below is an example of the latex code im using
\begin{algorithm}
\caption{recursiveAlgo}
\begin{algorithmic}[1]
\Function{recursiveAlgo}{$mst, path, currentNode, drilled$}
\State stop <- false
\While{$!stop$}
\If{currentNode.childNumber != 0}{
\For {$i=0$ to currentNode.childNumber - 1}
\State drilled ++
\State path.push\_back(currentNode.coord, currentNode.child[i].coord)
\State recursiveAlgo(path, currentNode.child[i])
\EndFor}
\EndIf
\State \Return path;
\EndWhile
\EndFunction
\end{algorithmic}
\end{algorithm}
What I want to is to change the results of:
\Function{recursiveAlgo}{$mst, path, currentNode, drilled$}
Which appear as:
How do I show the function name without its type declared and the name in bold like the example in the first picture?
\documentclass{...}
and ending with\end{document}
. – DG' Apr 30 '20 at 23:31\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – DG' May 1 '20 at 10:21