Example of litedown

Author

Jihong Zhang

Published

August 28, 2024

Overview

This post shows case one example of new package – litedown from Yihui Xie. Please refer to the Yihui’s documentation for more details.

A minimal example

Define the radius as `x`:

::: {.cell}

```{.r .cell-code}
x = 1 + 1
```
:::

When the radius is 2, the area will be 12.5663706.

The above code will be output as:

Define the radius as x:

x = 1 + 1

When the radius is 2, the area will be 12.5663706.

Including Plots Here

You can also embed plots now, for example:

plot(pressure)

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.0.4     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Below is not a code chunk but verbatim content
inside a fenced code block (with four backticks).

::: {.cell}

```{.r .cell-code}
1 + 1
```

::: {.cell-output .cell-output-stdout}

```
[1] 2
```


:::
:::

Inline code expressions like 2 are not
parsed, either.
Back to top