Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When working with a knitr file (RNW document) on Kile the document structure isn't shown in the structure view, even though it contains a valid LaTeX structure of parts, sections etc. If I change the file suffix into .tex then the structure is shown, but it's a bad idea because I need to compile it later into a real LaTeX document. Is there any way to trick Kile into showing the structure of an RNW file?

share|improve this question
I'm not using kile, but please what do you mean with RNW? Could you add it in your question? – Kurt Jan 25 at 11:13
RNW files are the ones used by knitr to weave R code chunks into a LaTeX document. – Roey Angel Jan 25 at 11:18

1 Answer

You can search for Kile in the documentation for editors and follow the instructions: http://yihui.name/knitr/demo/editors/

share|improve this answer
I know Marek's website, but his instructions refer only to how to add the knitting command to Kiles build options and for opening and saving but that doesn't make kile read the file structure. – Roey Angel Jan 28 at 9:42
@RoeyAngel OK, I thought the bullet point 2 Automatic syntax highlighting of .Rnw sources should help; sounds like it does not. I do not use Kile, so I do not really know... – Yihui Jan 28 at 17:45
I think, but not sure, that Automatic syntax highlighting of .Rnw sources makes kile highlight the LaTeX part of the document (but not the R parts) and it also doesn't detect the structure. My new workaround for the structure issue is to save the .rnw document with a .ltx instead (which kile recognizes). – Roey Angel Jan 28 at 22:27
@RoeyAngel I imagine it is not trivial for Kile to support syntax highlighting for both LaTeX and R in the Rnw document, but you can file a feature request to the developers anyway. – Yihui Jan 29 at 1:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.