Problem
Quarto has no built-in way to add line numbering to docx output, yet line numbers are a hard requirement for many manuscript-submission, legal, and peer-review workflows. Today the only recourse is to enable them by hand in Word after every render. The need was raised in discussion #6772 ("Adding line numbering to PDF and DOCX") — the PDF half was answered via the lineno package, but the docx half was never resolved.
Proposal
A format option to turn on continuous line numbering for docx:
format:
docx:
line-numbers: true
(Option name is the maintainers' call; it could eventually unify with PDF lineno and Typst's native line numbering into one cross-format option — what that discussion originally asked for. This request is scoped to docx, where there is no path today.)
Why this needs format-level support
Word stores line numbering as <w:lnNumType> inside a section's <w:sectPr>. The correct place for it is the document's existing main <w:sectPr> — the one that already carries the headerReferences and pgSz — so the running head and page size are preserved. A Lua filter/extension can't reach that section (it comes from the reference doc and is written by pandoc after filters run), so the most a filter can do is append a new section, which has no headerReference or pgSz and therefore drops the running head and resets the page size to Letter. Doing it correctly requires a format-level post-processing step on the written document.
Problem
Quarto has no built-in way to add line numbering to
docxoutput, yet line numbers are a hard requirement for many manuscript-submission, legal, and peer-review workflows. Today the only recourse is to enable them by hand in Word after every render. The need was raised in discussion #6772 ("Adding line numbering to PDF and DOCX") — the PDF half was answered via thelinenopackage, but the docx half was never resolved.Proposal
A format option to turn on continuous line numbering for
docx:(Option name is the maintainers' call; it could eventually unify with PDF
linenoand Typst's native line numbering into one cross-format option — what that discussion originally asked for. This request is scoped todocx, where there is no path today.)Why this needs format-level support
Word stores line numbering as
<w:lnNumType>inside a section's<w:sectPr>. The correct place for it is the document's existing main<w:sectPr>— the one that already carries theheaderReferences andpgSz— so the running head and page size are preserved. A Lua filter/extension can't reach that section (it comes from the reference doc and is written by pandoc after filters run), so the most a filter can do is append a new section, which has noheaderReferenceorpgSzand therefore drops the running head and resets the page size to Letter. Doing it correctly requires a format-level post-processing step on the written document.