quarto-dev / quarto-dev/quarto-cli

`.landscape` does not keep page size for Word (enforce "A4" in landscape whilst default doc is US Letter)

Open
#12,917 12 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 don't think there an easy or even a fix for this at least not by simply injecting OpenXML code.

Using the landscape shortcode for Word document will also have another issue: the page/section dimension might me different to the portrait page/section because the dimension is hardcoded in the shortcode.

In OpenXML, a new section has to contains height, width, etc. and as far as I know don't inherits elements, thus since footer is not defined in the section, it's not there in the end.

For instance, here is what the community contributed landscapes shortcode does for Word:

Originally posted by @mcanouil in #12628

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 with the linked src/resources/filters/quarto-post/landscape.lua implementation and reproduce a Word document whose default page size is US Letter before applying the landscape shortcode. Inspect the generated section properties and footer behavior in the OpenXML output. Done means landscape preserves the intended page size and required section content without hardcoding A4.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.