0

I am collaborating on a book using bookdown and would like a simple way to track changes in the compiled version of the book (pdf or gitbook). I have used latexdiff in the past, but am not sure how to make it work w/ the default way that bookdown compiles the different chapters and then moves output to the _book directory.

On a related note, I have managed to use latexdiff from the latexdiffr R package to create a diff file for two .Rmd files (this works for specific chapters), but not for the full book. Unfortunately, I was unable to get git_latexdiff (in the same package) to work with previous commits contained on github (see error, below):

git_latexdiff("02-SettingTheStage.Rmd", "HEAD^")

fatal: Invalid object name ''HEAD^'.

Error in git_latexdiff("02-SettingTheStage.Rmd", "HEAD^") :

Could not check revision out of git.

In addition: Warning message:

In git_latexdiff("02-SettingTheStage.Rmd", "HEAD^") :

git show 'HEAD^:02-SettingTheStage.Rmd' returned 128

I am able to open a git-bash shell and view the previous commit by typing:

git show 'HEAD^:02-SettingTheStage.Rmd'

I'm relatively new to github, bash, etc and am working on a windows 10 machine, so maybe it is something really simple I am missing. I would be happy for any suggestions using latexdiff in the latexdiffr package or otherwise. Thanks! John

Community
  • 1
  • 1
ECOSTATS
  • 140
  • 6
  • Could you edit your question and paste the actual text of the error into the question please rather than a screenshot that's on your own dropbox as the screenshot will get deleted at some point and the question won't make sense anymore? – Nanhydrin Feb 19 '19 at 11:38
  • Thanks for the suggestion - I have edited the post to include the error message. – ECOSTATS Feb 19 '19 at 12:28
  • I've seen this example `git_latexdiff("my-file.Rmd", "HEAD~3")` to presumably compare the working directory copy to 3 commits ago. So if you're trying to compare to the current head, have you tried `git_latexdiff("my-file.Rmd", "HEAD~1")`? – Nanhydrin Feb 19 '19 at 12:45
  • Yes, this returns the exact same warning. – ECOSTATS Feb 19 '19 at 13:50

0 Answers0