Questions tagged [rstudio]

RStudio is an IDE for working with the programming language R. It also has in-built functionality for compiling .Rnw files to .tex files and then directly to .pdf files. It can be set up to process the .Rnw file with either Sweave or knitr.

Filter by
Sorted by
Tagged with
0 votes
0 answers
60 views

Problem Solved - Multiple issues with Sweave and Knitr

Here is the Github link of the files and a short description of the issues: https://github.com/Euniceisnice/What-is-wrong-with-my-Tex-and-Sweave I have never managed to compile my Rnw file with Knitr. ...
user avatar
0 votes
0 answers
61 views

Copy/Paste from R Studio to TeXStudio: Newlines and UTF-8 Issues

I am seeing a difference of behavior from my Mac to my Linux machine in copy/paste from R Studio to TeXStudio. I am executing R commands in R Studio, and then I want to copy the output into TeXStudio. ...
user avatar
1 vote
0 answers
21 views

How do I assign these variables from Rmarkdown? [duplicate]

I have variables that are going to be dynamic in this document. How do I assign theme from Rmarkdown. Below is how my .tex file looks like So for example $District_Name$ is a dynamic variable. I want ...
user avatar
  • 13
0 votes
0 answers
250 views

Cannot fix: ! LaTeX Error: File `pdflscape.sty' not found

I am using tinytex, Windows 10, R Studio install.packages("tinytex") tinytex::install_tinytex() and keep seeing the following error when I try to run a .Rmd file which contains \usepackage{...
user avatar
  • 1
2 votes
1 answer
86 views

Change the style of chapters (sections) of the .pdf document from rstudio with knitr package LATEX "titlesec"

I try to style the chapters (sections) of an article document (documentclass: article) using the latex titlesec package, but I don't get any results, I mean that when I configure the document there is ...
user avatar
0 votes
0 answers
2k views

Compile pdf in R Studio fails

I am struggling for three days now with the following issue and it's driving me crazy: I am trying to use the "compile pdf" in knitr (R Studio) to compile a basic .rnw file: \documentclass{...
user avatar
1 vote
1 answer
73 views

Export regression in R to Latex - decimal alignment

I did regressions in R using the lm function. Afterwards, I want to export it to Latex with the following code. #export to Latex texreg(list(model_cont,model_mag,model_pos), digits = 4, ...
user avatar
  • 13
0 votes
0 answers
43 views

TeXstudio and RStudio do not see tufte-book.cls but TeXshop does

\documentclass{tufte-book} \title{title} \author{me} \begin{document} \maketitle \end{document} TeXstudio and Rstudio complain File `tufte-book.cls' not found TeXstudio log This is pdfTeX, Version ...
user avatar
  • 159
0 votes
1 answer
241 views

Manually numbering with \tag in double dollar signs

I want to manually numbering in non-numbered displayed equation environment and try the following steps \documentclass{article} \usepackage{amsmath} \begin{document} \[ \bar{D}=\frac{1}{n} \sum_{j=1}^...
user avatar
0 votes
1 answer
159 views

fonts not working in pdf output with bookdown in RStudio

I am using bookdown in the Rstudio environment to produce a pdf book. This is running on Ubuntu 21.04, with the latest version of RStudio, R 4.0.4, and new installs of texlive and tinytex. I am using ...
user avatar
  • 267
0 votes
1 answer
386 views

!pdfTeX error: pdflatex (file t1-zi4r-0): Font t1-zi4r-0 at 540 not found

My issue is same as this problem Error: Font ts1-zi4r at 540 not found In my case, I am running Rstudio server on a remote machine for work. When trying to build the vignette/manual pdf I get this ...
user avatar
0 votes
0 answers
38 views

Is there a way to automatically use minty for all code blocks?

I have been given a book in RMarkdown format and I am compiling it to pdf using RStudio. I want to use minted for the many code blocks included in the book. It works fine but I would like to apply a ...
user avatar
  • 105
0 votes
1 answer
70 views

Centering a table that is too big [duplicate]

I know that there are already similar questions to this on stack exchange, but I am working in R studio with the Stargazer library and I want to be able to directly copy and paste my tables into ...
user avatar
0 votes
1 answer
51 views

Using Memoir class with RMarkdown fails when trying to generate the table of contents

I am using RMarkdown in RStudio to compile a book written in Markdown. I am using the memoir class and it all works fine as long as I set toc: false. When I try to compile with toc I get the followin ...
user avatar
  • 105
0 votes
0 answers
944 views

RStudio, pdflatex fails to knit to pdf and crashes

I'm trying to compile a simple Rnw file in RStudio using knitr's "compile pdf" functionality. But it gives me an error. This is what I have in Vorlage.Rnw: \begin{document} Hello World \...
user avatar
  • 1
1 vote
1 answer
357 views

Help rendering booktabs tables in RStudio

Can I use the booktabs package in R? I am using RStudio and could not find a way to install a version of the booktabs package. The table I am trying to render in a .Rmd file is provided below: %----- ...
user avatar
1 vote
1 answer
422 views

Including images in an R code chunk of R sweave using for loop

I am new to sweave and Latex. I am basically using an if-else loop which should display some specific image (taken from the laptop) if certain condition is satisfied. When I run this loop in R, the ...
user avatar
  • 13
1 vote
1 answer
70 views

Question about using book down in R-do I need to load packages on each page? Help with basic understanding!

Please forgive the v basic question. I have recently started using R bookdown, to try write papers. I've read the cookbook and book down guide. I use rmardown, and understand that, but I don't ...
user avatar
  • 113
1 vote
1 answer
72 views

Table created with vtable package does not appear

I used to work with stargazer, but this package (vtable) is better for making summarization by groups. I choose "latex" as out and the following table was generated. However, my overleaf ...
user avatar
0 votes
0 answers
387 views

How do you align latex to left side of knitted pdf in rstudio?

I'm creating a notebook in rstudio for the first time, and I need to knit a pdf with latex. At the moment, I have latex in the middle of the document, but I'd like it aligned to the left, as the red ...
user avatar
  • 101
0 votes
0 answers
298 views

How do I insert a CFA output from R into Latex using lavaan and semTable?

I am not very experienced when it comes to Latex or R. As said in the title, I have a CFA output I generated with R Studio and now want to insert into Latex. Unfortunately, whenever I do this, my ...
user avatar
  • 1
1 vote
0 answers
25 views

Macro for Texstudio to select like Rstudio

How can I set a macro to select a word in Texstudio without the whitespace after the word? By Ctrl+Shift+Arrow (left, right) I get the word + whitespace. I would like to select only the word and in ...
user avatar
2 votes
1 answer
58 views

Knitr: storing variables for later use

I'm relatively new to Knitr. I want to run a function just once, so that next time I don't have to evaluate it, because it would yield a different result. My MWE: First time: \documentclass{article} \...
user avatar
  • 21
0 votes
1 answer
532 views

Rstudio "Compile PDF" button not working after update from Windows 7 to 10

I use LaTex to compile documents in Rstudio, and use the 'natbib' package for bibliographies. My university upgraded all computers to Windows 10 a couple months ago. After the change, I reinstalled R (...
user avatar
0 votes
0 answers
42 views

R Studio tinytex::tlmgr_update() gets an error

When I try to run: tinytex::tlmgr_update() I get the following error: Not sure what to do next, any advice?
user avatar
0 votes
1 answer
217 views

Multiple errors after using starger

I imported the stargazer code from Rstudio and I get the following errors: -Error line 1 ! LaTeX Error: Environment table undefined.See the LaTeX manual or LaTeX Companion for explanation.Type H for ...
user avatar
0 votes
2 answers
1k views

How to Integrate R code in TeXStudio?

I am writing my thesis in TeXStudio. One chapter features plots / analysis etc. that I am writing in a markdown in RStudio. Is there a way to kinda "link" the documents so the output from R is ...
user avatar
  • 1
2 votes
0 answers
584 views

Compilation problem with fontenc-Latex - LaTeX2e problem

Unfortunately, I am experiencing the same issue as reported in Compilation problem fontenc-Latex. I reinstalled my TeX installation and ran tlmgr update, all to no avail. I am using RStudio Version 1....
user avatar
  • 21
1 vote
1 answer
4k views

How to customize header with Rmarkdown?

I'm currently working on a pdf document using Rmarkdown on RStudio but I'm very much confused about to how to customize my YAML section. This is my actual code: --- title: "The very basics of R" ...
user avatar
2 votes
1 answer
632 views

Can't fit a table in beamer

This is the output of the stargazer package that I did in R. However, I can't make the table fit in my beamer presentation. Here is the code: % Table created by stargazer v.5.2.2 by Marek Hlavac, ...
user avatar
0 votes
0 answers
220 views

Issue with fig=TRUE in Sweave RStudio

I do not receive plots using the fig=TRUE in the chunks. Rather i receive an 'undefined control sequence' error. Consider a simple code \documentclass{article} \usepackage{graphicx} \begin{document} ...
user avatar
  • 1
0 votes
1 answer
918 views

Paragraphs won't indent

I'm issuing rstudio and bookdown to cross-compile rmarkdown to TeX and make a PDF for my dissertation. I've got everything formatted how I need it, but I'd like an indent to start each of my ...
user avatar
1 vote
1 answer
266 views

Remove brackets around special characters in URL in bibliography entries

I am creating a pdf book in RStudio using bookdown with natbib, and cite with [@reference] from a .bib file created with mendeley. Also, I use the \setcitestyle{numbers,square,comma} style. For all ...
user avatar
  • 171
0 votes
0 answers
172 views

Including R code in latex

I have some problems by inverting my R code into latex and than copying the code of the pdf back into R. I used lstlistning to read the R code and since it did not show the -, I used this code: \...
user avatar
  • 1
2 votes
0 answers
3k views

Error running C:/MIKTEX~1.9/miktex/bin/x64/pdflatex.exe (exit code 1)

I'm using latex in rstudio and when I try to compile pdf I get this mensage: Error running C:/MIKTEX~1.9/miktex/bin/x64/pdflatex.exe (exit code 1) How can I solve this problem? I'm desperate, I'm ...
user avatar
1 vote
1 answer
312 views

TikZ picture not rendering in different environment

I successfully constructed a TikZ diagram with the following code \documentclass{article} \usepackage{tikz} \usetikzlibrary{automata, positioning, arrows, shapes} \begin{document} \tikzset{...
user avatar
  • 113
0 votes
1 answer
2k views

Is there a way to make LaTex show up in RStudio preview?

I'm using RStudio (current version) on a Windows 10. The math rendering works but when I add additional aspects to make the document more clean, I run into the problem of going from pdf to html and ...
user avatar
6 votes
1 answer
3k views

How to insert references and bibliography into a .Rnw file produce with RStudio R Sweave and knitr?

So far, I have successfully used RStudio and R Markdown to write scientific papers and insert citations from the medical literature without significant problem as shown in the minimal example (MWE) ...
user avatar
0 votes
0 answers
37 views

Xtable_AreaUnderCurve values

New at Latex I need to make a table in Latex with the AUC (area under curve)values and AUC-IC interval of some variables. How can I combine RStudio functions as the one of the pROC library o similar, ...
user avatar
  • 1
3 votes
1 answer
3k views

Math mode in document title with R Markdown

I was trying to put $\LaTeX$ in the document title but can't find a way to do so. I suppose that this is because I can't use latex packages with the document title. Does anyone know how to solve this? ...
user avatar
  • 133
2 votes
1 answer
5k views

How to make vector arrows?

I would like to make a vector over my beta symbol. What I use for the moment is: $A\overrightarrow{\beta}$ I have also tried the following: $A\vv{\beta}$ $A\vec{\beta}$ Note that all of these works ...
user avatar
1 vote
1 answer
82 views

Sweave child rnw losing formatting

I have managed to get a master.rnw include a child.rnw, however, I can maintain the formatting of the child document based on the preamble in the master. Master.Rnw \documentclass[11pt,a4paper, ...
user avatar
  • 41
1 vote
0 answers
121 views

Greeks Letter in RStudio + Sweave

This is my Rsweave reproducible code: \documentclass{article} \usepackage[a4paper,left=1.5cm,right=1.5cm,bottom=1cm,top=3cm]{geometry} \usepackage[perpage]{footmisc} \usepackage{csquotes} \...
user avatar
  • 123
1 vote
0 answers
239 views

Problem with out of KableExtra tables with LATEX in Rstudio: paste0 function

This is my Rsweave reproducible example: \documentclass{article} \DeclareUnicodeCharacter{3B1}{$\alpha$} \DeclareUnicodeCharacter{3C4}{$\tau$} \DeclareUnicodeCharacter{3C3}{$\sigma$} \...
user avatar
  • 123
0 votes
1 answer
584 views

Bibliography output in RStudio with multiple references

From this link I was able to replicate the references result. https://texblog.org/2013/08/20/rknitr-automatic-bibliography-generation-with-biblatex-in-rstudio/ How can I add more than one output? ...
user avatar
  • 123
0 votes
1 answer
1k views

Loading Custom Fonts into RMarkdown

I've been testing loading my own fonts into a personal rmarkdown document using the fontspec latex package. Because I'll eventually need to knit this on a server, using the font library on my mac is ...
user avatar
5 votes
1 answer
16k views

RStudio not detecting MikTeX

I am having some trouble using MikTeX (v2.9) on windows 7 (64 bit) with RStudio (v1.1.447; R v 3.5.0). Despite the fact that I have installed the complete MikTeX, RStudio keeps telling me that no ...
user avatar
1 vote
1 answer
5k views

Minimal LaTeX install for knitr to export PDFs from Rmarkdown on Debian-based system

I use RStudio and started writing Rmarkdown documents to knit them into HTML pages and PDFs. I tried installing TexLive but it failed when the astounding number of packages filled my limited ...
user avatar
  • 113
1 vote
0 answers
1k views

RStudio, pdflatex fail on .tex file [closed]

I have compiled many .pdfs and knit many .Rnws and .Rmd files in the past with this computer. Not sure what changed, but I now get a message stating: Running pdflatex.exe on [doc_name].tex...failed ...
user avatar
2 votes
1 answer
1k views

RStudio regression table into beamer slide

I have a very basic Rstudio regression output table inputing in Latex issue. I get an error message pointing me to the end of the frame part, after the table and I can't see what's wrong. Here is the ...
user avatar