I am having trouble understanding an answer to a previous question I asked here on stackoverflow located at:
More efficient R / Sweave / TeXShop work-flow?
The answer in particular is from user: las3rjock who suggests creating a "makefile" and running the makefile to automate compilation of a .Rnw in R (Sweave) and then in LaTeX. I don't know what a makefile is, or how to use it in Terminal (?) on Mac OS X. My internet searching has returned things above my knowledge level. I guess I need some hand holding to create and run a makefile.
Could anyone give "dummy" instructions on how to create a makefile to run Sweave / LaTeX, or more to the point, utilize the answer from las3rjock in the previous question? Thank you!
To specify a number of files with various paths and to save this information for multiple compilations, you can use a makefile. On Linux and Mac OS systems: To use a makefile to compile your input files, make sure that /usr/bin and /usr/local/bin are in your path.
The make utility requires a file, Makefile (or makefile ), which defines set of tasks to be executed. You may have used make to compile a program from source code. Most open source projects use make to compile a final executable binary, which can then be installed using make install .
$@ is the name of the target being generated, and $< the first prerequisite (usually a source file). You can find a list of all these special variables in the GNU Make manual.
I wrote a post with links on getting started with makefiles for Sweave.
From the post:
I also posted four sample Sweave documents. Each one has full source code available on github. Each one uses a makefile. In the first two tutorials, details of the makefile are described:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With