# Tag Info

8

In short, yes, using the filter module. In fact, the filter module has a specific example for using R. I'm not sure about Sweave, but the integration doesn't seem to be quite as tight as something like knitr (although I'm no filter expert either). The author of the module, Aditya, is quite active on this site so he will likely chime in with his answer. In ...

8

As of rmarkdown version 1.4 it has been possible to use the extra_dependencies parameter to list a character vector of LaTeX packages. This is useful if you need to load multiple packages: --- title: "Untitled" output: pdf_document: extra_dependencies: ["bbm", "threeparttable"] --- If you need to specify options when loading the package, you can add ...

7

One rule of LaTeX is that it is a bad idea to load packages twice and that it is an error to load the same package twice with different options. This is what happens here. You load biblatex manually in your preable.tex and then you say citation_package: biblatex in your .yml file, so the markdown conversion loads biblatex for you again. You get an error as ...

5

\documentclass[tikz]{standalone} \definecolor{grayR}{HTML}{8A8990} \definecolor{grayL}{HTML}{C4C7C9} \definecolor{blueM}{HTML}{1F63B5} \begin{document} \begin{tikzpicture} \shade [right color=grayR,left color=grayL,shading angle=60] (-3.55,0.3) .. controls (-3.55,1.75) and (-1.9,2.7) .. (0,2.7) .. controls (2.05,2.7) and (3.5,1.6) .. (3.5,0.3) .. ...

4

It is actually really easy to produce a PDF with knitr with LaTeX-code in RStudio with biblatex for citations. You have to use the option bib_engine = "biber" from the package tinytex::latexmk within knitr::knit2pdf. Just like here: knitr::knit2pdf(file.Rnw, bib_engine = "biber")

4

In RStudio it should be > Tools > Global Options... > Sweave > Check Clean auxiliary output after compile > Apply > OK but for some reason actually do not clean that files. Funnily, that happen with .Rnw but not .Rmd files, although both are finally converted to LaTeX.

3

foo.R: # ---- foo bah <- data.frame(a=c(1,2,3),b=c(4,5,6)) library(xtable) print( xtable(bah, cap="My data frame", label="footable"), table.placement="!b", booktabs = T) plot(bah$a,bah$b) a <- mean(bah$a) b <- mean(bah$b) Note: The # ---- foo is not only a comment. It is a must label, as is. ...

3


3

You cannot use result=tex option of Sweave in a R chunk in R markdown with uses the knitr syntax, but more important, you cannot use the R chunk syntax for noweb (.Rnw) files. Thas is, some like: <<name,results='asis', option, option, ...>>= 2+2 @ Is still wrong, even if the chunk is inside the inside a LaTeX environment. Instead you must ...

3

According to the README file, the true type versions of the Bera fonts (the original Bitstream Vera fonts, as Ulrike Fischer already pointed out) are part of the GNOME project: "Bera" is a set of three PostScript Type1 font families: Bera Serif (a slab-serif Roman), Bera Sans (a Frutiger descendant), and Bera Mono (monospaced/typewriter). The fonts ...

3

If your source code comes out garbled when you reopen the file, the chances are it was saved in a different encoding from the one that it opened in. This is something you need to fix with your editor: Resave the file with the UTF-8 encoding. Make sure the default encoding in your editor is set to UTF-8 also. Since you don't say which editor you are using ...

3


2

In your example the \end{document} is missing. If I insert this, it seems to work. This report provides the results blah blah blah.\cite{edgeRRef} outputs This report provides the results blah blah blah.[1]

2

While its is good to know that every reference should have a key, a R user should not edit bib files, at least to cite the R packages used in a report. Let R work for you. Test.Rnw: \documentclass{article} \usepackage{natbib} \begin{document} <<echo=F,message=F>>= bibtex::write.bib(c("ggplot2","tools"), file='test') @ \bibliographystyle{...

2

You have indented a first level list with 4 spaces, so it is not an enumerated environment but a verbatim monospaced text. Remove the indentation and it will work as expected.

2

Since you are using results='asis' you can output additional LaTeX code with cat, e.g. cat("\\begin{center}") print(x, add.to.row=addtorow,include.colnames = FALSE, hline.after = NULL, size="\\fontsize{10pt}{12pt}\\selectfont") cat("\\end{center}") works for me when I use some standard data set.

1

It works with the knitr package, in overleaf you dont have to load it. Everything inside <<echo= F>>= #Code goes here d <- read.csv("data.csv") @ is R code. If you create objects in a chunk like this you can print and manipulate those in text with \Sexpr{head(d)}.

Only top voted, non community-wiki answers of a minimum length are eligible