Diff TeX, 'rmarkdown' or 'quarto' Files Using the 'latexdiff' Utility

Produces a PDF diff of two 'rmarkdown', 'quarto', Sweave or TeX files, using the external 'latexdiff' utility.


latexdiffr

CRAN status R-CMD-check Coverage status

latexdiffr is a small library that uses the latexdiff command to create a diff of two Rmarkdown, .Rnw or TeX files.

Installation

remotes::install_github("hughjonesd/latexdiffr")

You will also need latexdiff installed on your system:

# on MacOS:
brew install latexdiff

# on Linux:
sudo apt install latexdiff 

# with tinytex
Rscript -e "tinytex::tlmgr_install('latexdiff')"

Example

library(latexdiffr)
# tinytex::tlmgr_path("add")
latexdiff("file1.Rmd", "file2.Rmd")

This produces output like:

latexdiff screenshot

git_latexdiff() allows you to compare different revisions of a file in git:

# 3 revisions ago:
git_latexdiff("my-file.Rmd", "HEAD~3") 

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("latexdiffr")

0.2.0 by David Hugh-Jones, 3 years ago


https://github.com/hughjonesd/latexdiffr


Report a bug at https://github.com/hughjonesd/latexdiffr/issues


Browse source code at https://github.com/cran/latexdiffr


Authors: David Hugh-Jones [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports assertthat, fs, rprojroot

Suggests tinytex, rmarkdown, knitr, quarto, testthat, covr

System requirements: latexdiff


See at CRAN