+ ParagraphList::const_iterator par = pbegin;
+
+ Counters & counters = buf.params().getLyXTextClass().counters();
+ LyXLayout_ptr const & bstyle = par->layout();
+
+ string id = par->getDocbookId();
+ id = id.empty()? "" : " id = \"" + id + "\"";
+
+ if (bstyle->latexparam().find('#') != string::npos) {
+ counters.step(bstyle->counter);
+ }
+
+ if (!bstyle->latexparam().empty()) {
+ id = bstyle->latexparam();
+ if (id.find('#') != string::npos) {
+ string el = expandLabel(buf.params().getLyXTextClass(),
+ bstyle, false);
+ id = subst(id, "#", el);
+ }
+ }
+
+ //Open outter tag
+ sgml::openTag(os, depth, false, bstyle->latexname(), id);
+ os << '\n';
+
+ // Label around sectioning number:
+ if (!bstyle->labeltag().empty()) {
+ sgml::openTag(os, depth, false, bstyle->labeltag());
+ os << expandLabel(buf.params().getLyXTextClass(), bstyle, false);
+ sgml::closeTag(os, depth, false, bstyle->labeltag());
+ }
+
+ // Opend inner tag
+ sgml::openTag(os, depth, true, bstyle->innertag());
+
+ par->simpleDocBookOnePar(buf, os, outerFont(par - paragraphs.begin(), paragraphs),
+ runparams, depth);
+
+ // Close inner tags
+ sgml::closeTag(os, depth, true, bstyle->innertag());
+ os << '\n';
+
+ ++par;
+ while (par != pend) {
+ LyXLayout_ptr const & style = par->layout();
+ ParagraphList::const_iterator send;