# Tag Info

## New answers tagged algorithm2e

0

As to creating a new type, use \newfloat (or just \newcounter). \documentclass{article} \usepackage{float} \usepackage{caption} \newfloat{Algorithm}{htbp}{loa} \begin{document} \captionof{Algorithm}{test} \end{document}

2

The type is different from what is typically used in the naming. In that regard, the algorithm environment typically use Algorithm as its name. algorithm2e is slightly different though; it uses algocf as the type, so you need to use \captionof{algocf}{<caption of algorithm>} Make sure the \captionof macro is used inside an environment (or group). ...

2

Styling of document elements should preferably be done in a consistent manner. As such and rightly so, algorithm2e's \SetAlFnt is issued at the start of the algorithm environment. That's why, when you call \SetAlFnt halfway through the algorithm... or even immediately after \begin{algorithm}, it's too late to change the algorithm fonts. ...

1

Below I've used two minipages, one for each algorithm, followed by two more minipages, one for each algorithm caption. The double-usage is required to achieve the appropriate alignment. \documentclass{article} \usepackage{amsmath} \usepackage[noline]{algorithm2e} \begin{document} \begin{figure} \begin{minipage}{0.65\linewidth} \begin{algorithm}[H] ...

3

You can use \SetAlgorithmName{Listing} inside the algorithm environment. \documentclass{article} \usepackage{algorithm2e} \begin{document} \begin{algorithm} test \caption{algo 1} \end{algorithm} \begin{algorithm} \SetAlgorithmName{Listing} test \caption{algo 2} \end{algorithm} ...

2


Top 50 recent answers are included