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

learn more… | top users | synonyms

4
votes
1answer
1k views

no tex installation detected on RStudio after OS X 10.10 yosemite upgrade

I upgraded my MAC to OS X 10.10 yosemite today. Now, when I run RStudio and try to use Knitr to compile pdf, it says no text installation detected. So, I did the following steps sequentially. ...
4
votes
1answer
417 views

Color first row in a xtable generated table

I am trying to color the FIRST row of my table. But if I add \rowcolor[gray]{0.95} to the FIRST row the colored row will be the SECOND. Indeed it is quite straight forward to modify from the second ...
10
votes
0answers
192 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
0answers
770 views

knitr & xcolor: incompatible color definition

I'm using knitr and RStudio to compile LaTeX. In my real project I'd like to use some options from the LaTeX package 'xcolor', but when I do include \usepackage[options]xcolor, I get the error message ...
6
votes
0answers
287 views

Arguments of R Functions in Beamer with knitr

I'm using helpExtract.R function (can be obtained from here) to get arguments of R functions in Beamer with knitr. My (.Rnw) MWE is \documentclass{beamer} \usepackage{ragged2e} %new code ...
4
votes
0answers
433 views

How to keep ggplot font size constant when varying figure width

I have different figures across my document with different width. I set the the font size for all ggplots globally with theme_set(theme_bw() + theme(text=element_text(family="Palatino", size=20))) but ...
4
votes
0answers
114 views

How to mantain consisten font size in different plots

I usually embed numerous R plots in my TeX documents. knitr is very handy in helping me producing plots using the same font family of the TeX document. But a different problem of consistency is given ...
3
votes
0answers
105 views

tikz stops drawing into pdf after 20 line segments in plot generated through knitr tikzDevice

Problem If I try to draw a curve generated through knitr using tikzDevice into .pdf only 20 line segments of that curve are drawn and TeXstudio, through which I do it, just leaves message running ...
3
votes
0answers
66 views

Sub-figures in multiple pages but with one figure caption and showing “continued on next page”

The below code (together with Knitr package in R) creates figures on 3 pages under one caption of "Figure 1: Lots of figure". What I want to have is something like "footer" underneath figures in ...
3
votes
0answers
152 views

Using subcaption package with knitr

How can I use subcaption package in knitr, instead of the obsolete subfig and \subfloat? Or, maybe, specify additional options with fig.env = 'subfigure'? It needed something like this: ...
2
votes
0answers
35 views

Use of environ package with knitr

I'm working on a knitr document and trying to place knitr output inside of a new environment defined using the environ package. The example below illustrates the problem. With a traditional LaTeX ...
2
votes
0answers
92 views

knitr: Several figures with subcaptions, alignment issues

Here is a minimal working example: \documentclass{article} \usepackage{subfig} \begin{document} <<echo=FALSE,out.width="0.49\\linewidth",fig.show="hold",fig.align="center",fig.cap="Some ...
2
votes
0answers
66 views

knitr pdf search invisible text

I use the fantastic knitr to generate beamer-pdf’s with hundreds of slides of plots. Every plot shows data of different measuring equipment, so for example the plot showing result of measuring ...
1
vote
0answers
55 views

How can I show a caption, subcaption and source similar to this NY Times style?

I would like to create a LaTeX document that mimics the style used on the NY Times' Upshot Blog (example at NY Times). Here is the desired output: They have these features: A thin gray line ...
1
vote
0answers
29 views

How to include a .TeX file generated from .Rnw file into a .TeX file which is child of parent .TeX file?

I really need help. Here is the 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 ...
1
vote
0answers
37 views

Force Knitr Figure on same page

I am using Knitr on RStudio. <<glmall, include=TRUE, fig.align='center', fig.cap='Diagnostics plots for full-model with GLM (Poission)', fig.show='asis'>>= par(mfrow=c(2,2)) ...
1
vote
0answers
115 views

Sweave and Knitr Figure Size

I recently made the switch from using Sweave to Knitr in order to gain Knitr's ability to cache R code chunks. So far its been fairly straightforward except for one thing. I cannot seem to find an ...
1
vote
0answers
55 views

Setting LaTeX => PS => PDF in RStudio

I am using RStudio, with knitr, and want to use Lodewyckx's graphicalmodels.sty for graphs. It requires changing output profile to LaTeX to PS to PDF. Can this be done in RStudio still using knitr?
1
vote
0answers
101 views

Best practice for ggplot transparency in pdf figures

I lost a couple of hours because of few transparent figures which Adobe Professional couldn't flatten to print (it crashed in the process). I wonder if there's any trick to produce PDF figures with ...
1
vote
0answers
105 views

Control stargazer table output in combination with mathpazo and siunitx

I like the idea to control all my numeric outputs with the smallest number possible of packages. I use mathpazo to control my fonts and siunitx to control formatting. Yet when I knit a LaTeX table ...
1
vote
0answers
74 views

Knitr and numbers

I return to a question, which is few months old and then maybe not yet the best practice around. I use the siunitx package in my documents along with knitr to compile my R chunks. As far as I ...
1
vote
0answers
65 views

caption above figure using knitr

This is a question originally asked on stackoverflow, but it seems to receive no attention and answers there. Since it's related to latex, I'm posting it also here hoping to receive some hints. I ...
1
vote
0answers
84 views

Error R Sweave and Knitr Plugins at WinEdt 8.0?

I try a simple example document .rnw at WinEdt with R Sweave Plugin like this : \documentclass{article} \begin{document} \SweaveOpts{concordance=TRUE} \textbf{hello world} ...
1
vote
0answers
51 views

How to export changes from a .tex file back to the source .Rnw file

Let's say my work-flow is writing a paper with multiple R chunks as a .Rnw then compiling it into a .tex file and then typesetting it into the final document. Now, after the document has been ...
1
vote
0answers
158 views

How do I add a caption to a table within a minipage?

I am using Knitr to generate two tables side by side on a two column layout (ACM sigproc). \begin{table*} \begin{minipage}[h]{0.49\linewidth} <<results='asis'>>= ...
1
vote
0answers
112 views

Is it a known bug with the animate package?

In slide 10 here, I have embedded three animations in only one slide. You can see there's a bug by playing with the animations, is it a known bug ? Or is there something special to do in the code for ...
1
vote
0answers
190 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
0answers
161 views

Knitr/LaTeX: conditional execution based on external parameters

I'm using knitr to create LaTeX documents with integrated R code. Now I'd like to readout some external parameters (saved in a TXT or CSV file) and create a document based on the conditions specified ...
0
votes
0answers
37 views

bibliography is not printed (using knitr, biblatex, backend = bibtex and \nocite{*})

I am trying to include a list of publications into my CV, using knitr in RStudio. \documentclass{article} \usepackage[backend=bibtex]{biblatex} \begin{filecontents}{my-publications.bib} ...
0
votes
0answers
50 views

How can I nest a code chunk within an enumerate environment when using R Markdown?

When I attempt to do this using this code: --- title: "Title" author: "Me" date: "31 October 2014" output: pdf_document: includes: in_header: includes.sty --- ...
0
votes
0answers
27 views

LaTeX keeps placing floats above section headlines

I followed the accepted answer to the question on how to Start new page with each section but LaTeX still puts a float object on the top of a page, above the section headline. Instead, I want this ...
0
votes
0answers
58 views

Problem with in-text figure references in APA-style manuscript with Knitr

I'm having trouble getting a Knitr documents figure references to work in an APA style manuscript. I have looked around, but I haven't seen anything that references this problem specifically. When ...
0
votes
0answers
96 views

Custom chunk hooks in knitr

[Cross-posted from SO] I am trying to create a chunk hook that can produce a \floatfoot{} as part of the output from a chunk. Hopefully the following example makes clear what I am trying to achieve: ...
0
votes
0answers
89 views

Make .Rnw child document independent from main document

This is a followed-up question to this answer. I have a variables.Rnw document in charge with the task of loading data from R datafiles and create R variables that I will then compile into a .tex ...
0
votes
0answers
52 views

Is it possible to place a chunk within a chunk?

I am asking this question because I need to loop a \section tile by a chunk and place the according result in the section using another chunk. Here is an example of one circle: The chunk for ...
0
votes
0answers
193 views

knitr yielding different output in pdf than in R console

I am running RStudio Version 0.98.484 and R version 3.0.2 on OS X Mavericks. While using knitr I noticed a discrepancy between the console output from a summary() command and that generated in the ...