quarto-dev / quarto-dev/quarto-cli

Landscape div creates unwanted blank page at end of Word document

Open
#13,533 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

When using the .landscape div to create landscape-oriented pages in Word output, an extra blank page is automatically added at the end of the document.

Steps to reproduce

Reproducible Example:

Save the following code block as test.qmd

---
title: "Landscape Test"
format: docx
---

## Regular Content

This is some regular portrait content.

::: {.landscape}

## Landscape Section

```{r}
library(flextable)
ft <- flextable(mtcars[1:10, 1:8])
ft
```

:::

Run:

quarto render test.qmd -t docx

Open test.docx to view in MS Word.

Actual behavior

An extra blank page (page 3 in my case) appears after the landscape section. This blank page contains only the section break required for the landscape formatting.

Screenshots:

Image
Expected behavior

The document should end immediately after the landscape section without any trailing blank pages.

Your environment
  • IDE: VS Code
  • OS: macOS 26.0.1
Quarto check output
$ quarto check

Quarto 1.9.3
[✓] Checking environment information...
      Quarto cache location: /Users/username/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      NOTE: Deno version 2.4.5 does not strictly match 2.3.1 and strict checking is enabled. Please use 2.3.1.
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.9.3
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2025.10
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/username/Library/TinyTeX/bin/universal-darwin
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /Users/username/.pyenv/versions/3.12.2/bin/python3
      Jupyter: 5.8.1
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.5.1
      Path: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources
      LibPaths:
        - /Users/username/.R/packages
        - /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
      knitr: 1.49
      rmarkdown: 2.29

[✓] Checking Knitr engine render......OK

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

Reproduce the issue with the provided test.qmd and quarto render test.qmd -t docx, then inspect how the landscape div and section breaks are represented in the generated Word document. The work is done when the landscape section renders without a trailing blank page while preserving the required orientation change.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, r
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.