Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
13 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} ...
2
votes
1answer
41 views

knit() doesn't create .tex file with necessary preamble

I have a question about creating .tex from .Rnw using knitr in Rstudio. I have a test.Rnw file while looks like the following: \input{report_preamble_en.tex} \title{test} \author{author} ...
3
votes
0answers
90 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 ...
1
vote
1answer
42 views

SumatraPDF inverse search for RNW files

I'm using TexStudio to edit my rnw files. I setup an inverse search from SumatraPDF to TexStudio using THIS (verbatim) which is a renewed version of THIS. When I double click a text in SumatraPDF it ...
0
votes
0answers
32 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 --- ...
2
votes
1answer
57 views

Special characters and math-mode in tikz graphics using knitr

This question closely relates to this one: Using '$' in a tikz plot generated by knitr I am able to get tikz graphics using knitr working with either math mode as in this post: Math mode in ...
1
vote
0answers
22 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
1answer
31 views

Using geom_segment dashed line has odd behavior when using tikz device

My example is: \documentclass[12pt]{article} \begin{document} <<eg, dev='tikz', size='normalsize', echo=FALSE, message=FALSE, warning=FALSE, sanitize=TRUE>>= require(ggplot2) p1 <- ...
0
votes
1answer
38 views

Using '$' in a tikz plot generated by knitr

My example is: \documentclass[12pt]{article} \begin{document} <<eg, dev='tikz', size='normalsize', echo=FALSE, message=FALSE, warning=FALSE>>= require(ggplot2) ggplot(cars) + ...
4
votes
1answer
931 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
26 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
68 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
1answer
66 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
69 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
533 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
49 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
116 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
34 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
616 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
86 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
30 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
37 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
1answer
29 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
116 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
84 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
49 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
145 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
85 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
81 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
65 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
60 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
1answer
88 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
55 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
88 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
136 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
80 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
74 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
85 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
173 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
222 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
92 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
72 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
108 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
89 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
49 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
176 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
1answer
171 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 ...
7
votes
2answers
1k 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
190 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
96 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 ...