Let's say my work-flow is writing a paper with multiple R chunks as a .Rnw then compiling it into a .tex file and then typesetting it into the final document.

Now, after the document has been compiled into a TeX file I usually like to do my edits directly in there, without going back to the source .Rnw. But then if at some point I need to recompile the whole TeX file (let's say my data has changed) I need to painstakingly check for all the differences between the texts of the two versions.

Problem is that simply comparing the two files (i.e. M-x diff in Emacs) will return too many differences to be useful.

Would it be possible to check and automatically update only the text of the .Rnw file excluding all the markups and chunks?

  • That will be difficult. I'd recommend working with the real source file, i.e. .Rnw, since .tex is a derived and intermediate output file. It is not easy to go back. – Yihui Xie May 7 '14 at 23:27
  • I am facing the same problem, but have a different solution in mind which may help you (if I can get help figuring it out): tex.stackexchange.com/questions/256936/… – mikeck Jul 25 '15 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.