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
1 vote
1 answer
29 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: ...
  • 11
1 vote
1 answer
32 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....
  • 111
0 votes
0 answers
20 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
44 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
0 votes
0 answers
19 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 \...
  • 119
0 votes
1 answer
70 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
52 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
72 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 ...
  • 1,393
2 votes
1 answer
47 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)<!-- --> }
  • 23
2 votes
1 answer
83 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 ...
  • 21
0 votes
1 answer
30 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, ...
  • 346
0 votes
0 answers
296 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 ...
  • 346
1 vote
1 answer
219 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\!\!\!\...
1 vote
0 answers
290 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: ...
  • 8,391
0 votes
0 answers
140 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 ...
  • 101
1 vote
1 answer
980 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
1 answer
359 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}...
0 votes
0 answers
30 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 '&...
1 vote
1 answer
732 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.
  • 11
1 vote
1 answer
159 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 ...
2 votes
2 answers
613 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
185 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,...
  • 13
1 vote
1 answer
193 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 ...
0 votes
1 answer
664 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 ...
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 ...
  • 13
0 votes
1 answer
181 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
236 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 ...
1 vote
1 answer
375 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 ...
  • 417
0 votes
1 answer
126 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 ...
  • 1
0 votes
2 answers
370 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 ...
  • 113
0 votes
1 answer
387 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 ...
  • 53
2 votes
1 answer
168 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 ...
0 votes
1 answer
83 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 ...
  • 101
0 votes
1 answer
77 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 ...
  • 55
0 votes
1 answer
908 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
0 answers
178 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. ...
  • 385
0 votes
1 answer
277 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 ...
  • 1
1 vote
1 answer
638 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 ...
0 votes
1 answer
78 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: "...
0 votes
1 answer
79 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
1 answer
338 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 ...
1 vote
1 answer
248 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 ...
  • 115
0 votes
1 answer
240 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 ...
  • 115
0 votes
1 answer
435 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}^...
0 votes
0 answers
84 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 ...
  • 115
0 votes
1 answer
92 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 ...
1 vote
1 answer
254 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. ...
  • 115
0 votes
1 answer
210 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 (...
  • 139
0 votes
0 answers
47 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 ...
  • 115
0 votes
1 answer
62 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 ...
  • 115