CT: Mark deleted floats in output

Fixes #11175
This commit is contained in:
Juergen Spitzmueller 2019-12-27 09:50:11 +01:00
parent 117e63b01b
commit 7c63896c60
2 changed files with 14 additions and 0 deletions

View File

@ -299,10 +299,13 @@ static docstring const changetracking_tikz_object_sout_def = from_ascii(
"\\usepackage{tikz}\n"
"\\usetikzlibrary{calc}\n"
"\\newcommand{\\lyxobjectsout}[1]{%\n"
" \\bgroup%\n"
" \\color{lyxdeleted}%\n"
" \\tikz[baseline=(obj.base)]{\n"
" \\node[inner sep=0pt,outer sep=0pt](obj){#1};\n"
" \\draw($(obj.south west)+(2em,.5em)$)--($(obj.north east)-(2em,.5em)$);\n"
" }\n"
" \\egroup%\n"
"}\n");
static docstring const changetracking_none_def = from_ascii(

View File

@ -322,6 +322,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const
if (features.inFloat())
features.require("subfig");
if (features.inDeletedInset())
features.require("ct-tikz-object-sout");
features.useFloat(params_.type, features.inFloat());
features.inFloat(true);
InsetCaptionable::validate(features);
@ -435,6 +438,11 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
os << '[' << from_ascii(placement) << ']';
os << '\n';
if (runparams.inDeletedInset) {
os << "\\lyxobjectsout{%" << breakln;
os << "\\parbox{\\linewidth}{%" << breakln;
}
string alignment = getAlignment();
if (alignment == "left")
os << "\\raggedright" << breakln;
@ -445,6 +453,9 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
InsetText::latex(os, runparams);
if (runparams.inDeletedInset)
os << "}}";
// Force \end{<floatname>} to appear in a new line.
os << breakln << "\\end{" << from_ascii(tmptype) << "}\n";
}