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

learn more… | top users | synonyms

3
votes
0answers
406 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. ...
0
votes
0answers
22 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 ...
1
vote
0answers
46 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 ...
2
votes
0answers
46 views

How to print a table and figure side-by-side in knitr

I see a lot of posts on putting figures side by side with tables without knitr, and posts about putting tables next to tables and figures next to figures in knitr, but nothing on how to put a figure ...
2
votes
1answer
51 views

row and column specifications in xtable output

Using xtable I am trying to format a table x<- 1:5 y<- 11:15 mytable <- table(x,y) print(xtable(mytable)) Which gives I want to add x and y tag also at the top of the rows and sides
1
vote
1answer
246 views

Knitr and rmarkdown will not add figure captions to the output

I am writing a report on Rmarkdown and knitr using RStudio, and cannot find a way to get figure captions on my document. My code for the chunk where I try to plot is like: ```{r ...
1
vote
0answers
39 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?
3
votes
2answers
92 views

knitr sanitises the % marker for LaTex comments and they show up in the final document

I am writing a knitr document using xtable to get my tables. Xtable inserts by default a comment saying: "latex table generated in R 3.1.0 by stable 1.7-3 package % Thu Sep 18 14:19:21 2014" This ...
1
vote
1answer
28 views

fragile/verbatim R code inside probsoln when using an exterior Rnw file for the data sets

A follow-up on this question about using R code inside the environments used in probsoln package. If you uncomment out the section below and define the problem within the main Rnw file, the R code is ...
2
votes
1answer
451 views

No TeX installation detected. Please install TeX before compiling - RStudio Knitr on Mac [closed]

I have tried to reinstall the MacTex twice. I even reinstall R and RStudio. Nothing could cure this problem. Please Help me, I'm in middle of my thesis and I need to use Knitr and RStudio is only easy ...
1
vote
0answers
60 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 ...
2
votes
0answers
28 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 ...
1
vote
1answer
32 views

Justifying the output of toLatex function of utils R package

Using utils::toLatex(sessionInfo()) in .Rnw we can get R Session Info to put in LaTeX. I would highly appreciate if someone guide me to fully justify the output of utils::toLatex(sessionInfo()). ...
0
votes
0answers
23 views

How to 'Go to Source' for a .Rnw file with knitr on TexStudio

So, I am TeXStudio and R on Windows 8 and have configured with knitr as follows: "C:\Program Files\R\R-3.0.3\bin\Rscript" -e "library(knitr, lib.loc='C:/Users/User/Documents/R/win-library/3.0'); ...
5
votes
1answer
106 views

minitoc package adds extra page when used with float and lastpage packages

The minitoc package adds extra page when used with float and lastpage packages. I figured out that this problem can be resolved by loading minitoc package before float and lastpage packages. In LyX ...
2
votes
1answer
80 views

Avoid R output leaking into LaTeX with ggnet

Please consider the following MWE which I compile into a .tex document via knitr \documentclass{article} \begin{document} <<echo=FALSE, message=FALSE, warning=FALSE>>= library(igraph) ...
0
votes
0answers
41 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 ...
3
votes
1answer
105 views

R Chunk Code within Enumeration Environment with knitr in LyX

I need R Chunk Code within Enumeration Environment in Rnw file. The following .Rnw document works fine. \documentclass{article} \begin{document} \begin{enumerate} \item The quick brown fox jumps ...
1
vote
0answers
69 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 ...
2
votes
0answers
73 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 ...
1
vote
0answers
57 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 ...
3
votes
0answers
54 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 ...
2
votes
1answer
74 views

Memory issue when producing dense TikZ figure (14500 points scatterplot) with knitr

I have a series of plots in my document which are correctly drawn by knitr with dev=tikz. Yet figure number 7, which is much more dense than the others in terms of data points, foo, doesn't: label: ...
1
vote
0answers
44 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
1answer
72 views

Cross-referencing tables generated by xtable

I'd like to cross-reference a table that I generated with xtable in R. I cannot able to. Here is what I did: \documentclass{article} \begin{document} Look at \ref{tab:mytable}. ...
2
votes
2answers
108 views

How does one set document class options (e.g. paper size) for LaTeX output?

The header option lets you insert TeX code in the preamble after \documentclass{article}, but what if I want to change the default paper size or the default font size? For this, I would need to ...
1
vote
1answer
74 views

Colouring cells of tables without xcolor

Are there any decent alternatives to xcolor if I want to colour cells in a table? I want to highlight certain cells depending on my data, but not entire rows or columns. I'm using Knitr and am having ...
1
vote
0answers
66 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} ...
0
votes
1answer
80 views

Any LaTex-based software for beginners? [duplicate]

I want to learn LaTex language so I can format and use that to compile a nice pdf with descriptive statistics using Knitr in RStudio. Any recommendation?
2
votes
0answers
156 views

Configure R Studio to use Biber for APA on Beamer Slides (Biblatex + Biber + R Studio + MiKTeX)

I'm trying to generate with R Studio a beamer presentation that uses backend=biber option. Here is my MWE: \documentclass{beamer} \usepackage[american]{babel} \usepackage{csquotes} %apa requires ...
4
votes
1answer
177 views

Using knitr, beamer, and /foreach to produce unique section titles in pdf from R string variable

Using R, knitr, and beamer, I have created a pdf that contains a graph for each school in our district. I read in each graph using the \includegraphics command within a /foreach loop. I want to ...
3
votes
1answer
75 views

Strange Knitr behavior with APA6 class manuscript

I tried everything that I know to solve this problem. I normally write my homework on share latex, but for this I downloaded and installed MacTex, Sweave and Knitr on my Mac. After trying out every ...
2
votes
1answer
53 views

Latex ifFileExist

\subsection{Checksum: Factor, Specific, and Total Variance} Perhaps the most basic test of a regression model is if the factor and specific variances sum to equal the total variance. Here, we ...
4
votes
3answers
100 views

knitr. Splitting a function into several blocks

Is it possible with knitr to split an R function across several blocks (for documentation reasons)? Here is a MWE: \documentclass{article} \begin{document} Part1 gives salutation. ...
3
votes
2answers
85 views

Typeset R character vectors

I have two vectors in R that I want to typeset. The first vector includes the titles and the second the body texts. Please consider the following MWE \documentclass{article} \begin{document} ...
1
vote
0answers
43 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 ...
10
votes
0answers
160 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 ...
0
votes
0answers
134 views

“Math Processing Error” when processing LaTeX using knitr in R

I've never had any problem with my Latex appearing properly when using knitr before, but recently when I compile my document, I get this error: I'm not sure why this is happening. The error output ...
5
votes
1answer
789 views

How to include LaTeX package in R Markdown?

I am writing a report with Rmd in RStudio via knitr package. I want to write a indicator variable symbol in the report, like How do you get \mathbb{1} to work (characteristic function of a set)?. ...
3
votes
2answers
182 views

TikzDictionary slow and blocking in knitr

I need to knit presentations with many slides and Tikz-plots. Knitr is fantastic for this, but it takes very long time and I cant knit two reports in parallel. I have isolated the problem to the ...
3
votes
1answer
82 views

display \Sexpr{} in Latex without evaluation

I am working on a tutorial for the knitr package using the beamer class. I was able to display latex code and knitr chunks inside my presentation without evaluation but I additionally want to add ...
5
votes
1answer
410 views

Howto: Set up knitr (*.Rnw compilation) from in TexStudio

How do I set up TeXstudio to compile xxx.Rnw files? I am using the TeX-Editor TeXstudio 2.7, on Windows 7, and R 3.01 64-bit. I would like to write a xxx.Rnw-file in TeXstudio and then from ...
2
votes
2answers
300 views

Sublime Latexing and Knitr on .RNW files : Send lines to R console for evaluation

I am using Sublime Text 3 and the Latexing package to apply Knitr to compile .Rnw files that contain both Latex and R code. Overall, it works well in that I can compile the .Rnw files into PDFs ...
7
votes
1answer
441 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 ...
4
votes
1answer
188 views

inline knitr code that isn't a simple number

It is easy enough to do something like \Sexpr{1 + 1}. But how can I do \Sexpr{mymatrix} with mymatrix being a matrix object in R workspace? More generally, how can I print object that is more complex ...
4
votes
1answer
50 views

Turning off line-wrapping in auctex for smooth transition with ess in same file

I sometimes use auctex + ess for Sweave/knitr documents. Every time I switch from auctex to ess and vice versa, there is a pause/jolt while the auctex lines re-wrap themselves. Previously, I also ...
1
vote
0answers
119 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'>>= ...
7
votes
4answers
182 views

tikz has probably problems with czech babel when compiling .Rnw

Problem Tikz seems to have a problem with \usepackage[czech]{babel}. I had a moderately big .Rnw document written in czech with some plots via knitr chunks. When I set dev = 'tikz' the TeXmaker ...
2
votes
1answer
1k views

Controlling formatting options for xtable

All, I'm a LaTex/knitr/Sweave amateur and have had trouble finding answers to what seem like they should be fairly simple questions online. I have a .Rnw script that I am currently compiling to PDF ...
0
votes
0answers
86 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: ...