R version 4.2.2 (2022-10-31) -- "Innocent and Trusting" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin17.0 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > local({ + if (!file.exists(f <- '../inst/examples/render-options.R')) + f = markdown:::pkg_file('examples', 'render-options.R') + source(f, local = TRUE, echo = TRUE) + }) > library(markdown) > mkd <- c("# Header 1", "p1", "## Header 2", "p2") > cat(mark(mkd))

Header 1

p1

Header 2

p2

> cat(mark(mkd, options = "toc"))

Header 1

p1

Header 2

p2

> cat(mark("foo\nbar\n"))

foo bar

> cat(mark("foo\nbar\n", options = "hard_wrap"))

foo
bar

> mkd <- c("`$x$` is inline math $x$!", "", "Display style:", + "", "$$x + y$$", "", "\\begin{eqnarray}\na^{2}+b^{2} & = & c^{2}\\\\\n\\sin^{2}(x ..." ... [TRUNCATED] > cat(mark(mkd))

$x$ is inline math \(x\)!

Display style:

$$x + y$$

\begin{eqnarray} a^{2}+b^{2} & = & c^{2}\\ \sin^{2}(x)+\cos^{2}(x) & = & 1 \end{eqnarray}

> cat(mark(mkd, options = "-latex_math"))

$x$ is inline math $x$!

Display style:

$$x + y$$

\begin{eqnarray} a^{2}+b^{2} & = & c^{2}\ \sin^{2}(x)+\cos^{2}(x) & = & 1 \end{eqnarray}

> cat(mark("\nFirst Header | Second Header\n------------- | -------------\nContent Cell | Content Cell\nContent Cell | Content Cell\n"))
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
> cat(mark("\nFirst Header | Second Header\n------------- | -------------\nContent Cell | Content Cell\nContent Cell | Content Cell\n", + opti .... [TRUNCATED]

First Header | Second Header ———–– | ———–– Content Cell | Content Cell Content Cell | Content Cell

> cat(mark("https://www.r-project.org/"))

https://www.r-project.org/

> cat(mark("https://www.r-project.org/", options = "-autolink"))

https://www.r-project.org/

> cat(mark("~~awesome~~"))

awesome

> cat(mark("~~awesome~~", options = "-strikethrough"))

~~awesome~~

> cat(mark("2^10^"))

210

> cat(mark("2^10^", options = "-superscript"))

2^10^

> cat(mark("H~2~O"))

H2O

> cat(mark("H~2~O", options = "-subscript"))

H~2~O

> mkd = "\n[Hello](#)" > cat(mark(mkd))

Hello

>