- //if (!style.free_spacing)
- // os << string(depth,' ');
+ bool label_closed = true;
+ bool para_closed = true;
+
+ if (style->latextype == LATEX_ITEM_ENVIRONMENT) {
+ string ls = "";
+ Counters & counters = buf.params().getLyXTextClass().counters();
+ if (!style->free_spacing)
+ os << string(depth,' ');
+ if (!style->labeltag().empty()) {
+ os << "<" << style->labeltag() << ">\n";
+ label_closed = false;
+ } else {
+ if (!defaultstyle->latexparam().empty()) {
+ counters.step("para");
+ ls = tostr(counters.value("para"));
+ ls = " id=\""
+ + subst(defaultstyle->latexparam(), "#", ls) + '"';
+ }
+ os << "<" << style->itemtag() << ">\n"
+ << string(depth, ' ') << "<"
+ << defaultstyle->latexname() << ls << ">\n";
+ para_closed = false;
+ }
+ }