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

WIP: Add git latexdiff script #251

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tylerjereddy
Copy link
Contributor

@tylerjereddy tylerjereddy commented Sep 17, 2019

Fixes #249 but work in progress using git-latexdiff

Here's an early draft of the paper_diff.pdf that shows up in a temporary directory created by latexdiff when using the script in this PR, but I think I still have issues:

  • getting the -o flag to actually dump the PDF in a chosen working directory (I think this may be related to some compile errors)
  • getting the diff to work on the bibliography (latexdiff seems to struggle with the nested style file hierarchy, maybe)

We may want to touch up the styling a bit too.

@tylerjereddy
Copy link
Contributor Author

I've not had much luck after a few hours of messing around to get the diff to work on the reference list as well. Perhaps those recommending the git-latexdiff/ similar tools (@ev-br / @jarrodmillman ) want to take a look?

The body of the text has an ok diff though.

@ev-br
Copy link
Member

ev-br commented Sep 18, 2019

@tylerjereddy
Copy link
Contributor Author

I saw that, but I don't really get it, since there is support for reference diffing in the help for git-latexdiff. Maybe it is broken for more complex projects. If we need to string together a script with several commands feel free to give that a go!

@ev-br
Copy link
Member

ev-br commented Sep 18, 2019

(am on the phone ATM, sorry). Can you try --bbl option?
https://gitlab.com/git-latexdiff/git-latexdiff/issues/14

@tylerjereddy
Copy link
Contributor Author

I tried --bbl, bibtex, and various other options listed in the help related to bibtex. I also had to copy our specific style files to an appropriate system path, possibly because git-latexdiff uses a tempdir.

I think this may take some effort to resolve. Perhaps someone will just run a separate command for the references when we are ready to resubmit, which is hopefully soon.

@jarrodmillman
Copy link
Member

The effort to track this down is not worth it. Reviewers will only care about the differences to the text body. I would just mention that the changes to the bibliography aren't color coded due to technical issues and leave it at that. However, I didn't see the actual reviews. If one of the reviewers specifically asked for a reference to be added, removed, or modified, you should just mention that the modification where made (or not and why) in the "rebuttal" letter.

@tylerjereddy
Copy link
Contributor Author

The effort to track this down is not worth it.

Right, that's what I thought--this actually seems like a pretty nasty thing.

@tylerjereddy tylerjereddy mentioned this pull request Sep 19, 2019
@mdhaber
Copy link
Contributor

mdhaber commented Sep 19, 2019

I don't think we got any comments about references.
@tylerjereddy Does Table 1 in the latexdiff output still extend beyond the edge of the page?
I will manually indicate changes to the bibliography if need be. I'm not sure that we can claim technical difficulties. Chances are that most authors (who are not necessarily TeX-savvy) will manually indicate changes, and there are no technical hurdles for doing that.
Along those lines - Tyler, do you have the .bbl file (or commit number) of the version originally submitted to Nature Methods? I can use git to find the diff compared to today.

@tylerjereddy
Copy link
Contributor Author

tylerjereddy commented Sep 19, 2019

Does Table 1 in the latexdiff output still extend beyond the edge of the page?

Yes, I think so. I didn't really try to adjust the formatting, I just tried to get the references working so I think what you see in this PR is still what we will end up with barring any further modifications.

do you have the .bbl file (or commit number) of the version originally submitted to Nature Methods? I can use git to find the diff compared to today.

We have a git hash used in this PR for the comparison--that's an estimate based on submission date, but should be pretty close & sufficient to regenerate the bbl?

I will manually indicate changes to the bibliography if need be.

Well, I guess I can do that... we need reliable tools for this stuff eventually. That's why I originally suggested using a highlight markup when we made the changes... Off the top of my head, there's the Open Hub citation, the new citation to the Nature News article about CI, and a citation from a test-driven development textbook added.

Still we are currently 2 to 1 for core devs in favor of basically claiming the diff doesn't work so well for the references & those ones I mention are the main ones I think so just mentioning those may be sufficient.

@tylerjereddy
Copy link
Contributor Author

Chances are that most authors (who are not necessarily TeX-savvy) will manually indicate changes, and there are no technical hurdles for doing that.

Sure there are, I doubt the manual approach is completely immune to forgetting to highlight changes, especially on big multi-author papers with Microsoft Word & track / accept changes.

@mdhaber
Copy link
Contributor

mdhaber commented Sep 19, 2019

I don't actually think that the reviewers would miss the highlighting in the bibliography; I would just prefer not to appear lazy to the reviewers. Anyway, I have the diffs; it's just a matter of adding lines in the final pdf. I'm happy to do it, unless there is opposition to that. Just give me a few minutes with the PDF before it's submitted and it's an easy fix.

@tylerjereddy
Copy link
Contributor Author

The key here was to add --append-safecmd=cmd1,cmd2 where the cmd values are appropriate bibtex commands, when using latexdiff. Unfortunately, I spent a few hours trying to do it manually before I discovered that.

see: https://github.com/tylerjereddy/nmeth_resubmit

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

Successfully merging this pull request may close these issues.

Underline Changes since initial submission
4 participants