Skip to content

Code cells of different languages are wrongly merged when inside a layoutΒ #8179

@mcanouil

Description

@mcanouil

Code cells of different languages are wrongly merged when inside a layout (independently of knitr/Jupyter being the engine)

Quarto documentv1.3.450v1.4
---
title: "Block layout"
format: html
engine: knitr
---

# Code chunk block layout

:::: {layout="[48,-4,48]"}

::: {}

### R

```{r}
sqrt(2)
```

:::

::: {}

### Python

```{python}
import math
math.sqrt(2)
```

:::

::::
image image

Discussed in #8178

Originally posted by luifrancgom January 9, 2024

Description

I want to display code chunks side by side where I try the solution specify in #3423 and the instructions pointed out in the documentation here but I did not obtain the expected behavior in relation to the code. The solution only works for the result of the code.

Steps to reproduce

---
title: "Block layout"
format: 
  html: default
  pdf: default
editor: visual
---

# Code chunk block layout

:::: {layout="[48,-4,48]"}

::: {}

### R

```{r}
sqrt(2)
```

:::

::: {}

### Python

```{python}
import math
math.sqrt(2)
```

:::

::::

Expected behavior

expected_behavior

Actual behavior

actual_behavior

Question

How can I obtain the expected behavior?

Quarto and dependencies I am running

Quarto 1.4.537
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.537
      Path: C:\Users\Usuario\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: v2024.01
      Chromium: 869685

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\Usuario\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2023

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.11.6 (Conda)
      Path: C:/Users/Usuario/anaconda3/python.exe
      Jupyter: 5.7.0
      Kernels: ir, julia-1.9, python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.3.2
      Path: C:/PROGRA~1/R/R-43~1.2
      LibPaths:
        - C:/Users/Usuario/AppData/Local/R/win-library/4.3
        - C:/Program Files/R/R-4.3.2/library
      knitr: 1.45
      rmarkdown: 2.25

[>] Checking Knitr engine render......OK
```</div>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions