LaTeX definitions of greyedout and lyxdeleted
Enrico Forestieri
forenr at lyx.org
Wed Jun 12 19:51:50 UTC 2024
On Wed, Jun 12, 2024 at 09:15:35PM +0300, Udicoudco wrote:
>
>Hello all,
>
>lyxdeleted is a macro used to
>mark deleted parts of text when
>using "show changes in output"
>in track changes. Instead of directly
>using \sout there is another helper
>macro, \mklyxsout, which is defined as
>\DeclareRobustCommand{\mklyxsout}[1]{\ifx\\#1\else\sout{#1}\fi}
>If I'm understanding correctly, this macro should test if the argument
>#1 is empty, if so it does nothing, otherwise it is feeding the argument
>to \sout.
>
>Why is this needed? from testing it appears \sout is just fine
>with empty arguments. In addition, I don't think this test is
>really robust, I attached an example where the output is wrong.
>Since the first object in the deleted part is \\ the comparison
>result with the true branch, so \sout is not applied and the \\
>is not used.
This was originally done for not using \sout with display math
equations, as they were striked out using tikz. See
https://www.lyx.org/trac/changeset/261e7ae9/lyxgit
For example, the code was outputing
case hullEquation:
if (os.strikeoutMath())
os << "\\\\\\\\\n\\lyxmathsout{\\parbox{\\columnwidth}{";
and it was \lyxmathsout that striked the equation. The "\\\\\\\\\n"
header there was signaling to skip \sout.
However, seemingly it is now done differently and this header is not
necessary anymore.
--
Enrico
More information about the lyx-devel
mailing list