RStudio, BibTex, and LaTeX
[This article was first published on Data, Evidence, and Policy - Jared Knowles, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I was having a little trouble getting RStudio to process BibTex entries and compile a LaTeX file. Bumping around on the great RStudio help forum, I found this entry, which pointed me in the direction. I needed to set a system environment variable in R to let RStudio and R know where to look for the proper BibTex style, LaTeX input, and BIB input files. I have put up a little Gist on GitHub that shows how I got it done, since I had never messed with R Environment variables before.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Set Environment Variables | |
TEXINPUTS="C:\\" #Path to tex file in Windows | |
Sys.setenv(TEXINPUTS="C:\\~", BIBINPUTS=TEXINPUTS,BSTINPUTS=TEXINPUTS) | |
#Path to texfiles in Windows, set BIB files and BST files the same | |
#Run before clicking "Compile PDF" |
To leave a comment for the author, please follow the link and comment on their blog: Data, Evidence, and Policy - Jared Knowles.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.