7

I have the following preamble for algorithm2e:

 \usepackage[ruled,vlined,linesnumbered,resetcount,algochapter]{algorithm2e} 

I have many algorithms, in on of the algorithm as follows:

 \begin{algorithm}[t!] \centering nonumbering \caption{CAmple}\label{algoCPOR} \end{algorithm} 

I do not want the line nonumbering (only that line) to be numbered, how should I achieve this?

0

1 Answer 1

3

Depending on your use-case, you can either use \LinesNotNumbered or \LinesNumberedHidden to temporarily remove lines numbers in an algorithm. Under the latter, \ShowLn prints the line number for that specific line (if you wish to intermix showing/not):

enter image description here

\documentclass{book} \usepackage[ruled,vlined,linesnumbered,resetcount,algochapter]{algorithm2e}% http://ctan.org/pkg/algorithm2e \begin{document} {\LinesNumberedHidden \begin{algorithm}[ht] \centering nonumbering \caption{CAmple1}\label{algoCPOR1} \end{algorithm}} \begin{algorithm}[ht] \centering nonumbering \caption{CAmple2}\label{algoCPOR2} \end{algorithm} \LinesNumberedHidden \begin{algorithm}[ht] \centering\ShowLn nonumbering \caption{CAmple3}\label{algoCPOR3} \end{algorithm} \end{document} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.