2

I want to write a procedure called relax using the package algorithm2e. I tried

\documentclass{article}
\usepackage{algorithm2e}

\begin{document}
\begin{procedure}
This procedure does something\;
\caption{relax()}
\end{procedure}
\end{document}

This gives the error

! Argument of \@caption has an extra }.

If I write

\caption{test()}

instead, everything works fine. I thought that maybe the macro relax would overwrite the LaTeX command of the same name, so I tried the option nokwfunc to prevent that from happening, without success. How can I give my procedure the name relax?

3
  • 1
    \relax is a protected TeX command. Maybe it has something to do with that.
    – Arne
    Dec 10, 2022 at 21:29
  • Please report this, maybe it is a bug. According to the manual, you can use [email protected] for discussions about the package. Dec 11, 2022 at 2:28
  • 1
    Sent a bugreport. Thanks for the suggestion.
    – Arne
    Dec 11, 2022 at 13:23

1 Answer 1

1

As a workaround:

\documentclass{article}
\usepackage{algorithm2e}

\begin{document}
\begin{procedure}
This procedure does something\;
\caption{r{}elax()}
\end{procedure}
\end{document}

You must log in to answer this question.

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