int column = 0;
+ bool const dvipost = LaTeXFeatures::isAvailable("dvipost") &&
+ (runparams.flavor == OutputParams::LATEX
+ || runparams.flavor == OutputParams::DVILUATEX);
+
if (oldChange.type != Change::UNCHANGED) {
// close \lyxadded or \lyxdeleted
os << '}';
column++;
- if (oldChange.type == Change::DELETED && !runparams.wasDisplayMath)
+ if (oldChange.type == Change::DELETED
+ && !runparams.wasDisplayMath && !dvipost)
--runparams.inulemcmd;
}
docstring macro_beg;
if (change.type == Change::DELETED) {
macro_beg = from_ascii("\\lyxdeleted{");
- if (!runparams.inDisplayMath)
+ if (!runparams.inDisplayMath && !dvipost)
++runparams.inulemcmd;
}
else if (change.type == Change::INSERTED)
// signature needed by \lyxsout to correctly strike out display math
if (change.type == Change::DELETED && runparams.inDisplayMath
- && (!LaTeXFeatures::isAvailable("dvipost")
- || (runparams.flavor != OutputParams::LATEX
- && runparams.flavor != OutputParams::DVILUATEX))) {
+ && !dvipost) {
if (os.afterParbreak())
str += from_ascii("\\\\\\noindent\n");
else
runparams.wasDisplayMath = runparams.inDisplayMath;
runparams.inDisplayMath = false;
bool deleted_display_math = false;
+ Change const & change = runparams.inDeletedInset
+ ? runparams.changeOfDeletedInset : lookupChange(i);
// Check whether a display math inset follows
if (d->text_[i] == META_INSET
// cannot set it here because it is a counter.
deleted_display_math = isDeleted(i);
}
+ if (bparams.output_changes && deleted_display_math
+ && runningChange == change
+ && change.type == Change::DELETED
+ && !os.afterParbreak()) {
+ // A display math in the same paragraph follows.
+ // We have to close and then reopen \lyxdeleted,
+ // otherwise the math will be shifted up.
+ OutputParams rp = runparams;
+ if (open_font) {
+ bool needPar = false;
+ column += running_font.latexWriteEndChanges(
+ os, bparams, rp, basefont,
+ basefont, needPar);
+ open_font = false;
+ }
+ basefont = getLayoutFont(bparams, outerfont);
+ running_font = basefont;
+ column += Changes::latexMarkChange(os, bparams,
+ Change(Change::INSERTED), change, rp);
+ }
}
- Change const & change = runparams.inDeletedInset
- ? runparams.changeOfDeletedInset : lookupChange(i);
-
if (bparams.output_changes && runningChange != change) {
if (open_font) {
bool needPar = false;
char_type const c = d->text_[i];
// A display math inset inside an ulem command will be output
- // as a box of width \columnwidth, so we have to either disable
+ // as a box of width \linewidth, so we have to either disable
// indentation if the inset starts a paragraph, or start a new
// line to accommodate such box. This has to be done before
// writing any font changing commands.
if (os.strikeoutMath()) {
if (os.ulemCmd() == WriteStream::UNDERLINE)
os << "\\raisebox{-\\belowdisplayshortskip}{"
- "\\lyxmathsout{\\parbox[b]{\\columnwidth}{";
+ "\\lyxmathsout{\\parbox[b]{\\linewidth}{";
else
- os << "\\lyxmathsout{\\parbox{\\columnwidth}{";
+ os << "\\lyxmathsout{\\parbox{\\linewidth}{";
} else if (os.ulemCmd() == WriteStream::UNDERLINE)
os << "\\raisebox{-\\belowdisplayshortskip}{"
- "\\parbox[b]{\\columnwidth}{";
+ "\\parbox[b]{\\linewidth}{";
else if (os.ulemCmd() == WriteStream::STRIKEOUT)
- os << "\\parbox{\\columnwidth}{";
+ os << "\\parbox{\\linewidth}{";
}