title |
---|
Testing svg in mathjax |
Run with:
pandoc -s --mathjax test-die.md -o test-die.html
title |
---|
Testing svg in mathjax |
Run with:
pandoc -s --mathjax test-die.md -o test-die.html
library(ggplot2) | |
library(grid) | |
element_box_break <- function (fill=NULL, colour = NULL, linewidth = NULL, linetype = NULL, lineend = NULL, | |
color = NULL, arrow = NULL, inherit.blank = FALSE) { | |
if (!is.null(color)) | |
colour <- color | |
if (is.null(arrow)) | |
arrow <- FALSE |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE language SYSTEM "language.dtd"> | |
<language name="Julia" section="Scientific" | |
version="0" | |
extensions="*.jl" | |
mimetype="text/x-juliascript" | |
author="Andreas Nordal ([email protected])" | |
license="public domain"> | |
<highlighting> |
library(ggplot2) | |
library(readr) | |
library(ggfittext) | |
d <- read_csv('PrevalenceAtLarge.csv') | |
d$value <- cut(d$PercentAtLarge, breaks = 5, | |
labels = c("doubling under 6 weeks", | |
"doubling in 2–6 weeks", | |
"stable", | |
"halving in 2–6 weeks", |
# not needed | |
# library(ggplot2) | |
# disclaimer: this code is from 15 years ago... | |
# (kind of impressed it still runs!) | |
# example data | |
x <- seq(0, 10, len = 100) | |
y1 <- jitter(sin(x), 1000) |
--- | |
title: "file 1" | |
format: html | |
--- | |
## Code Externalisation | |
Write R code in external R scripts, and use `read_chunk()` to read them into the current document. | |
```{r cache=FALSE} |
```{r} | |
path <- fs::path("<<variable>>", ext = "csv") | |
cmd <- paste0("{{< downloadthis ", "'", path, "'", ' dname=<<variable>> label="Download the <<variable>> data" icon=database-fill-down type=info class=data-button id=<<variable>> >}}') | |
``` | |
```{r} | |
#| results: asis | |
cat(cmd) |
library(minixml) | |
# devtools::install_github("coolbutuseless/minixml") | |
library(anytime) | |
generate_empty_feed <- function(file = 'index.xml'){ | |
doc <- xml_elem("rss", version="2.0") | |
channel <- doc$add('channel') | |
channel$add('title', "Photography") | |
channel$add('link', "https://photo.bapt.xyz/") | |
channel$add('description', "My latest photo pages") |
grab_math_strings <- function(fe){ | |
parse <- readLines(glue("{fe}-math.tex")) | |
content <- parse[parse != ''] | |
lines <- grep("math start", content) | |
start <- lines+1 | |
end <- c(lines[-1], length(content) + 1) - 1 | |