[ESS] Interaction with Sweave, knitr, pandoc, polymode et al.

Vincent Goulet vincent.goulet at me.com
Tue Apr 5 04:04:51 CEST 2016


> Le 4 avr. 2016 à 18:08, Vitalie Spinu <spinuvit at gmail.com> a écrit :
> 
> 
> 
>>> On Sun, Apr 03 2016 23:50, Vincent Goulet wrote:
> 
>> However, when .Rnw files are associated with poly-noweb+r-mode (from polymode)
>> as is the case in my distribution, the whole ESS and AUCTeX integration seems
>> to be disabled. I think this is unfortunate. 
> 
> Auctex exporter is not yet part of polymode exporters. It's trivial to add but
> it wasn't high priority because of the already in-place pdflatex and latexmk
> exporters that should fit most (all?) needs.

As mentioned in my original message, I like the way ESS works currently (with the AUCTeX backend) for the following reasons:

1. I use XeLaTeX for most of my projects now and ESS picks up that I set this engine on the AUCTeX side (mainly through a file variable).

2. Same keyboard shortcut as standard LaTeX documents: C-c C-c does everything.

3. No [woven] marker added to the file name. I like being (actually, I expect to be) able to go straight from .Rnw to .pdf without having to rename files along the way.

4. I had a case with polymode where trying a weave an UTF-8 encoded file had Sweave() complain about non-ascii encoding. I'm not sure whether this is consistent or not, though.

>> Enough to strongly consider removing the default association in my
>> distribution. 
> 
> Too late;) Polymode is very likely to be the default from next ESS release.

Ok, but then please don't override functionality that fits very well the workflow of old timers like me (!) who love Sweave but don't feel the need or are not interested to jump on the whole knitr/rmarkdown/org bandwagon.

>> If one wants to use the whole polymode approach for what I'd consider "pure"
>> Sweave files, one would need to opt-in via ~/.emacs.
> 
> Why exactly is that?

For the reasons stated above. 

>> However, rmarkdown::render() does look at this variable and relies on pandoc
>> being on the shell's path.
> 
>> If I don't want to install anything outside of the Emacs distribution tree
>> both on Windows and on OS X, do I have any way to configure rmardown or
>> polymode to use a version of pandoc that would be bundled with Emacs?
> 
> That's more of a question for rmarkdown developers. If possible you can side
> step it by putting pandoc that comes with your emacs distribution in the shell
> path. But I don't think you should bother with that at all. It might be better
> if users of Rmarkdown or polymode would install pandoc separately.

Agreed. I'm currently looking at providing indications and shortcuts to download Pandoc, but that's it.

> As for polymode and rmarkdown/pandoc integration, it is already there by default
> (since a month or so). "M-n e/E" inside .Rmd files should be providing the
> option to set the exproter to Rmarkdown, Rmarkdown-ESS or pandoc.

Yep! This is in my current distro released last week. Works very well, although at first it wasn't obvious to me what was the difference between the *-ESS and non-ESS options.

Is it possible to set the exporter and target format in file variables and forego these questions?

> A bunch of polymode UI improvements are in working. Most notably there will be a
> separate option for how to display some files (i.e. you might want to display
> PDF and HTML files outside emacs).

Good thing. I'd expect the behaviour to be the same as with AUCTeX, here.

> With this addition and Auctex integration I
> don't see what else polymode weaving/exporting would lack as compared to current
> non-generic ess-noweb framework.

I'm looking forward to test all this.

Thanks Vitalie!

v.

> Vitalie



More information about the ESS-help mailing list