Using knitr with TeXShop

Using guidance provided here, I created a file with the following contents

#!/bin/bash
Rscript -e "library(knitr); knit('$1')"
pdflatex "${1%.*}"

and saved it as ~/Library/TeXShop/Engines/Knitr.engine.

Note that both Rscript and pdflatex are on my path, so I did not include anything for the PATH variable.

I then (following a tip from here) changed permissions on the file (otherwise I got some error message about “bit set”) as follows:

chmod +x ~/Library/TeXShop/Engines/Knitr.engine
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s