A litedown demo

Yihui Xie

2025-06-30

litedown::reactor(time = TRUE)

This is a litedown demo.

1 Markdown elements

Hello world! This is bold. Here is a link.

2 Code chunks

if (TRUE) {
  N = 30
  x = rnorm(N)
}
1 + 1

3 Figures

Add a caption via fig.cap:

par(mar = c(4, 4, .5, .5))
plot(cars, pch = 19, panel.first = grid())

A scatterplot of the cars data.

1 A scatterplot of the cars data.

Cross-reference 1.

4 Tables

mtcars
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2
Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4
Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6
Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8
Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2
iris
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
6.7 3.0 5.2 2.3 virginica
6.3 2.5 5.0 1.9 virginica
6.5 3.0 5.2 2.0 virginica
6.2 3.4 5.4 2.3 virginica
5.9 3.0 5.1 1.8 virginica

4.1 Truncating data

mtcars
mpg cyl disp gear am vs qsec
Mazda RX4 21.0 6 160.0 4 1 0 16.46
Mazda RX4 Wag 21.0 6 160.0 4 1 0 17.02
Datsun 710 22.8 4 108.0 4 1 1 18.61
Ferrari Dino 19.7 6 145.0 5 1 0 15.50
Maserati Bora 15.0 8 301.0 5 1 0 14.60
Volvo 142E 21.4 4 121.0 4 1 1 18.60

4.2 Caption

See 1.

mtcars

1 A table of the mtcars data.

mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2
Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4
Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6
Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8
Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2

Caption position:

head(mtcars)
mpg cyl disp hp drat wt qsec vs am gear carb
Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4
Mazda RX4 Wag 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4
Datsun 710 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1
Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1
Hornet Sportabout 18.7 8 360 175 3.15 3.440 17.02 0 0 3 2
Valiant 18.1 6 225 105 2.76 3.460 20.22 1 0 3 1

2 A subset of the mtcars data.

5 Time code chunks

litedown::timing_data()
source line1 line2 label time
/cloud/project/litedown-demo.Rmd 43 48 cars 0.081
/cloud/project/litedown-demo.Rmd 54 57 chunk-5 0.008
/cloud/project/litedown-demo.Rmd 61 63 chunk-6 0.006
/cloud/project/litedown-demo.Rmd 69 73 mtcars 0.004
/cloud/project/litedown-demo.Rmd 77 81 mtcars2 0.004
/cloud/project/litedown-demo.Rmd 58 60 0.000
/cloud/project/litedown-demo.Rmd 64 68 0.000
/cloud/project/litedown-demo.Rmd 74 76 0.000
/cloud/project/litedown-demo.Rmd 49 53 0.000
Total 0.107

6 CSS/JS assets

6.1 Margin content

Use the classes .side, .side-left or .side-right.

You can place content on the left margin.

Or on the left margin.

Footnotes are displayed on the right by default.1

6.2 Callouts

Callouts are made from fenced Divs with classes callout-*, e.g.,

This is a tip!

This is very important!

Be careful.

6.3 Style keyboard shortcuts

Identify key names in `text` wrapped in backticks and style them, which can be useful for showing keyboard shortcuts.

Esc Tab Enter Space Delete Home End PrtScr PrintScreen PageUp PageDown Up Down Left Right

Ctrl Control Shift Alt Cmd Command fn

Ctrl / Cmd + Alt + I

Shift + Enter

Alt + Click

You can also use the HTML tag <kbd>text</kbd>, e.g.,

a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9

6.4 Tabsets

6.5 Code folding

js: ["@fold-details"]
  1. Such as this one.