// the inset, and we're using "auto" or "default" encoding, the encoding
// should be set back to that local_font's encoding.
if (nextpit == paragraphs.end() && runparams_in.local_font != 0
+ && runparams_in.encoding != runparams_in.local_font->language()->encoding()
&& (bparams.inputenc == "auto" || bparams.inputenc == "default")) {
runparams_in.encoding = runparams_in.local_font->language()->encoding();
os << setEncoding(runparams_in.encoding->iconvName());
-
}
// Otherwise, the current encoding should be set for the next paragraph.
else
// Note from JMarc: we will re-add a \n explicitely in
// TeXEnvironment, because it is needed in this case
if (nextpit != paragraphs.end()) {
- os << '\n';
- texrow.newline();
+ Layout const & next_layout = nextpit->layout();
+ // no blank lines before environments!
+ if (!next_layout.isEnvironment() || style == next_layout) {
+ os << '\n';
+ texrow.newline();
+ }
}
if (nextpit != paragraphs.end())
was_title = false;
}
- if (layout.is_environment) {
- par = TeXOnePar(buf, text, par, os, texrow,
- runparams, everypar);
- } else if (layout.isEnvironment() ||
+ if (layout.isEnvironment() ||
!par->params().leftIndent().zero()) {
par = TeXEnvironment(buf, text, par, os,
texrow, runparams);