Hot answers tagged

6

I think this will do the trick: \documentclass{article} \usepackage{longtable} \begin{document} \listoftables << label=LongTable, results='asis', echo = FALSE >>= library(xtable) set.seed(12345) MatrixData <- matrix(rnorm(1000), ncol = 10) print( xtable( x = MatrixData , caption = "Example of longtable spanning several pages" ...


4

The Problem: This is neiter an issue of TeXstudio nor of Sumatra PDF. Instead it's a result of the combination of Synctex and the build chain is rnw -> tex -> pdf. Synctex is originally designed to provide a connection between the tex file and the pdf. It does not know anything about the rnw. Towards a Solution: I'm not an R user and therefore have no ...


3

You can temporarily redefine \raggedright to do nothing. The output may not look pretty: .Rnw file (process with knitr, then LaTeX): \documentclass[a4paper]{article} \usepackage[pass]{geometry} \begin{document} \let\oldraggedright\raggedright \renewcommand\raggedright{} <<echo=FALSE,results="asis">>= utils::toLatex(sessionInfo()) @ \let\...


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 ...


2

For anyone having a similar problem. I found, that my Code.BBL file wasn't updating anymore when I compiled the document. For now the solution is the following: Update the bibliography file (in my case bib.bib) and save it. Delete the Code.BBL file (yours will have the name of your Rnw document) and then compile the Code.Rnw (or whatever your main document ...


1

Welcome to TeX.SE. This answer suggests that you use the biblatex package and biber to produce your citations and bibliography. The answer then assumes you are using RStudio as your editor and to compile your .Rnw file. Executing biber from within RStudio was answered here: How to insert references and bibliography into a .Rnw file produce with RStudio R ...


1

You have "bad box" warnings because the content of cells either doesn't properly fill the cell, or overfills it. Below is an alternative without having to using smaller fonts. Instead, stack some of the column headings, perhaps consider abbreviations that are well-known. \documentclass{beamer} \usepackage{booktabs,makecell,siunitx} \begin{document} \...


1

You can reset the draft key of graphics locally (for the following pictures) with \setkeys{Gin}{draft=false} So you only need to ensure that this commands comes after the loading of the graphicx package. From the comments I got that this here will work: \documentclass[draft]{article} \setkeys{Gin}{draft=false} \begin{document} This is text from the ...


1

Thanks @nebi and @Fran. I managed to solver this by reading this forum thread and the knitr documentation The answer is really simple, actually. The knitr package already though about this. Everything works fine if I add <<>>= set_parent("../thesis.Rnw") @ to chapter1.Rnw. That function will use the preamble in thesis.Rnw as the preamble in ...


1

A soluion, maybe not the best one, would be to keep chapter1.Rnw without preamble (your first solution), move part of your latex preamble in a spearate file so you can source it and have 2 masterr.Rnw files to call chapter one, one in the thesis.Rnw and one time in a extra 'only-chapter1'. For example, make a tex file package_to_include.tex \usepackage{...


1

You output fig1.png, while your try to include Fig1.png. TeX is case sensitive. The following works: \documentclass[ titlepage ]{article} \usepackage{graphicx} \begin{document} <<Setup, include=FALSE, cache=FALSE>>= library(ggplot2) png("Fig1.png", height = 7, width = 14, units = 'in', res = 350) p<-ggplot(mtcars, aes(color = mpg, x = ...


1

The problem here is that RStudio knows where to look for Rd.sty, which is not part of CTAN and thus not part of TeX Live. (Rd.sty is something that is distributed with the base R packages and binaries but is not included in any TeX distribution that I know of.) TeX Live, by default, is configured to only look in certain places for TeX things. The link ...


1

is is a function in the methods package, so you have to library(methods) The methods package is not loaded by default if the R script is executed from Rscript, per documentation of ?Rscript. That is how LyX calls R to load knitr and compiles the document.


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