continue;
}
+ // Do not output empty environments if the whole paragraph has
+ // been deleted with ct and changes are not output.
+ if (size_t(pit + 1) < paragraphs.size()) {
+ ParagraphList::const_iterator nextpar = paragraphs.constIterator(pit + 1);
+ Paragraph const & cpar = paragraphs.at(pit);
+ if ((par->layout() != nextpar->layout()
+ || par->params().depth() == nextpar->params().depth()
+ || par->params().leftIndent() == nextpar->params().leftIndent())
+ && !runparams.for_search && cpar.size() > 0
+ && cpar.isDeleted(0, cpar.size()) && !buf.params().output_changes) {
+ if (!buf.params().output_changes && !cpar.parEndChange().deleted())
+ os << '\n' << '\n';
+ continue;
+ }
+ }
+
// This is a new environment.
TeXEnvironmentData const data =
prepareEnvironment(buf, text, par, os, runparams);
// Due to the moving argument, some fragile
// commands (labels, index entries)
// are output after this command (#2154)
- runparams.postpone_fragile_stuff = true;
+ runparams.postpone_fragile_stuff =
+ bparams.postpone_fragile_content;
if (intitle_command)
os << '{';
// Due to the moving argument, some fragile
// commands (labels, index entries)
// are output after this command (#2154)
- runparams.postpone_fragile_stuff = true;
+ runparams.postpone_fragile_stuff =
+ bparams.postpone_fragile_content;
os << '{';
}
// Due to the moving argument, some fragile
// commands (labels, index entries)
// are output after this command (#2154)
- runparams.postpone_fragile_stuff = true;
+ runparams.postpone_fragile_stuff =
+ bparams.postpone_fragile_content;
}
Font const outerfont = text.outerFont(pit);
if (nextpar && state->open_encoding_ == CJK
&& bparams.encoding().iconvName() != "UTF-8"
&& bparams.encoding().package() != Encoding::CJK
- && (nextpar_language->encoding()->package() != Encoding::CJK
+ && ((nextpar_language &&
+ nextpar_language->encoding()->package() != Encoding::CJK)
|| (nextpar->layout().isEnvironment() && nextpar->isMultiLingual(bparams)))
// inbetween environments, CJK has to be closed later (nesting!)
&& (!style.isEnvironment() || !nextpar->layout().isEnvironment())) {
//os << '\n';
}
- // It might be that we only have a title in this document
- if (was_title && !already_title) {
+ // It might be that we only have a title in this document.
+ // But if we're in a branch, this is not the end of
+ // the document. (There may be some other checks of this
+ // kind that are needed.)
+ if (was_title && !already_title && !runparams.inbranch) {
if (tclass.titletype() == TITLE_ENVIRONMENT) {
os << "\\end{" << from_ascii(tclass.titlename())
<< "}\n";