From 2eeed6cf13fe3a78fd7e2fa068afdc73834a2dde Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 1 Sep 2014 09:14:26 +0200 Subject: [PATCH] Fix bug with wrong baseline calculation in last paragraph (2nd attempt) This time, we consider the cases where a \par is not wanted (single-par insets, tabular cells). Fixes: #9231 --- src/output_latex.cpp | 10 ++++++---- status.21x | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index d7119c30fe..78323c050f 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -863,9 +863,9 @@ void TeXOnePar(Buffer const & buf, // calculates the space between the baselines according // to this font. (Matthias) // - // Is this really needed ? (Dekel) - // We do not need to use to change the font for the last paragraph - // or for a command. + // We must not change the font for the last paragraph + // of non-multipar insets, tabular cells or commands, + // since this produces unwanted whitespace. Font const font = par.empty() ? par.getLayoutFont(bparams, outerfont) @@ -874,7 +874,9 @@ void TeXOnePar(Buffer const & buf, bool const is_command = style.isCommand(); if (style.resfont.size() != font.fontInfo().size() - && nextpar + && (nextpar || maintext + || (text.inset().getLayout().isMultiPar() + && text.inset().lyxCode() != CELL_CODE)) && !is_command) { os << '{'; os << "\\" << from_ascii(font.latexSize()) << " \\par}"; diff --git a/status.21x b/status.21x index 0b8191fee7..4531877465 100644 --- a/status.21x +++ b/status.21x @@ -52,6 +52,7 @@ What's new * DOCUMENT INPUT/OUTPUT +- Fix baseline calculation in last paragraph (bug 9231). * LYX2LYX -- 2.39.5