Incorrect table or figure references in LaTeX


This bit me today, hard. It would be interesting to hear why someone thought it would be funny if caption and label had a mandatory order they have to appear inside a table or figure block. If they are in the wrong order there's no error message either, it compiles nicely but the reference numbers in the text where you refer from are wrong.

Remember kids: always put caption above the label.