Sweave on MacOSX
Because it took me a while to figure this all out, I thought I would post it. The aim here is to create Sweave files in TeXShop with the ability to compile to a pdf in one click (or command-T [can't figure out how to insert the command symbol]). Here's what I did mainly thanks to Aaron Rendahl.
blog comments powered by Disqus
- Save Sweave.sh into ~/Library/TeXShop/bin
- In terminal, type `chmod +x ~/Library/TeXShop/bin/Sweave.sh
- Create ~/Library/TeXShop/Engines/Sweave.engine with the following content:
#!/bin/bash ~/Library/TeXShop/bin/Sweave.sh -ld "$1"
- In terminal, type `chmod +x ~/Library/TeXShop/Engines/Sweave.engine'
#!/bin/bash ~/Library/TeXShop/bin/Sweave.sh -nc -ld "$1"and in terminal typing `chmod +x ~/Library/TeXShop/Engines/SweaveNoClean.engine'. Now, if you don't want to include Sweave.sty in every directory where you are creating a Sweave document, just do the following obtained from here:
- In terminal type, `mkdir -p ~/Library/texmf/tex/latex'
- In terminal type, `cd ~/Library/texmf/tex/latex'
- In terminal type, `ln -s /Library/Frameworks/R.framework/Resources/share/texmf Sweave'
blog comments powered by Disqus