[Tex/LaTex] changes package – change the \replaced command to show only the new text

changes

I am using the changes package. The final document that I wish to produce is such that

  1. Highlight the changed text
  2. Has a change list, naming added, and REPLACED text.

This could be achieved by changing the \replaced command so that it would only show the new text, and not the old. I cannot use \added instead of replaced as that would show as Added in the changes list.

here's my MWE

\documentclass{article}

\usepackage{changes}


\begin{document}

Alas my love you do me wrong, to cast me off discourteously. For I have loved you well \added{and long}, delighted in your \replaced{company}{corporation}  .


\listofchanges

\end{document}

And the output I'd like to achieve is this (I got it by cheating, the MWE does not generate it:

Desired Output

Best Answer

Here is a version that produces the required result:

\documentclass{article}

\usepackage{changes}

\makeatletter
\let\Changes@Markup@Deleted\@gobble
\makeatother

\begin{document}

Alas my love you do me wrong, to cast me off discourteously.
For I have loved you well \added{and long}, delighted in your \replaced{company}{corporation}.

\listofchanges

\end{document}

Output:

enter image description here

The \Changes@Markup@Deleted macro is what produces the highlighted replaced text (based on whatever style is set). We just define it to ignore its argument such that the produced text is always empty.

Related Question