quarto-dev / quarto-dev/quarto-cli

Multicolumns with `layout` in `pdf` output don't work when a column contains a code cell

Open
#10,981 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug latex layout
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Quarto 1.6.12.

Here is a reprex:

---
format: pdf
fig-width: 3
fig-height: 1
---

<!-- This works -->
:::: {layout="[ 0.1, 0.9 ]"}
::: {#first-column}
\(a\)
:::
::: {#second-column}
Some text.
:::
::::

<!-- This also works -->
:::: {layout="[ 0.1, 0.9 ]"}
::: {#first-column}
\(b\)
:::
::: {#second-column}
```{r}
#| echo: false
par(mar = c(0, 0, 0, 0))
plot(1:10)
```
:::
::::

<!-- This doesn't exactly work, see how code spans the whole first line -->
:::: {layout="[ 0.1, 0.9 ]"}
::: {#first-column}
\(c\)
:::
::: {#second-column}
```{r}
#| echo: true
par(mar = c(0, 0, 0, 0))
plot(1:10)
```
:::
::::

<!-- This doesn't work, see how code spans the whole first line -->
:::: {layout="[ 0.1, 0.9 ]"}
::: {#first-column}
\(d\)
:::
::: {#second-column}
```{r}
#| eval: false
#| echo: true
par(mar = c(0, 0, 0, 0))
plot(1:10)
```
:::
::::

When the second column contains a code cell that is echoed, it spans the whole width and columns fail.

Image

(Note: When I render this document, (d) is printed on the second page. I think this is the usual LaTeX weird page break issue that is not relevant to this, so I didn't show that in the screenshot above.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by rendering the supplied Markdown reprex with Quarto 1.6.12 and compare the PDF output for echoed and non-echoed R cells inside the two-column layout. Trace the PDF layout handling for code-cell output; done means echoed code remains confined to its assigned column and the layout renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex, markdown, r
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.