TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like the lines of "procedure" and "end procedure", "function", and "end function" etc to not be numbered.

For example, the default behavior produces this:

1 procedure hasNext(v,V,s)
2  solution <-- findSolution()
3 end procedure

but I would like to have this:

  procedure hasNext(v,V,s)
1    solution <-- findSolution()
  end procedure

Is this possible?

share|improve this question
Welcome to TeX.sx! – Andrew Uzzell Nov 9 '12 at 11:48

The following is a workaround, since this package does not seem to provide any option to show this behavior.

The \Procedure and \EndProedure control sequences are replaced by \Statex, which results in a line not being numbered. The drawback is that the procedure markup needs to be inserted by hand.



\Statex{{\bf procedure} Euclid ($a,b$)}\Comment{The g.c.d. of a and b}
\State $r\gets a\bmod b$
\While{$r\not=0$}\Comment{We have the answer if r is 0}
\State $a\gets b$
\State $b\gets r$
\State $r\gets a\bmod b$
\State \textbf{return} $b$\Comment{The gcd is b}
\Statex{\bf end procedure}

share|improve this answer
Thanks @guillem, it seems that there is no other way to do it. – Asterios Nov 9 '12 at 15:56
You're welcome. – guillem Nov 12 '12 at 6:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.