2022 Developer Survey is open! Take survey.

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
0 votes
0 answers
14 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, ...
user avatar
  • 326
0 votes
0 answers
22 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 ...
user avatar
  • 326
0 votes
0 answers
26 views

How to include an algorithm in a Rmarkdown template

I have the following document. I am using the arxiv_article style. This is a predefined template that comes with the rticles package. I am trying to insert some Latex, but I am running into an error. ...
user avatar
  • 101
1 vote
1 answer
83 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\!\!\!\...
user avatar
1 vote
0 answers
89 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: ...
user avatar
  • 8,359
0 votes
0 answers
44 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 ...
user avatar
  • 1
1 vote
1 answer
37 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 ...
user avatar
0 votes
1 answer
44 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}...
user avatar
0 votes
0 answers
27 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 '&...
user avatar
1 vote
1 answer
125 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.
user avatar
  • 11
0 votes
1 answer
57 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 ...
user avatar
2 votes
2 answers
155 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 ...
user avatar
0 votes
1 answer
36 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,...
user avatar
  • 13
1 vote
1 answer
73 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 ...
user avatar
0 votes
1 answer
70 views

How to add LaTeX to Rmarkdown to be within text rather than centered 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 centers the equation. How can ...
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
1 answer
92 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 ...
user avatar
0 votes
1 answer
136 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 ...
user avatar
0 votes
1 answer
156 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 ...
user avatar
  • 397
0 votes
1 answer
61 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 ...
user avatar
  • 1
0 votes
2 answers
165 views

Missing number, treated as zero (\hspace, I think)

At the outset let me say I am not even a LaTeX beginner - I know almost nothing. I have an .tex file named title.tex which was developed on a Windows platform and is used in an R markdown document ...
user avatar
  • 113
0 votes
1 answer
127 views

how to reduce space between authors via header-includes?

I am using scholarly-metadata.lua and author-info-blocks.lua as per the example below in R Markdown: --- title: "My title" author: - Mario Modesto-Mata: email: paleomariomm@gmail.com ...
user avatar
  • 53
2 votes
1 answer
89 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
1 answer
64 views

Tikz `regular polygon` in Rmarkdown

I am looking to produce a tikz figure with a node triangle. Most ressources I have found online use \usetikzlibrary{shapes} and its regular polygon. Rmarkdown seems unable to use it. This will work in ...
user avatar
  • 101
0 votes
1 answer
47 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 ...
user avatar
  • 55
0 votes
1 answer
535 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:/...
user avatar
0 votes
0 answers
65 views

Extract image from RMarkDown HTML

I often generate reports using RMarkDown. These include images based on analyses which are encoded in the knitted HTML file in URI scheme format. The following RMarkDown can be knitted to such a file. ...
user avatar
  • 375
0 votes
1 answer
167 views

„Undefined Control sequence“ when changing to „et al“

I‘m very new to latex and try to write my bachelor thesis with Rmarkdown and tinytex (and got a Template from my Professor). My problem is, that I can‘t change the german u.a. To the latin „et al.“ in ...
user avatar
  • 1
1 vote
1 answer
278 views

Undefined control sequence in R Markdown from \frac{}{}

I am a beginner working in R markdown. I can compile the given minimally reproducible example below as an HTML. But, when I try to compile the RMD file as a PDF, I get the following error: ! Undefined ...
user avatar
0 votes
0 answers
25 views

How to include a C plus plus file into rmarkdown while using the Rcpp engine to render the file's text content

So I have an rmd file which contains my analysis of some cpp source code which is in a file called twoSum.cc. I simply want to be able to edit this cpp seperately and the rmarkdown seperately. I do ...
user avatar
0 votes
1 answer
44 views

awesome-cv indenting issue

I am using the awesome-cv template and after the first entry in some categories, the second entry has an indent. Here is my pared down code to illustrate the issue: --- name: name position: "...
user avatar
0 votes
0 answers
23 views

Last pages numbering missing in R MarkDown

So I have finished this long R Markdown Document (645 pages in total) but I noticed that the last 6 do not number. Thus, my output shows "Page 639 of 639", then "Page 640 of 639" ...
user avatar
0 votes
1 answer
58 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 ...
user avatar
1 vote
1 answer
197 views

Updating R Counter in for loop

I have written a for loop in LaTeX using the forloop package, and on each iteration, I would like to use a different subset of a vector that is defined in an R chunk above. However, each iteration of ...
user avatar
0 votes
0 answers
20 views

RMarkdown Multicol environment with ggplot

I'm looking to insert a ggplot in a multicol environment, but I'm running into some issues. Specifically, I'm receiving the following error when attempting to call R code within the multicol ...
user avatar
0 votes
1 answer
121 views

How do I globally add a border to all inline code that uses /lstinline?

I am using R Markdown and Latex with memoir to compile a book to pdf. I am using lstsetfor the normal code blocks while the inline code is converter and uses \lstinline. I would like to globally add a ...
user avatar
  • 105
0 votes
0 answers
51 views

Tex Template for markdown: Command \circledS already defined [duplicate]

I'm rewriting old latex code for my university's thesis template to make it work with R markdown. I want it to do as little as possible besides creating a title page, copyright page, English abstract ...
user avatar
0 votes
1 answer
91 views

How do I globally change the style of the horizontal rule when using RMarkdown to pdf?

I am using R Markdown and Latex with memoir to compile a book to pdf. The author has used the *** syntax for horizontal dividers. Checking the compiled .tex file I can see that the conversion from ...
user avatar
  • 105
0 votes
1 answer
252 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
0 answers
58 views

How do I globally change the longtable font size?

I am using R Markdown and Latex with memoir to compile a book to pdf. There are tables in the book that are too wide and go into the margins. Checking the compiled .tex file I can see that the ...
user avatar
  • 105
0 votes
1 answer
68 views

Tables appears in disorder in appendix section

I'm writing my Ms thesis with R markdown, and I have a problem with the Appendix section. I need to put some tables in the appendix section but when I render it the header of the subsection appears ...
user avatar
1 vote
1 answer
147 views

How to replace all : with * or x in an ANOVA table?

I am using bookdown::pdf_document2. Some journals require all the interaction terms to be formatted as Term A * Term B or Term A x Term B, not Term A : Term B as default in the R's ANOVA table. ...
user avatar
  • 115
0 votes
1 answer
167 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 (...
user avatar
  • 103
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
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
2 votes
1 answer
847 views

Citation within a Latex figure caption in rmarkdown

I'm struggling to put a citation inside a figure caption. I'm writing my document in rmarkdown using markdown citations i.e. [@bibtexCitationkey], but using LaTeX for figures and tables. I'd like to ...
user avatar
1 vote
1 answer
149 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....
user avatar
0 votes
2 answers
61 views

How to center and scale a tikz picture at the same time for beamer

I need to scale donw a Tikz picture and center it on my frame (I am using Rmarkdown). I have tried several options: scalebox, transform canvas, adjustbox, scale, begin{center}, centering, etc... But ...
user avatar
1 vote
0 answers
164 views

Error in trying to write $\bar{X}$ in R markdown [closed]

I want to write the distribution of the average of n i.i.D's. However I keep receiving the following error when I write the following in R markdown. $$\bar{X}\sim N(\mu_X,\frac{\sigma^2}{n})$$ Error: ...
user avatar
  • 111
1 vote
0 answers
48 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: &...
user avatar
  • 11