I'm referring to this answer of the question on 'how to exclude functions from \listofalgorithms in algorithm2e'. The solution provided in the answer just omits the word function within the list of algorithms, but still prints the function name without a number (the number is replaced by a -).

I would like to completely remove the entries for all functions and procedures from the list of algorithms. Is this possible?

1 Answer 1


The minimal example below uses code from the answer to algorithm2e: Exclude functions from \listofalgorithms with the addition of \renewcommand{\addcontentsline}[3]{} in the appropriate location where contents is written to the List of Algorithms:

enter image description here



  % we tell hyperref to use algocfproc as category and to take the appropriate ref.
  \@ifundefined{hyper@refstepcounter}{\relax}{% if hyper@refstepcounter undefind, no hyperref, else...
      \expandafter\def\csname theH\@proc@func\endcsname{\algocf@captname#3@}%if procnumbered, take \thealgocf as ref
      \expandafter\def\csname theH\@proc@func\endcsname{\algocf@captname#3@}%else take procedure or function name
    \addtocounter{algocf}{-1}% \caption do a refstepcounter, so we restore the precedent value
    \gdef\@currentlabel{\algocf@captname#3@}% let the label be the name of the function, not the counter
  \renewcommand{\addcontentsline}[3]{}% Remove placement of content
  \ifthenelse{\equal{\algocf@captparam#2@}{\arg@e}}{% if no paramater, we remove the ()
  }{%                                                 else we give the complete name



\caption{Foo bar} 



You must log in to answer this question.

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