I know that procedure in algorithm2e only allows captions like \caption{ProcedureName()}.
However, I'd like my procedure to appear in small caps:
\documentclass[12pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{enumerate}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[algosection, boxruled, linesnumbered]{algorithm2e}
\begin{document}
\begin{procedure}
\SetKwInOut{Input}{input}
\SetKwInOut{Output}{output}
\Input{Graph $G = (V,E)$}
\Output{}
\ForEach{node $v \in V$}
{
\lIf{$v$ is marked}{remove $v$}
}
\caption{\textsc{removemarked()}}
\label{alg:removemarked}
\end{procedure}
\end{document}
Which of course gives error
Paragraph ended before \algocf@captname was complete
Instead of procedure, if I use \begin{algorithm} ... \end{algorithm}, then it forks fine.
Is there a way to make it work in procedure as well?
