Issue I’m using RStudio 0.98.1103. It is said in release notes that they’ve added “Syntax highlighting modes for XML, YAML, SQL, Python, and shell scripts.” But when I write something like this: “`{r engine=’python’, highlight=TRUE} print(“Hello World”) “` – I
Continue readingTag: r-markdown
Highlighting bash code with knitr / rmarkdown
Issue I’m trying to generate an HTML report using RStudio, R Markdown and knitr. In the report I would like to display some bash code. I do not want to run the code but I would like it to be
Continue readingDifferences in R Markdown syntax highlighting for in-line code
Issue The following minimal R Markdown file minimal.Rmd produces different minimal.html output (via “Knit HTML” in RStudio) depending on my system. The first is the result on my Windows 8 machine. The second is the result on my Windows 7
Continue readingCustom highlighting style in rmarkdown
Issue Is there a way to use a custom highlighting style in rmarkdown? Manual is a bit silent regarding that and the closest to that is to make a full blown custom css file for everything, that would however work
Continue readingHow to syntax highlight inline R code in R Markdown?
Issue This question is similar to consistent code html inline and in chunks with knitr. Instead of .Rhtml documents, I want to highlight inline R code in R Markdown documents, e.g., after `r “plot(cars, main = ‘A scatterplot.’)”` is compiled
Continue readingWhich is the proper language for fenced code blocks when representing directory & file structure in Markdown syntax?
Issue I want to represent my directory & file structure in Markdown syntax with fenced code blocks like this: 📁project ├── 📁client └── 📁server The thing is that my Markdown linter and other Markdown Style Guides recommend to Always specify
Continue readingStata syntax highlighting in Rmarkdown
Issue I am using Bookdown and Rmarkdown to compose a technical book for Stata users. I would like to include Stata highlighting syntax in the chunks of code, but I am not interested in actually executing Stata from Rstudio. I
Continue readingRmarkdown with pandoc templates, apply lua filter on intermediate .tex
Issue I’m trying to use lua filters to capture images in my manuscript and list their caption in a special \section at the end of it. I am working on a rmarkdown document that itself uses a .tex template. I
Continue readingPut 2 chunks of code side by side in RMarkdown or Quarto?
Issue How can I put 2 chunks of code side by side in the output file of RMarkdown or Quarto ? Code library(dplyr) mtcars %>% select(gear) library(dplyr) select(mtcars, gear) Desired layout in the PDF or HTML file Solution — title:
Continue readingAvoiding repeated creation of objects in RMarkdown document through if statement
Issue I’m working on a RMarkdown document that uses objects that take a long time to create and transform. The syntax is similar to this: — title: “Example” author: “Test” date: “October 29, 2015” output: pdf_document — Example “`{r} test_exc
Continue readingHow to modify "downcute" CSS from rmdformats, to have author as in "readthedown"
Issue My understanding of CSS is less than basic. I have a vague idea of what some elements do, and I manage to customize for example their colour or font size. But I really don’t understand how to achieve the
Continue readingInclude HTML files in R Markdown file?
Issue Quick Summary How do I place HTML files in place within an R Markdown file? Details I have created some nice animated choropleth maps via choroplethr. As the link demonstrates, the animated choropleths function via creating a set of
Continue readingHow to escape single quote in Flexdashboard Navbar Menu?
Issue I’m using R markdown to create a flexdashboard. I’m having difficulty escaping a single quote in the title of one of my navbar menus. I would like for my menu title to include a single quote and have tried
Continue readingHow to make Ioslides a solid white background?
Issue Ioslides for Rmarkdown have this gradient background, and I would like it to be solid white. I tried two different ways to remove the gradient effect using a css file, but neither have been successful. body { background-color: white;
Continue readingHow to get gray background in R Markdown for plain text code fences?
Issue In xaringan all code fences for various programming languages display a gray background when I use the default YAML. The code fence background is gray, just like this: — title: "Presentation Ninja" output: xaringan::moon_reader: lib_dir: libs nature: highlightStyle: github
Continue readingR Shiny and Markdown – custom css font in pdf
Issue I have used the gfonts package to download a css file which contains a custom font for use in my Shiny app. The app has a reporting function, that generates a RMarkdown PDF. Is there anyway to add this
Continue readingpagedown html resume – How to move disclaimer section within aside section to the last page?
Issue Taking the template resume from pagedown as an example, I would like the disclaimer section (currently on the bottom right of the first page, reading "This resume was made with the R package pagedown. Last updated on 2021-08-18.") moved
Continue readingAdd tags to post summaries of lithium themed hugo blogdown website
Issue Using the guidance linked to at Add template for taxonomies to Blogdown default theme I was able to add tags to show-up at the top of my posts and create a /tags page — for my lithium themed hugo
Continue readingHow to get gray background in R Markdown for plain text code fences?
Issue In xaringan all code fences for various programming languages display a gray background when I use the default YAML. The code fence background is gray, just like this: — title: "Presentation Ninja" output: xaringan::moon_reader: lib_dir: libs nature: highlightStyle: github
Continue readingEvaluate html script stored in R object in R-markdown
Issue In Rmarkdown, how can I implement/evaluate some HTML code stored in an R character object? If I explicitly paste the code as plain text, it works as expected e.g. <details><summary>Show/hide.</summary>SomeText</details>. However, I need to evaluate this from an R
Continue readingreferencing a nested tab in rmarkdown/js?
Issue I’m not too familiar with JavaScript or CSS but I use bits and pieces of it in RMarkdown. I’m working on a document that has a page with tiles/buttons that are used as navigation buttons to get to other
Continue readingreferencing a nested tab in rmarkdown/js?
Issue I’m not too familiar with JavaScript or CSS but I use bits and pieces of it in RMarkdown. I’m working on a document that has a page with tiles/buttons that are used as navigation buttons to get to other
Continue readingFeeding R data to html in R markdown, where the output is a Word document
Issue I would like to automatically create a table in R Markdown, where the table is created in html, but the data comes from R. Could anyone help me with how to do this? R data: dat <- structure(list(rn =
Continue readingFeeding R data to html in R markdown, where the output is a Word document
Issue I would like to automatically create a table in R Markdown, where the table is created in html, but the data comes from R. Could anyone help me with how to do this? R data: dat <- structure(list(rn =
Continue readingCan't suppress error message in R Markdown?
Issue I’m making a tutorial using RMarkdown and I can’t suppress the error message I’m getting. The reason I’m suppressing the error is because the code I’m running requires an API key and I’m intentionally leaving it out. I just
Continue readingHow to add dropdown menu on tab / tabset [rmarkdown / bootstrap]
Issue Documentation for Bootswatch suggests I can use a dropdown menu from a tab in a tabset: How can I achieve this with Rmarkdown? I’ve tried: # SECTION 1 {.tabset .tabset-fade} ## Section 1.1 ## Section 1.2 {????something here?????} ###
Continue readingIn RMarkdown how to source css file in a chunk?
Issue I need to know how to source a CSS file to be applied to my .Rmd report, using a chunk in RMarkdown? Is it possible? Actually, I would like to make .css file become a parameter. Something like this
Continue readingincluding a interactive 3D figure with knitr
Issue Using knitr it is possible to embed a rgl 3D graphics in a html document from a Rmarkdown source file: “`{r setup} library(rgl) knit_hooks$set(rgl = hook_rgl) x <- sort(rnorm(1000)) y <- rnorm(1000) z <- rnorm(1000) + atan2(x,y) “` “`{r,
Continue readingHow to remove border box around R Markdown HTML output using Knitr chunk options
Issue When knitting R code chunks to HTML in R Markdown, it’s possible to alter certain visual elements by setting chunk options (figure height, displaying messages/warnings, etc.). I’m curious about whether there’s a chunk option to remove the gray border
Continue readingCustomize css for input/output chunks in xaringan
Issue I use xaringan to make presentations and would like to customize the CSS for the input and output R chunks. Initially, I thought I could use the class.source and class.output arguments from knitr to set the CSS classes. knitr::opts_chunk$set(class.source
Continue readingVertical top align figures of different height in Rmarkdown
Issue I have an Rmarkdown code chunk where I want to display two external figures of different heights, and have them aligned vertically at the top. I am outputting an HTML document. Here is the code “`{r, fig.show=’hold’, out.width="25%"} include_graphics("leftfig.png")
Continue reading