LyX assumes that a standard paragraph following an aligned one or
a layout with NextNoIndent==false has to be indented on screen.
This means that in the latex output a blank line has to follow.
In this case there should be no problem as regards extra vertical
space and it simpler and more elegant to simply uncheck "Indent
Paragraph" in the Paragraph settings pane rather than changing
the current logic and allowing to insert a parbreak separator.
-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
{
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());
}
}
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);
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)
}
if (pit != runparams.par_end)
bool const useSetSpace = bparams.documentClass().provides("SetSpace");
if (par.allowParagraphCustomization()) {
if (par.params().startOfAppendix()) {
bool const useSetSpace = bparams.documentClass().provides("SetSpace");
if (par.allowParagraphCustomization()) {
if (par.params().startOfAppendix()) {
+ os << "\n\\appendix\n";
}
if (!par.params().spacing().isDefault()
}
if (!par.params().spacing().isDefault()
// but whose alignment is unchanged, or (case 3) the
// paragraph is a command not followed by an environment
// and the alignment of the current and next paragraph
// but whose alignment is unchanged, or (case 3) the
// paragraph is a command not followed by an environment
// and the alignment of the current and next paragraph
+ // is unchanged, or (case 4) the current alignment is
+ // changed and a standard paragraph follows.
+ DocumentClass const & tclass = bparams.documentClass();
if ((style == next_layout
&& !style.parbreak_is_newline
&& style.latextype != LATEX_ITEM_ENVIRONMENT
if ((style == next_layout
&& !style.parbreak_is_newline
&& style.latextype != LATEX_ITEM_ENVIRONMENT
|| (style.isCommand()
&& !next_layout.isEnvironment()
&& style.align == par.getAlign()
|| (style.isCommand()
&& !next_layout.isEnvironment()
&& style.align == par.getAlign()
- && next_layout.align == nextpar->getAlign())) {
+ && next_layout.align == nextpar->getAlign())
+ || (style.align != par.getAlign()
+ && tclass.isDefaultLayout(next_layout))) {
prepareEnvironment(buf, text, par, os, runparams);
// pit can be changed in TeXEnvironment.
TeXEnvironment(buf, text, runparams, pit, os);
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) {
}
if (pit == runparams.par_end) {