From: Juergen Spitzmueller Date: Thu, 26 Dec 2019 06:15:37 +0000 (+0100) Subject: Mark deleted graphics in output X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=feaf7fc11a159e3eb5025582961689dd777bc2b0;p=features.git Mark deleted graphics in output Fixes #11687 --- diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index dd3f25c64d..084552eac7 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -294,14 +294,14 @@ static docstring const changetracking_xcolor_ulem_hyperref_cb_def = from_ascii( "}}\n" "\\DeclareRobustCommand{\\lyxsout}[1]{\\ifx\\\\#1\\else\\sout{#1}\\fi}\n"); -static docstring const changetracking_tikz_math_sout_def = from_ascii( - "%% Strike out display math with tikz\n" +static docstring const changetracking_tikz_object_sout_def = from_ascii( + "%% Strike out display math and text objects with tikz\n" "\\usepackage{tikz}\n" "\\usetikzlibrary{calc}\n" - "\\newcommand{\\lyxmathsout}[1]{%\n" - " \\tikz[baseline=(math.base)]{\n" - " \\node[inner sep=0pt,outer sep=0pt](math){#1};\n" - " \\draw($(math.south west)+(2em,.5em)$)--($(math.north east)-(2em,.5em)$);\n" + "\\newcommand{\\lyxobjectsout}[1]{%\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" "}\n"); @@ -1688,8 +1688,8 @@ TexString LaTeXFeatures::getMacros() const } } - if (mustProvide("ct-tikz-math-sout")) - macros << changetracking_tikz_math_sout_def; + if (mustProvide("ct-tikz-object-sout")) + macros << changetracking_tikz_object_sout_def; if (mustProvide("ct-none")) macros << changetracking_none_def; diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 2a291aafeb..27df512a29 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -858,6 +858,11 @@ void InsetGraphics::latex(otexstream & os, if (runparams.moving_arg) before += "\\protect"; + if (runparams.inDeletedInset) { + before += "\\lyxobjectsout{"; + after += "}"; + } + // We never use the starred form, we use the "clip" option instead. before += "\\includegraphics"; @@ -1136,6 +1141,8 @@ void InsetGraphics::validate(LaTeXFeatures & features) const if (contains(rel_file, ".")) features.require("lyxdot"); } + if (features.inDeletedInset()) + features.require("ct-tikz-object-sout"); } diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 7da33199c6..8546a02253 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -126,9 +126,9 @@ namespace { if (os.strikeoutMath()) { if (os.ulemCmd() == WriteStream::UNDERLINE) os << "\\raisebox{-\\belowdisplayshortskip}{" - "\\lyxmathsout{\\parbox[b]{\\linewidth}{"; + "\\lyxobjectsout{\\parbox[b]{\\linewidth}{"; else - os << "\\lyxmathsout{\\parbox{\\linewidth}{"; + os << "\\lyxobjectsout{\\parbox{\\linewidth}{"; } else if (os.ulemCmd() == WriteStream::UNDERLINE) os << "\\raisebox{-\\belowdisplayshortskip}{" "\\parbox[b]{\\linewidth}{"; @@ -1104,7 +1104,7 @@ void InsetMathHull::validate(LaTeXFeatures & features) const from_ascii("\\newcommand{\\endregexp}{}")); } else if (outerDisplay() && features.inDeletedInset() && !features.mustProvide("ct-dvipost")) { - features.require("ct-tikz-math-sout"); + features.require("ct-tikz-object-sout"); } // Validation is necessary only if not using AMS math.