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

Latexrevise removes lines with %DIFAUXCMD #302

Open
Ivo-Maffei opened this issue May 23, 2024 · 2 comments
Open

Latexrevise removes lines with %DIFAUXCMD #302

Ivo-Maffei opened this issue May 23, 2024 · 2 comments

Comments

@Ivo-Maffei
Copy link

Using latexrevise 1.3.2 and latexdiff 1.3.3 gives some weird behaviours in the presence of \cite{} commands.
I believe latexrevise simply removes all rows where %DIFAUXCMD appears.

Very minimal example:
test-old.tex
aaa ccc

test-new.tex
aaa \cite{ddd} ccc

latexdiff test-old.tex test-new.tex > test-diff.tex produces test-diff.tex

aaa \DIFaddbegin \DIFadd{\mbox{%DIFAUXCMD
\cite{ddd} }\hskip0pt%DIFAUXCMD
}\DIFaddend ccc

latexrevise -a test-diff.tex outputs only ccc as if the rows with %DIFAUXCMD were simply deleted.
Manually changing the diff file by adding a new line after aaa makes latexrevise output

aaa
ccc

P.S: adding a preamble to the tex files so that they compile doesn't change the behaviour.

@ftilmann
Copy link
Owner

Thank you for your comment. Deleting lines marked with %DIFAUXCMD is generally described behaviour but in this situation obviously doesn't do the right thing, as unlike the original design principles the %DIFAUXCMD is on the same line as a valid command to be retained.
I had become a bit sloppy with regard to this as I had the impression that hardly anyone is using latexrevise (myself included). I will eventually have a look if there is a quick fix to your specific scenario, and will keep the issue open for that purpose.
As I cannot give a time scale for this, as an (unsatisfactory) workaround, you can use the --disable-citation-markup option, which should solve this problem, but means that citation commands are simply not marked up. That may be acceptable when preparing a file for processing with latexrevise. Or choose another markup style without need for the ulem package (e.g CFONT if memory serves correctly)
If others meet the same or related issues, please let me know so I know there is interest in latexrevise.

@TaihuLight
Copy link

TaihuLight commented Jun 2, 2024

@ftilmann
As described in https://www.overleaf.com/learn/latex/Articles/How_to_use_latexdiff_on_Overleaf#Tom_Hejda, the deleted text is kept in the sections of title and authors when I use $pdflatex = "latexdiff --no-del --type=CFONT main.tex main2.tex > main-d.tex; pdflatex %O main-d" , adding the option --no-del --type=CFONT into the method of David Carlisle’s solution.
I want to use the option --no-del to remove all deleted text in a manuscript, including detected text in the sections of title and authors (the result should be similar to BOLD), rather than only removing deleted text in the manuscript body.
How do we fix this issue? or is this a bug of the option --no-del --type=CFONT?
@Ivo-Maffei

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

No branches or pull requests

3 participants