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 write my bachelor thesis using a document class provided by our institute based on scrbook. I write pseudo-codes using algorithm2e which I put in the appendix since otherwise they would "interrupt" reading the text where I refer to them (they cover 4 pages).

My thesis has 7 chapters, excluding References and Appendix. The algorithms are numbered in their caption as 7.1, 7.2 and so on. I want them to be numbered 1, 2, ...

After googling, I found out how to add chapter numbers to the captions, however, I didn't write any of this (by myself, at least). How can I tell algorithm2e not to include the chapter numbers, as the appendix shouldn't be treated as part of my last chapter?

As chapter numbers may have been explicitly enabled in the document class I'm using: Which command(s) in the class file can be the problem? Note that all types of floats with captions (figures, theorems, ...) have a chapter number (but this is OK in general, except for my algorithms in the appendix).

I use the following options:

share|improve this question
Welcome to TeX.sx!. – Andrew Swann Nov 13 '12 at 19:11
@AndrewSwann thank you very much ;) – leemes Nov 13 '12 at 19:13

Without a MWE or your custom class, using the chngcntr package to reset the counter \algocf@float (indeed, a macro) after the last chapter may do the trick.




\counterwithin{\algocf@float}{chapter}% maybe part of your custom class




Some text.



  \Else{else... \\ \If{1}{if...}}%
\caption{An algorithm}

share|improve this answer

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.