Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reducing space between command and output in RMarkdown / Quarto

I am just starting to use Quarto in the latest version of Rstudio. However, I'm annoyed by the amount of space added between the command and the output in the R code chunk (rendered as pdf)

```{r}
3 + 1
```

You can add options to executable code like this

```{r}
#| echo: false
2 * 2
```

The `echo: false` option disables the printing of code (only output is displayed).

enter image description here

I am unable to find any references or global code chunk options to reduce this spacing. What is the usual R Markdown code chunk option for this?

like image 324
Greenparker Avatar asked May 26 '26 12:05

Greenparker


1 Answers

You can try this solution.

As you know, Quarto by default uses the KOMA-Script classes.

If you change one of them (by default: scrartcl) to the standard document-class in LaTeX (f.e.: article) - space will be reduced.

format: 
  pdf:
    documentclass: article

enter image description here

Good luck ;-)

like image 160
manro Avatar answered May 28 '26 08:05

manro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!