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

Support for UNDERLINE mode in preamble (useful for abstract) #273

Open
smihael opened this issue Sep 28, 2022 · 0 comments
Open

Support for UNDERLINE mode in preamble (useful for abstract) #273

smihael opened this issue Sep 28, 2022 · 0 comments

Comments

@smihael
Copy link

smihael commented Sep 28, 2022

As per https://www.researchgate.net/post/How-can-I-track-changes-in-LaTeX-especially-abstractenvironment, one of the issues that might arise from using latediff is that by default it doesn't work with abstract environment, that is used in many journal templates.

In order to enable diff in abstract section one has to use the --append-context2cmd option:
latexdiff --append-context2cmd="abstract" old.tex new.tex > diff.tex

However, this often results in compilation issues, since the default visualization mode is UNDERLINE, which uses ulem package for visual markup. The problem is that the compiler wants to pass the abstract also as metadata for the PDF file and of course it's impossible to apply \sout there, much like the problem described here:
https://tex.stackexchange.com/questions/268658/in-beamer-how-can-one-have-strikethrough-text-in-the-author-setting-defined-by

A possible workaround is to use CFONT mode, which only changes color (no strike-through or curly underline), but I personally find it confusing.

I suggest to implement a workaround allowing to display visual markup, but pass (or not) plain text to PDF:

\providecommand{\DIFadd}[1]{\protect\cbstart{\protect\color{blue}\texorpdfstring{\uwave{#1}}{#1}}\protect\cbend} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{\protect\cbdelete{\protect\color{red}\texorpdfstring{\sout{#1}}{}}\protect\cbdelete} %DIF PREAMBLE

Credits for the idea go to: https://tex.stackexchange.com/a/268967

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

No branches or pull requests

1 participant