}
-static void finishEnvironment(otexstream & os, OutputParams const & runparams,
- TeXEnvironmentData const & data)
+static void finishEnvironment(Buffer const & buf, Text const & text,
+ pit_type nextpit, otexstream & os,
+ OutputParams const & runparams,
+ TeXEnvironmentData const & data)
{
if (open_encoding_ == CJK && data.cjk_nested) {
// We need to close the encoding even if it does not change
os << setEncoding(data.prev_encoding->iconvName());
}
}
+
+ // Check whether we should output a blank line after the environment
+ DocumentClass const & tclass = buf.params().documentClass();
+ ParagraphList const & pars = text.paragraphs();
+ bool next_style_is_default = (nextpit >= runparams.par_end) ? false
+ : tclass.isDefaultLayout(pars.constIterator(nextpit)->layout());
+ if (!data.style->nextnoindent && next_style_is_default)
+ os << '\n';
}
prepareEnvironment(buf, text, par, os, runparams);
// Recursive call to TeXEnvironment!
TeXEnvironment(buf, text, runparams, pit, os);
- finishEnvironment(os, runparams, data);
+ finishEnvironment(buf, text, pit + 1, os, runparams, data);
}
if (pit != runparams.par_end)
prepareEnvironment(buf, text, par, os, runparams);
// pit can be changed in TeXEnvironment.
TeXEnvironment(buf, text, runparams, pit, os);
- finishEnvironment(os, runparams, data);
+ finishEnvironment(buf, text, pit + 1, os, runparams, data);
}
if (pit == runparams.par_end) {