# How to display and cite algorithms in an Elsevier journal (using elsarticle.cls)?

Elsevier's PRL guide for authors does not include any conventions to cite algorithms. However, my manuscript includes an algorithm coded using algpseudocode enclosed in an algorithm environment which numbers each algorithm in the caption.

There are some papers in IEEE that tend to display algorithms as figures. So I was thinking of replacing the algorithm environment with figure and cite it as a figure altogether but I'm not sure how this is applicable in Elsevier.

There is one Elsevier article which includes an algorithm which is simply typed as an enumerated list inline with the main text (not as a pseudocode).

Hence, how to display and cite algorithms in Elsevier? Is it alright to keep them float at the top, encapsulated as a figure, or just printed inline with the main content?

• Ask at PRL, supposedly they know what they want. Personally, I would say that an algorithm is an algorithm (and not a figure), and it will be more clear to cite them as such. – Marijn May 3 '17 at 12:22
• @Marijn Would you rather have it inline (not as float) and without the caption heading? – Ébe Isaac May 3 '17 at 15:22
• That depends. Usually you need to refer to an algorithm in the text, which needs a \label and caption - either in a float or inline using \captionof. For simple cases however it may be sufficient just to write 'the following algorithm does X': and put the algorithm underneath. – Marijn May 3 '17 at 21:43