It appears that there is no such try
and catch
blocks in algorithm2e. Is there a way to add custom blocks for try
and catch
in algorithm2e?
There is a solution in GitHub which shows how this can be done using the algorithmicx/algpseudocode package. I would like to do this in algorithm2e.
Best Answer
Took a better look at the docs and found an applicable solution:
\SetKwProg{Cmd}{block}{suffix}{end}
The
suffix
andend
parts are optionalA minimum working example (MWE):
Output: