3

I used \SetKwProg{myproc}{Procedure}{}{} for starting my pseudo-code with Procedure keyword. But its end statement (the last end in pseudo-code) is not appear in the result pdf. So how can i bring it?

\documentclass[10pt,a4paper]{article}
\usepackage[algo2e]{algorithm2e}

\begin{document}

\IncMargin{1em}
\begin{algorithm2e}[H]
\SetKwFunction{proc}{BuildEBTM}%
\SetKwProg{myproc}{Procedure}{}{}
\SetKwInOut{Input}{input}
\SetKwInOut{Output}{output}
\SetKwFunction{connect}{Connect}
\SetKwData{ce}{ce}
\myproc{\proc{}}{
    \Input{A Process $M$}
    \Output{A Process $EM$}
    \BlankLine
    \ForEach{FlowElement $e$ in $M$}{
        \ForEach{Converter $c$ in $Converters$}{
            \If{$c$ accepts $e$}{
                \ce $\leftarrow$ $c$ converts $e$\;
                \connect($EM$,\ce)\;
            }               
        }
    }
}
\caption{my procedure}
\label{my_procedure}
\end{algorithm2e}
\DecMargin{1em}

\end{document}

The result pdf without last end statement:

result pdf

0

1 Answer 1

4

According to the documentation on CTAN, the last argument of the \SetKwProg command sets the end text. So get that 'end', the builder for the \myproc command should be

\SetKwProg{myproc}{Procedure}{}{end}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .