expand the width of a code block and its output

1 expand to full page width

1.1 1. ::: {.column-page}

Use this to wrap a code block to span it and its output to page width.

1.1.1 Syntax

::: {.column-page}
```{.python}
import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
```
:::

1.1.2 Example

import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
shape: (5, 20)
string_idx string_name string_name_x string_name_y string_box_idx CB_name Phase string_num string_box_v1_x string_box_v1_y string_box_v2_x string_box_v2_y string_box_v3_x string_box_v3_y string_box_v4_x string_box_v4_y num_modules module_orientation num_module_along_x num_module_along_y
i64 str f64 f64 i64 i64 i64 i64 f64 f64 f64 f64 f64 f64 f64 f64 i64 str i64 i64
0 "20-9" 5228.161911 724.563534 0 0 0 0 5217.39348 723.963534 5238.930342 723.963534 5238.930342 725.163534 5217.39348 725.163534 362 "L" 10 1
0 "20-9" 5228.161911 725.867048 1 0 0 0 5217.39348 725.267048 5238.930342 725.267048 5238.930342 726.467048 5217.39348 726.467048 361 "L" 10 1
1 "21-3" 5206.643309 724.563534 0 0 0 0 5195.874878 723.963534 5217.41174 723.963534 5217.41174 725.163534 5195.874878 725.163534 360 "L" 10 1
1 "21-3" 5206.643309 725.867048 1 0 0 0 5195.874878 725.267048 5217.41174 725.267048 5217.41174 726.467048 5195.874878 726.467048 359 "L" 10 1
2 "20-8" 5228.161911 727.170562 0 0 0 0 5217.39348 726.570562 5238.930342 726.570562 5238.930342 727.770562 5217.39348 727.770562 358 "L" 10 1

1.2 2. #| column: page

Use it inside a code block and only its output will span page width.

1.2.1 Syntax

```{.python}
#| column: page
import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
```

1.2.2 Example

import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
shape: (5, 20)
string_idx string_name string_name_x string_name_y string_box_idx CB_name Phase string_num string_box_v1_x string_box_v1_y string_box_v2_x string_box_v2_y string_box_v3_x string_box_v3_y string_box_v4_x string_box_v4_y num_modules module_orientation num_module_along_x num_module_along_y
i64 str f64 f64 i64 i64 i64 i64 f64 f64 f64 f64 f64 f64 f64 f64 i64 str i64 i64
0 "20-9" 5228.161911 724.563534 0 0 0 0 5217.39348 723.963534 5238.930342 723.963534 5238.930342 725.163534 5217.39348 725.163534 362 "L" 10 1
0 "20-9" 5228.161911 725.867048 1 0 0 0 5217.39348 725.267048 5238.930342 725.267048 5238.930342 726.467048 5217.39348 726.467048 361 "L" 10 1
1 "21-3" 5206.643309 724.563534 0 0 0 0 5195.874878 723.963534 5217.41174 723.963534 5217.41174 725.163534 5195.874878 725.163534 360 "L" 10 1
1 "21-3" 5206.643309 725.867048 1 0 0 0 5195.874878 725.267048 5217.41174 725.267048 5217.41174 726.467048 5195.874878 726.467048 359 "L" 10 1
2 "20-8" 5228.161911 727.170562 0 0 0 0 5217.39348 726.570562 5238.930342 726.570562 5238.930342 727.770562 5217.39348 727.770562 358 "L" 10 1

2 expand to full screen width

You can have content span the full width of the page with no margin (full bleed).

2.1 1. ::: {.column-screen}

Use it to wrap a code block to expand it and its output to full screen width.

2.1.1 Syntax

::: {.column-screen}
```python
import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
```
:::

2.1.2 Example

import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
shape: (5, 20)
string_idx string_name string_name_x string_name_y string_box_idx CB_name Phase string_num string_box_v1_x string_box_v1_y string_box_v2_x string_box_v2_y string_box_v3_x string_box_v3_y string_box_v4_x string_box_v4_y num_modules module_orientation num_module_along_x num_module_along_y
i64 str f64 f64 i64 i64 i64 i64 f64 f64 f64 f64 f64 f64 f64 f64 i64 str i64 i64
0 "20-9" 5228.161911 724.563534 0 0 0 0 5217.39348 723.963534 5238.930342 723.963534 5238.930342 725.163534 5217.39348 725.163534 362 "L" 10 1
0 "20-9" 5228.161911 725.867048 1 0 0 0 5217.39348 725.267048 5238.930342 725.267048 5238.930342 726.467048 5217.39348 726.467048 361 "L" 10 1
1 "21-3" 5206.643309 724.563534 0 0 0 0 5195.874878 723.963534 5217.41174 723.963534 5217.41174 725.163534 5195.874878 725.163534 360 "L" 10 1
1 "21-3" 5206.643309 725.867048 1 0 0 0 5195.874878 725.267048 5217.41174 725.267048 5217.41174 726.467048 5195.874878 726.467048 359 "L" 10 1
2 "20-8" 5228.161911 727.170562 0 0 0 0 5217.39348 726.570562 5238.930342 726.570562 5238.930342 727.770562 5217.39348 727.770562 358 "L" 10 1

2.2 2. #| column: screen

Use it inside a code block to expand only its output to full width of screen.

2.2.1 Syntax

```python
#| column: screen
import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
```

2.2.2 Example

import polars as pl
csv_path = "./data/tw_taoyuan_cankun_merged_updated.csv"
df = pl.read_csv(csv_path)
df.head(5)
shape: (5, 20)
string_idx string_name string_name_x string_name_y string_box_idx CB_name Phase string_num string_box_v1_x string_box_v1_y string_box_v2_x string_box_v2_y string_box_v3_x string_box_v3_y string_box_v4_x string_box_v4_y num_modules module_orientation num_module_along_x num_module_along_y
i64 str f64 f64 i64 i64 i64 i64 f64 f64 f64 f64 f64 f64 f64 f64 i64 str i64 i64
0 "20-9" 5228.161911 724.563534 0 0 0 0 5217.39348 723.963534 5238.930342 723.963534 5238.930342 725.163534 5217.39348 725.163534 362 "L" 10 1
0 "20-9" 5228.161911 725.867048 1 0 0 0 5217.39348 725.267048 5238.930342 725.267048 5238.930342 726.467048 5217.39348 726.467048 361 "L" 10 1
1 "21-3" 5206.643309 724.563534 0 0 0 0 5195.874878 723.963534 5217.41174 723.963534 5217.41174 725.163534 5195.874878 725.163534 360 "L" 10 1
1 "21-3" 5206.643309 725.867048 1 0 0 0 5195.874878 725.267048 5217.41174 725.267048 5217.41174 726.467048 5195.874878 726.467048 359 "L" 10 1
2 "20-8" 5228.161911 727.170562 0 0 0 0 5217.39348 726.570562 5238.930342 726.570562 5238.930342 727.770562 5217.39348 727.770562 358 "L" 10 1

3 Ref

  • https://quarto.org/docs/authoring/article-layout.html#screen-column
Back to top