I want to find a programmatic way of converting a .tex latex document to pdf.
What I usually do, and this works in most cases, is to use:
tools::texi2dvi(latexfile, pdf = TRUE, clean = TRUE)
However, I now need to work with documents that contain Asian fonts (Chinese, Japanese and Korean). Searching on tex.stackexchange.com leads to advice to incude the following lines in the tex file:
\usepackage{xeCJK}
\setCJKmainfont{MS Mincho} % for \rmfamily
This means I need to use xelatex to build the pdf. I have tried variations on the following theme, none of which work.
shell(cmd="xelatex latexfile", mustWork=TRUE, translate=TRUE)
Question: How can I call xelatex programmatically?
Additional information:
- I am on Windows 7, R2.13-1
xelatexis installed on my machine and works fine if I call it any other way (including via the command line)- I am using StatET in Eclipse
--engine=ENGINEoption. So you could call it directly throughshell– Sep 27 '11 at 11:24