Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

The package algorithm2e is used throughout the document. The listings themselves are in files, and\input is used to include them. Now, the numbering of the listings suddenly skips from 6 to 8, i.e. it goes smoothly from 1 to 6, then from 8 onwards, but no "7". The MWE is non-trivial to produce, sine this error may be a result of the interplay between numbering of figures etc. The question is, did this ever happen to you?

share|improve this question
1  
I assume you have some floating environments and some non floating ones (H or equivalent) If you do that the floating ones may float out of sequence and you have to put \clearpage at strategic places to guard your non floating environment. Or better, don't do that:-) Actually this would explain being out of order but not no 7 (are you sure that happens:-) – David Carlisle May 17 '12 at 11:48
When you say no 7, is there actually an algorithm missing or are they all there but badly numbered? – David Carlisle May 17 '12 at 12:07
@DavidCarlisle: they are badly numbered, but everything is in place. In fact, can't find any [H] specifications... – Ilonpilaaja May 17 '12 at 12:08
A reference to the listing 8 (which should be listing 7 in fact), that comes after the listing itself, correctly says "Listing 7", while the reference that comes before the listing, says "Listing 8". – Ilonpilaaja May 17 '12 at 12:11

closed as too localized by David Carlisle, topskip, Marco Daniel, percusse, Joseph Wright May 17 '12 at 12:50

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

I was labelling the actual "misbehaving" listing twice, with different labels too, that is why this has occurred. The lesson is: algorithm2e package does not complain about two captions and two labels, just uses both labels if they are both being referenced somewhere. Sorry for a misleading post, thank you for you time and concern, and please close the post.

share|improve this answer

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