Open adibender opened 5 years ago
It would be a bit tricky, for instance, consider that TEX root could be also a Sweave file.
I know that this is an old post but the following settings get the job done:
Create a custom ride_exec command where you replace the standard '$file_name' with your main file. In my case it is index.Rnw. This can be done in the R-IDE settings.
{ "caption": "Knit Rnw Index", "cmd": "knitr::knit2pdf('index.Rnw',compiler = 'xelatex')", "working_dir": "$file_path", "selector": "text.tex.latex.rsweave" }
You can also create a keybinding for this command that only works for rsweave
{"keys": ["ctrl+alt+b"], "command": "ride_exec", "args": {"cmd": "knitr::knit2pdf('index.Rnw',compiler = 'xelatex')", "selector": "text.tex.latex.rsweave", "working_dir": "$file_path"}, "context": [ { "key": "selector", "operator": "equal", "operand": "text.tex.latex.rsweave" } ]}
But cmd/ctrl+b let's you also choose resp. just uses the command created above. So I just use that.
Hope that helps.
LaTeXTools: allows to place something like
%!TEX root = main.tex
at the top of a.tex
file that is included inmain.tex
and when the build is triggered,main.tex
is build instead of the child document. It would be nice to have similar feature for.Rnw
(and.Rmd
) files.