6

I am writing a paper for the Journal of Statistical Software documenting my package. Their style files have some facilities for Sweave output but nothing for knitr. I imagine i would have to customise the knitrout environment.

I wanted to know if anybody (maybe better than me at knitr and Latex) has done it already or has any suggestions.

Many thanks, Marco

Marco Stamazza
  • 836
  • 9
  • 15
  • 3
    You may have to use `knitr` to produce latex output. The knitr [examples page](http://yihui.name/knitr/demo/minimal/) has instructions for doing this. See in particular this [example](https://github.com/yihui/knitr-examples/blob/master/005-latex.Rtex). – Andrie Jun 30 '14 at 07:50
  • 1
    If you want to use Rmarkdown, see the https://github.com/rstudio/rticles package which provides a JSS template. – hadley Jun 30 '14 at 14:46
  • Thanks for the suggestions. I am using knitr. What I wanted to know is how to reconcile jss.cls with knitr formatting, lie shaded code, etc. – Marco Stamazza Jul 12 '14 at 00:18

2 Answers2

5

render_sweave() renders knitr output in the Sweave default style which I think JSS expects. Also for JSS you need options(prompt="R> ")

Chris Jackson
  • 871
  • 5
  • 7
  • Thanks. I don't know about this as it would mean switching back to sweave. To be honest, I am beginning to dislike all this Sweave/knitr reproducible computing. I am trying to submit a package to CRAN and i just can't get the vignettes right. the paper copiles in R and check_vignettes gives no errors! It would take a fraction of the time to just submit the pdf. – Marco Stamazza Nov 09 '14 at 01:25
2

Can't you write your paper using Sweave and the use the Sweave2knitr function from the knitr-package to turn it into a knitr-file?

roming
  • 1,165
  • 1
  • 9
  • 22
  • That entirely defeats the purpose. Namely, to write in the lightweight knitr syntax rather than the rather heavy and unreadable Sweave syntax. – Konrad Rudolph Aug 15 '14 at 15:33
  • Well, actually I thought of creating something like a template of your final document using Sweave and the JSS style files (which I assumed where only for the Latex part of the document), then convert this template to knitr and fill in the content. – roming Aug 19 '14 at 07:51
  • Sure I could write a sweave version of it. It would just take more time. I am beginning to find it quite frustrating this coexistence of sweave and knitr. thank you for your comments. – Marco Stamazza Sep 07 '14 at 02:18