This is a follow-up post to Polymode installation on Windows machine. Accordingly I installed polymode using this code in the init.el
file after ESS code:
(require 'poly-R)
(require 'poly-markdown)
(add-to-list 'auto-mode-alist '("\\.Rnw" . poly-noweb+r-mode))
This seems to work as polymode
(PM-Rnw) does appear in the minibuffer:
Now I want to weave this file using M-n w
and knitr
option, it prompts me then whether this is the master file:
When I hit RET
to accept the default (same file is master file), I get this message:
This indicates that a mwe_demo[weaved].tex
buffer has already been created and transferred to a project cache in projectile. But this buffer is empty and no such file was ever found in that path. So what am I missing here?
Update
the following message appears in the *polymode weave*
buffer:
weaving latex with command:
Rscript -e "library(knitr); knit('mwe_demo.Rnw', output='mwe_demo[weaved].tex')"
'Rscript' is not recognized as an internal or external command,
operable program or batch file.
So it seems that knitr
could not be loaded because of no recognized Rscript.exe
shell command. This means that it won't use the Rterm.exe
that I have this line of ESS installation in init.el
:
(setq-default inferior-R-program-name "C:/Program Files/R/R-3.1.2/bin/i386/Rterm.exe")
but how to make Rscript
recognized which I have it on this path C:/Program Files/R/R-3.1.2/bin/Rscript.exe
? I hope that was more explained in the documentation.
I ended up adding the above path to PATH variables Win + break
. It worked now and weaved into .tex
file. Now when I press M-x e/E
I get two candidates pdflatex|latexmk
how to extend that to include xelatex
, which is more useful in my case?
Updated Question
How to make polymode opt for xelatex
?
A similar case with Noweb
mode could be solved by M-x customize-group
as in this post: https://stackoverflow.com/a/28515366/1288722
Note
- The same file could be weaved successfully using the
Noweb
mode in ESS usingknitr
- Pandoc is already installed and in the PATH variable
M-x getenv RET PATH RET
- Windows 7 32 bit