In my thesis, I need to describe both algorithms and cryptographic games. Currently I am using the algorithm2e and the algorithm environment for both.

Is there an option to specify dual captions so that games are captioned with Game and algorithms with Algorithm.

Note: In essence I am asking the question in How to have two separate types of caption labels for algorithms? but with algorithm2e package.


1 Answer 1


You can use \captionof together with a new float type within a normal algorithm environment.

This shows how to do it with either float or newfloat. Interestingly, algorithm2e does not automatically load either. I recommend newfloat as being more compatible with the caption package.

\DeclareFloatingEnvironment[fileext=loga,listname=List of Games,placement=htp]{game}% log already used





\listof{Game}{List of Games}

\caption{test 1}

\captionof{game}{test 2}

\captionof{Game}{test 3}
  • Thank you, you have been very helpful. Your suggestion is working. Any idea, on how to combine it with autoref in order to reference captionof{game} as Game. Apr 19, 2020 at 9:45
  • IIRC, \captionof{Game}{...} calls \refstepcounter{Game} which should set up \label to save the counter name (Game). If not, \edef\@currentlabelname{Game} (you will need to something about the @). Apr 19, 2020 at 14:33

You must log in to answer this question.

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