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

learn more… | top users | synonyms

4
votes
2answers
27 views

Knitr: Referencing data from a figure later in the paper

I'm working with knitr Is it possible to reference data from a figure in the paper? I have a code chunk that produces a figure in the appendix of my paper. I know how to reference the figure itself ...
2
votes
0answers
37 views

Include Tikz-documents with a latex body in Lyx

I also posted this with a little different focus on stackoverflow already, but I am still looking for a elegant solution, so I will try again here. I use tikzDevice in R to transform my graphics into ...
1
vote
0answers
19 views

xtable, via knitr, inside multicols

How can I put an xtable (made with knitr) in a multicols environment? The table is working outside multicols, but when I place it inside multicols it disappear. I've tried with lstlisting inside ...
1
vote
0answers
20 views

pdf error when compile a knitr figure chunk

I am getting !pdfTeX error: pdflatex (file D:/project/figure/plot-1.pdf): PD F inclusion: required page does not exist <0> ==> Fatal error occurred, no output PDF file produced! when ...
0
votes
0answers
9 views

How to add reference to a knitr figure chunk in lyx?

Is there a way to make the lyx dialog "add -> cross references" to find knitr figure chunks? I.e., is there a lyx built-in way to add references to knitr figures other than use \ref manually?
2
votes
1answer
15 views

Knitr/Sweave Format Code Output w/ Leading Characters

Using knitr/sweave, I need to format the R code output that gets echoed, according to editorial journal requirements. For example, the following chunk <<example,echo=TRUE>>= library(plyr)...
0
votes
0answers
64 views

LaTeX Error: Environment snugshade undefined when trying to knit pdf from rmd file

I have a basic Rmd file which looks like this: --- title: "trial" output: pdf_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r trial} plot(1:10) ``` When I ...
1
vote
0answers
21 views

How to create looped output with knitr?

In my thesis, I have found 79 different concepts I need to describe in detail in the appendix. I used R for the analysis, and I want to use knitr for creating that appendix. Each description follows ...
2
votes
1answer
27 views

How to tell alltt not to skip lines at beginning/end?

It seems like there is no option for specifying that, like a hack for verbatim I found on tex.stackexchange: \usepackage{etoolbox}% \makeatletter \preto{\@verbatim}{\topsep=0pt \partopsep=0pt} \...
2
votes
1answer
81 views

Tables with reference to R objects in sweave / latex

I'm using knitr/R-sweave to produce a pdf-document wit LaTeX-code. I want to make a table with some numbers produced by some R calculations in the R-code-chuck above this table. When I usually want to ...
0
votes
0answers
35 views

Texmaker: display the structure of the whole document

I am working on a Latex document which includes several parts in separate documents. Is there a way to make Texmaker look into the included documents to display on the left hand sire panel all the ...
0
votes
0answers
57 views

Caption options don't work in rmarkdown beamer template

I want to resize the figure captions in an rmarkdown beamer template, so I added \usepackage[font={small,it}]{caption} to my header.tex. But it doesn't work - the options are ignored. I didn't find ...
3
votes
1answer
37 views

Use a LaTeX expression in a knitr figure caption

I am writing an .Rnw document in RStudio. I would like to be able to use latex expressions in Figure captions created by knitr. First a code chunk for the caption: <<cap_4, echo=FALSE>>= ...
2
votes
1answer
100 views

How to change row height within xtable environment?

I would like to change row height such that all rows except the header row will have fix height x and the header row will have eight y. I would like to do this within xtable environment because I ...
0
votes
1answer
62 views

with rmarkdown tufte-handout template xtables placed at the document end

I cannot understand why the chunks in rmarkdown would place tables at the end of the document. If I allow ECHO = TRUE in the chunk header, the code gets output in the correct place, but the table (...
0
votes
0answers
52 views

knitr: How to wrap text around a table generated around code chunk?

I would like to wrap text around a table generated by a knitr code chunk. I found a solution for a regular table here, but I didn't manage to re-implement it for a table generated by a code chunk. For ...
2
votes
2answers
74 views

Knitr: How to make a crossreferences to figures and tables generatrd by code chunks?

I would like to make cross-references to images and tables generated from knitr code chunk in the same way as to standard figures and tables. In a standard figure I use control sequence \label, but i ...
2
votes
1answer
22 views

Knitr: how to use citep control sequence inside code chunk option fig.cap?

I have a problem to include a citation into a code chunk option fig.cap, e.g.: fig.cap= Reprinted from \citep{Moran2008}. When the citep control sequence is included in the option, the execution of ...
2
votes
1answer
52 views

TeXStudio not compiling .Rnw properly with “scholar” R package

I'm working on making my CV with LaTeX, but I'm having an issue with including some R code. I'm using knitr and have made a user command for TeXStudio as follows: /Library/Frameworks/R.framework/...
2
votes
0answers
31 views

Why are the axis labels too large when using tikzDevice and lattice?

I'm working on a paper that is to be submitted to an Elsevier journal. The official guidelines state that: As a general rule, the lettering on the artwork should have a finished, printed size of ...
4
votes
3answers
123 views

How to extract a series of text not in an environment, but with defined commands enclosing them

Under Windows 8, I am using R and the knitr package in RStudio with an .Rnw script. My regex skills are passable, but only in R. My document has about thirty pages with a different text section at ...
0
votes
0answers
49 views

XeLaTeX + knitr + Arial = error

When I compile the following: \documentclass{article} \usepackage{fontspec} \setmainfont{Arial} \begin{document} Hello. <<foo, dev='tikz'>>= library(ggplot2) qplot(1) @ \end{document} ...
1
vote
0answers
74 views

How to solve the error: No counter 'sectionpage' defined [closed]

I'm trying to use this answer from a previous question to get frame numbers in a table of content in a beamer presentation made in RStudio with R Markdown and knitr (see file below; in in_header.tex ...
0
votes
1answer
33 views

xtable: extend table to both columns

Using the xtable package, is it possible to give some option to xtable function to generate a tex file which will contain following: ``` \begin{table*} ... \end{table*} ```
1
vote
2answers
83 views

Where set font in tikzDevice-plots (.Rnw)

I'm trying to use sans serif fonts for the text in plots (ggplot2) made by R, within KOMA-book. Unfortunately I'm not very experienced in managing fonts and their families. To keep things consistent, ...
2
votes
1answer
127 views

Using Calibri with a Mac

I am preparing a document, writing it in RStudio and knitr in a Mac (OS X El Capitan 10.11.2). I would like to use Calibri (to mimic Office documents). I already have a legal version of Microsoft ...
2
votes
1answer
69 views

Insert line break into knitr fig.cap?

I am using knitr and want to insert a line break in my fig.cap chunk option. Is this possible? The following is all I can think of but it doesn't work. I expect there's some evaluation option but I ...
2
votes
0answers
59 views

What is the counterpart in LaTeX for the R package ezknitr and its tools for managing paths and directories

Dean Attali has just added an R package called ezknitr to CRAN. It enables those who use knitr and RMarkdown in .Rmd files to handle directories quite flexibly. His blog describes it well: path ...
2
votes
0answers
33 views

Formatting text the same way knitr formats code, but outside of chunks

Back when I was using sweave, I could make my inline code look like R code by using \texttt{whatever} or \verb@whatever@. I am trying out knitr, and the format of the code chunks sure is pretty. But ...
1
vote
0answers
754 views

Error 43 while knitting a markdown to pdf in a R project created on mac and run on Windows

I created a R project which outputs some plots to pdf using rmarkdown::render with an .Rmd file. I shared the folder when the R project and all the relative files are kept to a colleague using Google ...
0
votes
0answers
161 views

I can not install the framed package in R Markdown

Hi I am trying to install the framed package from LaTeX in RStudio because I get the Error when I am trying to use knitr. There are my LaTeX Error: File `framed.sty' not found. Type X to quit or ...
0
votes
0answers
25 views

vim-latex (and knitr) not compiling bibliography [duplicate]

I had to reinstall vim and the assorted plugins in windows, and now the compiler in latex-suite doesn't work any longer for bibliographies with natbib. A simple example I made is as follows: ref.bib ...
2
votes
2answers
89 views

With knitr and LaTex, how can you arrange the List of Figures alphabetically?

What code will enable me to reorganize the List of Figures alphabetically (and keep the page number)? My goal is to include that alphabetical listing of figures in the PDF file that is created. Here ...
0
votes
0answers
53 views

Can we use itemize specially nested itemize without itemize environment?

I am writing in Markdown a LaTeX doc. In this special environment I apply a R Code after every \item. It means I cannot use itemize environment! And I know that there is HTML possiblity like we ...
2
votes
0answers
53 views

Knitr Plot Tooltips for ADA Compliance

I would like to use Knitr to generate plots in R that have hover-over tooltips. Here is a working example without an R tooltip: \documentclass{article} \usepackage{pdfcomment} \begin{...
3
votes
1answer
73 views

knitr code chunks in footnotes

My issue is to include verbatim output from knitr Sweave code chunks in footnotes. The BVerbatim environment (fancyvrb) gives me the formatting that I want. (NB: one needs to put \VerbatimFootnotes ...
0
votes
0answers
34 views

How can I have the Latex structure in knitr?

how can I have the same structure, I mean: \section, \subsection, ... in knitr or Markdown? Is there any possibility to include every section in a separate file like in latex? \section{...
2
votes
0answers
110 views

Extra Curly Braces when creating Xtable using Knitr, after specifiying size

I'm creating a R Markdown document using knitr and am running into trouble using xtable to create a table. My table is very large and I'm trying to reduce the size using the size command in the print ...
8
votes
2answers
250 views

Encrypt and decrypt parts of text in a LaTeX source file

Assume that you have some text in parts of your LaTeX document that you only want people with a password to see. A reason could e.g. be a case with an guiding answer. You want to make the case public ...
2
votes
0answers
31 views

Page margins in .Rtex

I'm using ShareLatex to write my thesis (which relies heavily on R) but the page size changes when I set my document to "main.Rtex" instead of "main.tex". I provide a minimal example so you can check ...
1
vote
1answer
178 views

Knitr markdown can't display basic symbols

I'm on Ubuntu 14.04, running RStudio Version 0.99.473. I have LaTeX installed (TeXworks) and knitting Rmarkdown documents works just fine. However, adding mathematical symbols such as $\mu$ causes it ...
0
votes
0answers
94 views

Knitr not available in LyX (Windows)

I installed LyX with MicTeX on my pc. I installed the Knitr module. So I see in the packages in R studio that I can add 'Knitr'. After that i added the path of R.home('bin') to the PATH in the ...
2
votes
2answers
224 views

Running R code from latex. (alternative to knitr)

If you want to export the output of an R script to latex and create a pdf document you can use the package Knitr with RStudio. But I guess this is only a good practise for short results. What if I ...
3
votes
1answer
407 views

Is it safe to reinstall MacTex after upgrading from Yosemite to El Capitan

I was using MacTex on OSX 10.10 (Yosemite). I upgraded to OSX 10.11 (El Capitan) and now I get the error "No TeX installation detected" trying to compile a latex document using knitr. I saw the ...
2
votes
1answer
246 views

knitr texmaker could not start the command

I have recently upgraded to El Capitan and I can't make knitr work with texmaker anymore. I have red all the issue concerning MacTex and the change in the path from /usr to /Library/Tex but here I can'...
3
votes
2answers
498 views

knitr not working on LyX after installation of Mac OS X El Capitan

I updated my Mac to OS X El Capitan and knitr doesn't work on it. Before the update everything was fine. Now LyX is saying : "The module knitr requires a package that is not available in your LaTex ...
0
votes
0answers
153 views

How can I set formatting options for an .Rmd outputting to .pdf

I have a .rmd in r studio. This is being compiled by the r package knitr into a pdf via the pdfLaTeX engine. DISCLAIMER: I am very new to LaTeX, and have been searching for days without luck on how ...
0
votes
0answers
419 views

Encoding error when knitr -> LaTeX -> PDF

I have a document written in knitr. I can export it to HTML and docx, but not PDF for some reason. The Rmd file is here http://cl.ly/dJka?_ga=1.30252732.2076817589.1442770201 It says ! Package ...
0
votes
0answers
77 views

R to LaTeX with knitr and pandoc (error in a guide)

I want to follow the guide http://kieranhealy.org/blog/archives/2014/01/23/plain-text/ since my document http://rpubs.com/lindberg/110268 need to be pushed to latex for a better read. The tex says "...
3
votes
2answers
179 views

References and bibliography with knitr, ESS and AUCTEX

I'm trying to get references working in a knitr Rnw document using ESS, AUCTex, TeXLive, and natbib. Here is a minimal example: \documentclass{article} \usepackage{natbib} \begin{document} <<...