Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: option to only include additions #66

Closed
tdegeus opened this issue Nov 26, 2016 · 2 comments · Fixed by #252
Closed

Enhancement: option to only include additions #66

tdegeus opened this issue Nov 26, 2016 · 2 comments · Fixed by #252

Comments

@tdegeus
Copy link
Contributor

tdegeus commented Nov 26, 2016

I most frequently only want to highlight the changed parts of the text, but am not so much interested in including the removals. Currently I set in the preamble

\providecommand{\DIFdel}[1]{{}}

This largely gives me what I want. However, I have noticed that I sometimes get some layout issues from the LaTeX-code that is generated to include the removals (for example in itemize, or when a complete section has been removed). In those cases the only solution appears to manually remove the obsolete LaTeX-code that corresponds to the removed text.

To avoid this I would really appreciate a command-line option for latexdiff (e.g. --add-only) such that no LaTeX-code is generated with the deleted text.

@tdegeus
Copy link
Contributor Author

tdegeus commented Nov 23, 2019

@ftilmann I'm still very much interested in this. Often, for example in submitting a revision of a manuscript, I'm only interested in highlighting where changes were made.

If you give me some pointers I could try prepare a PR.

@ftilmann
Copy link
Owner

Sorry for not replying earlier. I realise your original post is now nearly 3 years ago.
The conceptually easiest approach would be doing some post-processing (in sub postprocess) and simply deleting everything between matching \DIFdelbegin and \DIFdelend markers.
(early in the post-processing sequence so that all the other trickery has not yet been applied). It is possible that this would cause some undesirable side effects (if you prepare a PR please check your submission with the provides test suites (see instructions on the project Wiki page).

The actual marking up is done in the subroutine marktags. So the other approach would be to modify this subroutine to detect that deleted material is supposed to be added, and simply skip it, or to suppress the calls to marktags for deleted material.

Although somehow less elegant, I would favour the first approach because marktags is quite difficult to understand in the first place, and adding more if-clauses won't help, whereas the post-processing is essentially a linear set of pattern replacements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants