Skip to main content

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
1 answer
86 views

RStudio/Quarto is unable to make a pdf because it can't find xelatex.fmt, which is in system path

RStudio/Quarto is unable to make a pdf because it can't find xelatex.fmt. I've recently updated tlmgr and all LaTeX packages I've also run fmtutil-sys --all xelatex is in /c/texlive/2024/bin/windows/...
Peter Leopold's user avatar
3 votes
2 answers
36 views

Package `keystroke` not drawing borders all the way

As the image shows, the left edge, right edge, part of the top, and part of the bottom all display just fine. However, part of the key is supposed to extend to cover everything in the key. Why is this ...
Private Eye's user avatar
2 votes
1 answer
163 views

RStudio + LaTeX template: compilation error undefined control sequence -- how to debug this myself?

I am creating a LaTeX template based on the template provided by Springer Nature link .. and direct download link When rendering I get the following error: compilation failed- error Undefined control ...
Søren ONeill's user avatar
0 votes
0 answers
29 views

Strange issue with the biblatex's command \addbibresource{}

My latex document has this simplified code (see below). If I am running it (turning into a pdf file) on my PC via the R Studio, then the resulting file (screen shorts are at the bottom of this post) ...
Alex's user avatar
  • 67
0 votes
1 answer
39 views

How to enter symbols and align equations [closed]

1)I wrote an equation and when I hover my mouse over it it shows perfectly as I want it to but when I am knitting to pdf I get the error 1 : Code used for error1: $var(u_{t}) = {\delta}_{u}^2 < \...
Rick The Sizzler's user avatar
2 votes
1 answer
64 views

How to use Sweave (knitr) with LuaLaTex?

This is a duplicate of this 5 year old question, because the answers there don't work (for me). Has someone managed to get knitr for Sweave documents (not RMarkdown) running with LuaLaTex as an engine?...
abeeisnotabug's user avatar
0 votes
0 answers
43 views

Using CJK adaption code in R Markdown

I have limited TeX experience, so please forgive the simple question. I've tried to resolve this issue for hours to no avail. I am trying to use the code for CJK Chicago-style author-date ...
myusername's user avatar
1 vote
0 answers
70 views

Compiling error with R plots

I appreciate your advice in advance. The following code worked around two years ago and it stopped working after I updated TexLive, and R to the latest version. The error message is Paragraph ended ...
user3084501's user avatar
0 votes
1 answer
290 views

Tufte-style book with ConTeXt

Is there any tufte-style formatting in ConTeXt as a module? I have seen references to \usemodule[tufte] in some documents but I can't find how to use this module in ConTeXt garden site. I'm using ...
Juan Riera's user avatar
1 vote
1 answer
85 views

asymptote in RStudio

Recently, I found an amazing fact: if we go the art of problem solving website, with copy and paste to .Rmd in RStudio, we could directly have the latex codes for math equations. That is very nice. ...
Pai's user avatar
  • 11
0 votes
2 answers
93 views

RStudio not exporting while TeXworks does

Problem Overview I want to use the cancel-package for my R-Markdown-file project.rmd. For that, I created a preamble.tex-file with following content: \usepackage{amsmath} \usepackage[makeroom]{cancel} ...
Taxifahrer's user avatar
0 votes
0 answers
266 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. ...
Eunice Ng's user avatar
0 votes
0 answers
289 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. ...
Adrian Keister's user avatar
1 vote
0 answers
22 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 ...
bob0901's user avatar
  • 13
1 vote
0 answers
3k 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{...
Elis's user avatar
  • 11
2 votes
1 answer
397 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 ...
José Carlos's user avatar
0 votes
0 answers
3k 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{...
Ermi Atha's user avatar
1 vote
1 answer
1k 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, ...
user249426's user avatar
0 votes
0 answers
118 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 ...
mk9y's user avatar
  • 299
0 votes
1 answer
1k 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}^...
John Stone's user avatar
1 vote
1 answer
478 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 ...
bshor's user avatar
  • 297
1 vote
1 answer
740 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 ...
sutsabs's user avatar
  • 111
0 votes
0 answers
112 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 ...
Dionysis's user avatar
  • 135
0 votes
1 answer
190 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 ...
Sparkles the unicorn's user avatar
1 vote
1 answer
90 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 ...
Dionysis's user avatar
  • 135
2 votes
0 answers
2k 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 \...
Kris's user avatar
  • 21
1 vote
1 answer
1k 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: %----- ...
Ovande Furtado's user avatar
1 vote
1 answer
939 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 ...
radhika's user avatar
  • 23
1 vote
1 answer
192 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 ...
Gabriella's user avatar
  • 113
1 vote
1 answer
128 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 ...
Mateus Maciel's user avatar
0 votes
0 answers
935 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 ...
Data's user avatar
  • 101
1 vote
0 answers
597 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 ...
non's user avatar
  • 11
1 vote
0 answers
39 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 ...
Yuri Gelsleichter's user avatar
2 votes
1 answer
90 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} \...
paulgr's user avatar
  • 21
0 votes
0 answers
159 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?
Angel Cloudwalker's user avatar
0 votes
1 answer
353 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 ...
Timothy Cleemput's user avatar
0 votes
1 answer
2k 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 ...
rabatz's user avatar
  • 1
2 votes
0 answers
760 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....
JKR's user avatar
  • 21
2 votes
1 answer
7k 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" ...
Alejandro Carrera's user avatar
2 votes
1 answer
1k 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, ...
Mateus Maciel's user avatar
0 votes
0 answers
255 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} ...
tulu95's user avatar
  • 1
0 votes
1 answer
1k 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 ...
Tyler Peckenpaugh PhD's user avatar
1 vote
1 answer
415 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 ...
Haakonkas's user avatar
  • 171
0 votes
0 answers
208 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: \...
Lisa's user avatar
  • 1
3 votes
0 answers
4k 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 ...
alexandre's user avatar
2 votes
1 answer
577 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{...
Taylor's user avatar
  • 123
0 votes
1 answer
4k 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
4k 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) ...
CharlesLDN's user avatar
0 votes
0 answers
43 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, ...
John's user avatar
  • 1
3 votes
1 answer
4k 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? ...
yuan-ning's user avatar
  • 133