Skip to main content

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
35 views

Inserting citation within Latex figure caption

I am writing my thesis and am struggling to create a citation within Latex code. I get following error: Warning: LaTeX Warning: Citation `2023TylerIyengarTestingRobustnessANES' on page 12 undefined on ...
Cosmic Outlaw's user avatar
0 votes
1 answer
39 views

How to create tufte-book frontpage in Rmarkdown

I am utilising rmarkdown to create some PDF handouts for a therapy group. Tufte handout is working brilliantly and I can combine markdown and some latex elements, this all is very well. My main tool ...
r0berts's user avatar
  • 135
0 votes
0 answers
30 views

Cannot print on paper a PDF generated by Quarto using adobe reader on windows PC [closed]

After working for quite a long time with my data, I get a beautiful pdf report using RSTUDIO and quarto, everything is smooth and fine, ultil I have to print the report. Using de RSTUDIO default ...
Juan A's user avatar
  • 1
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
0 votes
1 answer
50 views

LaTeX rendering in source mode but can't knit pdf

I am getting an error with LaTeX saying "You may need to add $ $ around a certain inline expression". The text renders correctly when I look at it in the source mode but I can't knit it. I ...
user24903005's user avatar
1 vote
1 answer
32 views

remove blank space before multi-column environment in pdf produced by rmarkdown

My problem arises from https://bookdown.org/yihui/rmarkdown-cookbook/multi-column.html, where I borrow the setting columns.tex which reads \newenvironment{cols}[1][]{}{} \newenvironment{col}[1]{\...
John Stone's user avatar
0 votes
1 answer
35 views

Problems with text alignment in paragraphs when creating a LaTeX template in RMarkdown

Although I have a lot of experience with R, I'm fairly new to LaTeX, and it's proving to be quite a challenge. I work as a biologist and my current project is to automate the creation of labels for ...
Nico Echarren's user avatar
0 votes
1 answer
27 views

How to output text in ukrainian language in r markdown

I want to write book and I need outputing text ib ukrainian language (forma pdf). I dont understand how to do it. I tryed using "babel" but it didnt work.
Александр Минаев's user avatar
0 votes
0 answers
90 views

Alter the position of barcode in \begin{pspicture} within a rmarkdown document

I'm trying to alter the position of a barcode in a document, but so far I have found nothing... This is my Rmd file (with the YAML header between these two ---)... --- geometry: paperheight = 8cm, ...
tueftla's user avatar
  • 175
4 votes
3 answers
233 views

Barcode output in rmarkdown document

I want to have a barcode like given in this answer Can't generate code128 barcode There also stands that it doesn't work with pdflatex engine - it has to be changed to the xelatex engine and that's ...
tueftla's user avatar
  • 175
0 votes
1 answer
43 views

Adjust right side text margin and header section alignment [duplicate]

I'm using Rmarkdown to produce a landscape pdf document with xelatex. For my YAML header I'm using output: pdf_document: latex_engine: xelatex keep_tex: true includes: in_header: '...
PhDavey's user avatar
  • 103
1 vote
0 answers
382 views

Error when knitting pdf in Rmarkdown: tlmgr.pl: Remote database older than the local installation

My Rmarkdown script stopped working all of a sudden (trying to knit a pdf), and it's giving me the following error. tlmgr.pl: Remote database (revision 69718 of the texlive-scripts package) seems to ...
monica_catg's user avatar
0 votes
1 answer
58 views

Error with tableofcontents while using ngerman in Markdown

I am new here and I need some help with my Markwodn document. I encoutered a nasty problem: When I try to knit my PDF, it gives me this error: tlmgr.pl: Remote database (revision 69711 of the texlive-...
Nepomuk's user avatar
  • 11
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
1 vote
1 answer
160 views

Increasing font size for section headings using titlesec in rmarkdown bookdown package

I would like to increase the font size of my chapter titles. I am producing a pdf using bookdown package in rmarkdown. I have followed this answer, but I get the result that my chpater headings are ...
Mark Davies's user avatar
1 vote
1 answer
76 views

Prevent title page, preface etc from being listed in table of contents

I am producing a pdf in rmarkdown using the bookdown package. I have a .Rmd file that contains a title page, some acknowledgements etc. I then place my table of contents after these pages, and before ...
Mark Davies's user avatar
0 votes
1 answer
44 views

How can I solve the error below while trying to knit codes into PDF

! Undefined control sequence. l.80 cat(``Times Table for,n,:\n '') for (i in 1:table\_size) \{ Error: LaTeX failed to compile Loop-controls.tex. See https://yihui.org/...
Bran's user avatar
  • 1
1 vote
1 answer
143 views

Is it possible to use endnotes with references in Rmarkdown?

I’m finalizing a draft article for submission to peer review as a pdf. I originally wrote the paper using Rmarkdown with footnotes that include citations but I now need to convert the footnotes to ...
Kasey Zapatka's user avatar
2 votes
0 answers
62 views

How to page break in long author list? APA6

I've been trying to knit an article with a very long author list using RMarkdown Pandoc. But the long list seems not to start on a new page. Half of them cannot be shown on the first page since it's ...
Arjen H's user avatar
  • 21
0 votes
1 answer
77 views

Inserting R code chunks in Rmarkdown making an error

My little demo code borrows from here is given as follows (test.rmd): --- documentclass: article output: pdf_document: number_sections: yes keep_tex: no geometry: "left = 2.5cm, right = ...
John Stone's user avatar
1 vote
2 answers
243 views

TinyTex from RStudio Rmarkdown knitting to pdf. "Approximately" sign in ggplot annotate throws error

Reproducible example: require(ggplot2) myggplot <- ggplot(data.frame(x=1:2, y=1:2), aes(x=x,y=y)) + geom_point() z <- 16.9 myggplot <- myggplot + annotate(geom="text", x= 1.5, ...
Reader 123's user avatar
0 votes
0 answers
150 views

LaTeX table with kableExtra renders cell background that overlaps with row groups when knitting to PDF

I'm creating a LaTeX table with the kableExtra package in R Markdown and knitting to PDF. I've used the cell_spec() function from kableExtra to apply some simple conditional formatting to a few of the ...
Ben_89's user avatar
  • 101
0 votes
0 answers
791 views

R markdown ! Package amsmath Error: \hat allowed only in math mode

Here is the error I'm getting trying to knit my R markdown file. output file: HW4.knit.md ! Package amsmath Error: \hat allowed only in math mode. Error: LaTeX failed to compile HW4.tex. See https://...
Vladimir Lenin's user avatar
1 vote
2 answers
67 views

How to solve in RMarkdown pdf error related with complex centered subtitle

I am working with RMardown and I am trying to add a centred subtitle containg model syntax that I am going to show at that section --- title: "example" author: "X" date: "2023-...
12666727b9's user avatar
0 votes
0 answers
60 views

R Markdown thesisdown fix(?) indentation

Using thesisdown to write my Masterthesis I was wondering about the default indentations of the package: If you check the pictures below, all the pages (of the default 'knitted' thesisdown rmd-files) ...
5ilver4rrow's user avatar
0 votes
0 answers
299 views

Error when iterating an RMarkdown using kableExtra::column_spec()

This is my best shot at a minimum example, but it's still a little long and convoluted. I've created an RMarkdown that generates a PDF of the cars dataset using Pandoc and LaTeX. I want the width of ...
juliandeanmoran'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
0 votes
2 answers
981 views

Help with writing a formula and symbols in r-markdown

How can I write the above formula to then knit it as pdf please? I am very new and I am still learning the basics. This is what I tried writing: \begin{center} $\nabla ~Y$ $f$(**Y**) = $\nabla$ (**Y**...
Rick The Sizzler's user avatar
0 votes
1 answer
66 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: &...
Marie's user avatar
  • 25
2 votes
1 answer
239 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 ...
Marie's user avatar
  • 25
0 votes
1 answer
25 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" ...
Ana's user avatar
  • 17
1 vote
1 answer
285 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" ...
Ana's user avatar
  • 17
0 votes
1 answer
1k 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: "...
Ana's user avatar
  • 17
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
821 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: ...
João G's user avatar
  • 11
1 vote
1 answer
1k 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....
ebrahimi's user avatar
  • 111
0 votes
0 answers
152 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 ...
joafr's user avatar
  • 1
0 votes
0 answers
59 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 \...
Tea Tree's user avatar
  • 139
0 votes
1 answer
234 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 &...
mikeyisleany's user avatar
0 votes
0 answers
138 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 ...
domi's user avatar
  • 1,525
2 votes
1 answer
181 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)<!-- --> }
Rex's user avatar
  • 23
2 votes
1 answer
253 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 ...
Tamila's user avatar
  • 21
0 votes
1 answer
54 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, ...
mugdi's user avatar
  • 431
1 vote
0 answers
766 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 ...
mugdi's user avatar
  • 431
1 vote
1 answer
388 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\!\!\!\...
user2252705's user avatar
2 votes
2 answers
687 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: ...
MYaseen208's user avatar
  • 8,579
0 votes
1 answer
395 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 ...
Eva's user avatar
  • 129
1 vote
1 answer
5k 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 ...
EnriqueGG's user avatar
0 votes
1 answer
870 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}...
EnriqueGG's user avatar
0 votes
0 answers
42 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 '&...
ibroketheserver's user avatar