knitr is an R package for dynamic report generation based on the concept of literate programming.

learn more… | top users | synonyms

9
votes
4answers
2k views

knitr and biblatex

I'd like to create a PDF report with knitr with LaTeX-code in RStudio with biblatex for citations. However, the in-text-citations are always undefined and no bibliography is printed. The same ...
9
votes
2answers
898 views

Building TeX file from knitr Rnw as child of larger parent TeX file to use R objects and output

Here's my general problem: I'm writing my dissertation using a LaTeX template (http://www.latextemplates.com/template/masters-doctoral-thesis). The template is a parent file with multiple chapters as ...
2
votes
1answer
373 views

Command that gobbles all following empty lines

One distinction between knitr and Sweave is that the former forcibly inserts two empty lines in the generated TeX source for chunks that do not do any output. I'm not sure if this issue is a bug or a ...
7
votes
1answer
301 views

Best Practice for nice layout with tikzDevice

R+tikDevice+LaTex+knitr is (as I understand it) the most efficient way to get relly nice looking publications from R, with maximum layout-support from LaTeX. I'm using R+LaTex+knitr now, but would ...
8
votes
2answers
819 views

tikzDevice is not getting sizes right (knitr)

I am using OSX, pdflatex, R (cran), tikz/tikzDevice and knitr to create my documents. My problem is that the font sizes of the produced tikZ-file do not match the LaTeX document font sizes. Result / ...
2
votes
1answer
378 views

Is it possible to \include a .TeX file compiled from .Rnw?

I have a document with this structure: main.TeX which (ideally) includes bodytext.TeX compiled with knitr from bodytext.Rnw. I say ideally because apparently it is not that simple. I noted that ...
2
votes
1answer
310 views

How to remove the blank page when omitting comments and messages in knitr

I am using the following code to create a plot, I want to omit message, comments and warnings and everything else but the plot. \documentclass{article} \usepackage{pdflscape} \pagestyle{empty} ...
10
votes
0answers
132 views

How to write an arara rule for knitr

I've been trying to write a rule for invoking knitr via arara, but I don't seem to know what I'm doing, apparently. The arara manual explains how to define custom rules. To do so, it is necessary to ...
7
votes
1answer
968 views

How to build Knitr document from the command line

I would like to compile a knitr document from the command line. With Sweave, the sequence R CMD Sweave my_sweave_file.Rnw latex my_sweave_file.tex latex my_sweave_file.tex dvips my_sweave_file.dvi ...
2
votes
1answer
848 views

knitr with TeXworks

There is a great piece on Yihui's site about using knitr with TeXShop. Taking some time for some self indulgent curiosity here. Is there a way to use knitr as an engine in TeXworks?
4
votes
1answer
145 views

Insert a TeX file created with knitr into a main TeX file [duplicate]

I want to insert a knitr output file (created in RStudio as .rnw file, then I compiled, it creates the .tex file) into my main .tex file. But I got an error, how we can do this? Knitter Tex file: ...
3
votes
1answer
262 views

Is there a PythonTex equivalent to \Sexpr{} in R?

I started to use the excellent PythonTex package to write reproducible reports but can't seem to get it to evaluate Python code inside a LaTeX command. R has Sweave & knitr which provide the ...
3
votes
1answer
152 views

Knitr and tikzDevice not working together with article options

I have a problem with knitr and tikzDevice, like someone before me. (See tikzDevice is not getting sizes right (knitr) .) He used dev.args to get rid of this error, but if I run this code through ...
2
votes
1answer
205 views

siunitx error: “invalid-number” from R

I have a document in .Rnw which I use to produce a .texdocument with kntir. I have a problem with the formula \num{\Sexpr{max(degree)}} which in R console produce 12598 but after the running knitr in ...
2
votes
1answer
114 views

How to escape inline R command to avoid issue with “while-typing” spelling check

I have a problem with my text editor Aquamacs Emacs (GNU Emacs 23.4.1) when use it with \Sexpr to print inline the output from R functions. The problem results when the R command includes special ...
2
votes
1answer
326 views

Adding a knitr table from R into a \pgfplotstableread statement

I'm trying to get a table from R into a pgfplotstable to edit for printing. the r code is \documentclass{article} \usepackage{pgfplotstable} \begin{document} \pgfplotstableread[format=inline,row ...
2
votes
1answer
223 views

Rstudio output in Hebrew

(Follow-up to Making LaTeX documents with Hebrew? (in Sweave + RStudio)) Trying to reproduce the above answer, I followed these instructions without success, under Windows 7. The best result I got ...
1
vote
0answers
166 views

Clash between knitr, tikzDevice and pgfplotstable

I use knitr to compile a document composed of two .Rnw. Please considered the following examples from this answer main.Rnw % !Rnw weave = knitr % !TeX program = pdfLaTeX ...
1
vote
1answer
423 views

How to debug if Knitr quits unexpectedly when composing tikz figure

I have a .Rnw file that Knitr used to compile perfectly fine until my backend dataset changed. Probably then the size of the graph changed also. For reasons I don't understand knitr now stops abruptly ...