#include "LaTeX.h"
#include "lyxtextclass.h"
#include "paragraph.h"
+#include "paragraph_funcs.h"
#include "ParagraphList_fwd.h"
#include "ParagraphParameters.h"
#include "pariterator.h"
// is it a layout that has an automatic label?
if (layout->labeltype == LABEL_COUNTER) {
- counters.step(layout->counter);
- string label = expandLabel(textclass, layout, par.params().appendix());
- par.params().labelString(label);
+ if (layout->toclevel <= buf.params().secnumdepth
+ && (!layout->isEnvironment()
+ || isFirstInSequence(it.pit(), it.plist()))) {
+ counters.step(layout->counter);
+ string label = expandLabel(textclass, layout,
+ par.params().appendix());
+ par.params().labelString(label);
+ }
} else if (layout->labeltype == LABEL_ITEMIZE) {
// At some point of time we should do something more
// clever here, like:
} else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
counters.step("bibitem");
int number = counters.value("bibitem");
- if (par.bibitem()) {
+ if (par.bibitem())
par.bibitem()->setCounter(number);
- par.params().labelString(layout->labelstring());
- }
+ par.params().labelString(layout->labelstring());
// In biblio should't be following counters but...
} else if (layout->labeltype == LABEL_SENSITIVE) {
// Search for the first float or wrap inset in the iterator
--i;
InsetBase * const in = &it[i].inset();
if (in->lyxCode() == InsetBase::FLOAT_CODE
- || in->lyxCode() == InsetBase::WRAP_CODE)
+ || in->lyxCode() == InsetBase::WRAP_CODE)
type = in->getInsetName();
break;
}