As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [rmarkdown]

Rmarkdown is a lightweight markup language with plain-text-formatting syntax. Its a variant of markdown syntax that allow inclusion of chunks of R code through knitr. The documents can be exported with pandoc to LaTeX, PDF (via LaTeX), Word, or HTML formats showing the output of R chunks (and/or de R code) including plots and tables.

Filter by
Sorted by
Tagged with
2 votes
1 answer
412 views

Using tikz with \pause command in rmarkdown or quarto presentation

I'm trying quarto for my slides and wondering how to use \pause in tkiz code. Minimum working example (Test.qmd) is below for reference. --- title: "Test Slides" format: revealjs: ...
0 votes
1 answer
277 views

Error converting from Rmarkdown to PDF LaTeX

I am using Rmarkdown using Rstudio to generate PDF documents via tex. In the markdown, I write the python code chunk for reproducibility. However, I get the following error. Quitting from lines 23-30 (...
0 votes
1 answer
23 views

date beamer metropolis using rmarkdown

I am trying to make a beamer presentation with the Metropolis theme. I adapted the colors like this: output: beamer_presentation: latex_engine: xelatex theme: &...
2 votes
1 answer
45 views

Making conclusion slide beamer using Rmarkdown

I am trying to make a conclusion slide like this one in beamer using Rmarkdown. However, I want to make the blue rectangle at the left side of the slide with the grey one following it. The problem is ...
0 votes
1 answer
1k views

How to add LaTeX to Rmarkdown to be within text rather than centred when knitted?

I am writing text in RMarkdown that includes equations that I type in LaTeX. However, rather than including them on the same line within the text, it breaks the line and centres the equation. How can ...
0 votes
1 answer
139 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 ...
1 vote
1 answer
110 views

Illegal parameter number in definiton of beamer frame RMarkdown

While I want to render my Rmarkdown file as beamer pdf with Latex. I get the error: !Illegal parameter number in definiton of \beamer@doifinframe I get this only within the columns Tag. --- title: &...
1 vote
2 answers
1k views

R markdown / Plotly R with LaTeX unable to generate plot and get error on a file name with hyphen

I am using LaTeX for some formatting, and trying to generate a PDF file with a plotly R plot as a png. The following piece of code gives me an error as show below. It seems like a problem with the ...
0 votes
0 answers
15 views

Automatically replace verbatim environment with lstlisting? [duplicate]

To generate all of my Python code output into LaTeX, I have used Quarto, which formats the output of all Python code blocks in the verbatim environment. For example, take the following code in Quarto ...
0 votes
1 answer
105 views

table of contents unnumbered because of the interference of a graphic algorithm displaying packages

Hi I am trying to compile the code that displays this algorithm below I copy and past the code after I have converted to latex from a Rmd file, but its not working, than I go back and add the ...
1 vote
2 answers
345 views

LaTeX adjustbox shrinks table

I've been having a strange issue with my LaTeX code with adjustbox. I'm currently using RMarkdown which converts markdown to LaTeX codes, and I'm having trouble narrowing down where it is causing the ...
0 votes
0 answers
16 views

RMarkdown giving error with \`{\i}

One of the references in my bibtex files contains \`{\i} in the author's name, but when attempting to knit to PDF I get the following error: ! LaTeX Error: Unicode character ̀ (U+0300) not set up ...
1 vote
1 answer
525 views

Color change in beamer at R markdown

Esteemed, I'm having trouble putting together a beamer presentation. I would like to put the title, the footer and the items in green tones. I appreciate any help. title: "long title" date: &...
0 votes
1 answer
185 views

I am getting error "Missing \endcsname inserted." while compiling a latex document

I am trying to create an R Markdown template package so that I can prepare reports repeatedly in a consistent format. I prepared the R Markdown file, and the Latex file as well. I can compile the ...
0 votes
1 answer
327 views

hyperref-langpatches.def file not found in rmarkdown pdf knitting

I tried to compile a pdf in rmarkdon but the error shows hyperref-langpatches.def file not found. However, I can generate the pdf using the .tex file generated during the process.
0 votes
1 answer
1k views

R Markdown failed to render PDF and render .tex instead

I have been using RMarkdown via R Studio to render PDF for a while but suddenly it failed to render PDF with the following error. Instead of PDF, it render a .tex file which I'm unsure why. "C:/...
0 votes
1 answer
331 views

Error while set language, despite package is already installed

I'm writing a document in R markdown and using latex for figures and tables. I need the captions in Portuguese, so I try this: R markdown file: --- output: pdf_document: includes: ...
2 votes
2 answers
902 views

Aligning columns of the matrix with the labels on r markdown

I am unable to align the columns of my matrix with the column labels. I have attached my code below along with the output. Can someone help me fix this pls ? I want to align 0, 1, 2, 3 to the ...
0 votes
1 answer
22 views

How can I do the content of the slide called "Apartado iv)" smaller to read the code entirely? R studio, beamer presentation

--- title: "QUESTION 8 (a)" author: "Ana Márquez" date: "17/2/2023" output: beamer_presentation: theme: "Dresden" colortheme: "beaver" ...
1 vote
1 answer
57 views

I do not understand how it works the slides in beamer presentation in R Studio

My code in RStudio is the next one: --- title: "QUESTION 8 (a)" author: "Ana" date: "17/2/2023" output: beamer_presentation: theme: "Malmoe" ...
0 votes
1 answer
511 views

I get this error wit R Studio: ! LaTeX Error: Unicode character β (U+03B2) not set up for use with LaTeX

My code in RStudio is the next one: --- title: "QUESTION 8 (a)" author: "Ana Márquez" date: "17/2/2023" output: beamer_presentation: theme: "...
1 vote
1 answer
361 views

! Package amsmath Error: \begin{gather} allowed only in paragraph mode

I need to align the following equation in R markdown: $$\begin{gather*} \hat{SalePrice} =2016.923+54.269SquareFeet+23246.083Baths+16761.402Bedrooms\\ -41955.452winter1-7486.937age2+4077.030age3+12506....
0 votes
1 answer
99 views

Table caption misplaced and no list of tables generated

I am writing an APA-style document in RMarkdown using Papaya package, which compiles into LaTeX, and then to pdf, by pandoc. I know a small amout of LaTeX, and I am not familiar with RMarkdown, and ...
1 vote
1 answer
353 views

Is there a way to use latex packages in markdown file?

I'm trying to use the 'actuarialangle' code but it doesn't work in markdown file, it just works when i use Rmarkdown file... --- title: "Using more LaTeX packages" output: pdf_document: ...
0 votes
0 answers
87 views

Enumerate APA-style bibliography entries in R Markdown using biblatex and \nocite{*}

I am using R Markdown to automate my academic CV. As is common with CVs, particularly on the job market (which I am), the entries in each section should be numbered so that members of the search ...
0 votes
0 answers
93 views

How to wrap text around images in Bookdown when exporting to epub?

My question is pretty straight-forward. I have read all the threads to find a solution but can still not succeed in wrapping text around images when exporting to epub. When exporting to html and pdf ...
1 vote
1 answer
239 views

R Markdown LaTeX Tufte font cannot be found

I'm new to getting LaTeX working in R Markdown and have the following error when I tried to knit the tufte template from github: ! Package fontspec Error: The font "Kaiti SC" cannot be found....
1 vote
1 answer
471 views

Changing default font size in Frankfurt Beamer slides without impacting the spacing on the navigation bar

I am trying to reduce the standard font size in a Beamer presentation, created in Rmarkdown, using the Frankfurt theme. When I set fontsize: 10pt (as desired) in the YAML it impacts the spacing in the ...
0 votes
0 answers
28 views

How to insert a section header on its own page centered vertically and horizontally?

I'm using R Markdown and knitting to pdf. I'd like to have a # Header centered vertically and horizontally on its own page. Unfortuinately, \center # Header \center and \begin{centering} # Header \...
0 votes
1 answer
463 views

Leave Header Blank Fancyhdr

I am new to coding and Latex so please forgive me as I'm sure this is a very straight forward solution. I am creating a PDF report using RMarkdown with a .tex file to control the header, margins, and ...
2 votes
1 answer
174 views

\undefinedpagestyle - r markdown won't compile to PDF if I add \usepackage{fancyhdr} and \pagestyle{fancy}

I am struggling with building the basic pdf document for my thesis in markdown. It worked well, until I tried to add a header with \usepackage{fancyhdr}. Then it returns the error ! Undefined control ...
0 votes
1 answer
186 views

R-Markdown pdfLatex won't work when rendering shape ="\U0001f693"

This is my first time using r-markdown and running into problems rendering the symbol above. Everything else works great. It also works in r in ggplot2 but won't work in r-markdown. When I include &...
0 votes
0 answers
105 views

How to render citations inside a beamer subtitle in Rmarkdown?

I'm trying to combine both adding subtitles to beamer frames and rendering citations inside them in Rmarkdown. In LaTeX I've been able to do this with the following code: \begin{frame}{Kontrastive ...
0 votes
0 answers
97 views

Some issues with fontspec using R Markdown

I use an R Markdown file to write articles and to be able to output both Latex and Word documents. I use a csl file for my references and my mainfont is set with fontspec. When I compile my file, I ...
2 votes
1 answer
79 views

Can you add r code to a beamer note in R Markdown?

For example, \note{ ```{r, ex1} curve(x) ``` } When I try, my tex file contains the following \note{ ![](.../figure-beamer/ex1-1.pdf)<!-- --> }
0 votes
1 answer
41 views

Rmarkdown citation fails in tablenotes environment

Rmarkdown citation @bibtexkey fails when used in the tablenotes environment. Is there a way to fix this? Bibtex source for the two citations in the upcoming MWE of the table @Article{Lundberg2017, ...
1 vote
2 answers
411 views

Fill 16:9 page with LaTeX in R-project

I'm programming a presentation based on different graphs inside R-project that use LaTeX to create pdf documents. I'm using LaTex with the beamer class and i would like to fill the page with the ...
1 vote
0 answers
443 views

Cross-reference latex table in rmarkdown

I try cross-reference latex tables in RMarkdown. The hyperlink is generated (clicking on ?? leads to the table) but the table number is not displayed, instead ?? is displayed. I tried a version with ...
1 vote
1 answer
1k views

Logo and Shortinstitute in beamer R Markdown

How do we add a logo on a beamer in R Markdown title page? Also, how do I add the shortinstitute function for the footline in beamer R Markdown? Can someone please help with the correct commands.
1 vote
1 answer
296 views

\! math symbol in R markdown to beamer with xelatex and lualatex failing

The following minimal example works correctly within RStudio to generate a pdf beamer slide --- output: beamer_presentation: latex_engine: "pdflatex" --- ## \[ Z \not\!\perp\!\!\!\...
0 votes
1 answer
560 views

Problem with footer in rmarkdown

I have been trying to add a footer to this report, generated with rmarkdown; however, whatever I do, it just doesn't work for me. --- header-includes: \usepackage{fancyhdr} \usepackage{graphicx}...
1 vote
1 answer
2k views

the text is cut in the rmarkdown pdf file [closed]

As you can see in the picture, the text is cut off at the end of the page. What could done to prevent this? I have executed the following code and attached a pic for a better explanation. I would like ...
0 votes
0 answers
37 views

Issue with & for latex and eulerr

I'm having some issues with rmarkdown, where I can't generate a pdf because I use "&" when I build a eulerr diagram. The error is : ! Misplaced alignment tab character &. I do use '&...
0 votes
1 answer
393 views

How can I mark a portion of R code to be bold in Latex output?

Rmarkdown YAML output: pdf_document: latex_engine: xelatex classoption: x11names documentclass: article header-includes: - \PassOptionsToPackage{x11names}{xcolor} - \usepackage{eso-pic,...
1 vote
1 answer
273 views

\renewcommand{\arraystretch}{1.3} makes ! LaTeX Error: \caption outside float in Rmarkdown

I'm writing my thesis and want to include several tables in Rmarkdown. The first table is long and includes several LaTeX symbols for regression parameters $\beta$. The rows seemed a bit squished so I ...
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 ...
1 vote
1 answer
1k views

TeX capacity exceeded, sorry [parameter stack size=10000] [duplicate]

I am a Spanish linguist working on writing my dissertation using RMarkdown. My document was compiling fine into a pdf until I tried to add examples and glosses using the gb4e package. I am working on ...
0 votes
1 answer
382 views

Generating fullwidth longtable in the tufte-latex style, when using Pandoc with Rmarkdown

I am writing a book in Rmarkdown using the tufte package; which uses tufte-latex for pdf output. My current issue is that I have not found a way to have a table extend wider than the normal margin of ...
0 votes
1 answer
391 views

Change author affiliation symbols to numbers in Rmarkdown rticles

For a manuscript I wrote using the rticles package in Rmarkdown, I am asked by the journal to change the reference to author affiliations from superscript symbols to superscript numbers. So in the ...
0 votes
1 answer
151 views

Adapting Latex class and template file to an Rmarkdown template

I'm trying to adapt an unofficial University of South Florida Latex document class and template file which are available from http://shell.cas.usf.edu/~saito/grad/ into an Rmarkdown template similar ...