]> git.lyx.org Git - features.git/commitdiff
Mark deleted graphics in output
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 26 Dec 2019 06:15:37 +0000 (07:15 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:48 +0000 (15:48 +0200)
Fixes #11687

src/LaTeXFeatures.cpp
src/insets/InsetGraphics.cpp
src/mathed/InsetMathHull.cpp

index dd3f25c64dd7c2945db541c97d06eed8925e0745..084552eac72d1b7c09c542f291edfbeb591c66a9 100644 (file)
@@ -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;
index 2a291aafebb517db4a76eb8b5f49944912870bb4..27df512a29e2f1d507dc23e850ff0a89f6509e04 100644 (file)
@@ -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");
 }
 
 
index 7da33199c6743541a33a902a7e0376b5ff840e6e..8546a022537c2639a1b1de9d62d4b834e002d8b7 100644 (file)
@@ -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.