In knitr/R/hooks-md.R there is a custom function render_jekyll. I wrote a similar one for hugo that makes figure shortcodes. Then I could remove the perl from the makefile. This was a dirty hack which I am happy to got rid of.
Suppose I will add some more shortcodes in the future.
# Define the cars vector with 5 values
cars <- c(1, 3, 6, 4, 9)
# Graph the cars vector with all defaults
plot(cars)
Figure one is supposed come right of this.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
This is render from 009-slides
% Writing beautiful and reproducible slides quickly % Yihui Xie % 2012/04/30
Why after you finished typing \documentclass{beamer} and \title{}, I have finished my first slide with markdown far fewer commands to remember, e.g. to write bullet points, just begin with a dash “-” instead of \begin{itemize} and \item; how things can be simpler? I know you want math to show you are a statistician, e.
This is a render from knitr examples.
A minimal R Markdown example A quote:
Markdown is not LaTeX.
To compile me, run this in R:
library(knitr) knit(‘001-minimal.Rmd’) See output here.
code chunks A paragraph here. A code chunk below (remember the three backticks):
1+1 ## [1] 2 .4-.7+.3 # what? it is not zero! ## [1] 5.551115e-17 graphics It is easy.
plot(1:10) plot of chunk unnamed-chunk-2 hist(rnorm(1000)) plot of chunk unnamed-chunk-2 inline code Yes I know the value of pi is 3.