Rendering single page of a quarto Book to docx and pdf


I was wondering if it was possible to render a single chapter (a single .qmd file) of my quarto book as a standalone word doc (.docx). I have tried adding to the YAML of the individual quarto doc to read:

    theme: cosmo
    embed-resources: true
    documentclass: scrreprt
    reference-doc: custom-ref-doc.docx

but when rendering that document (whether rendering with the render button in Rstudio or in the CLI using quarto render proposal.qmd). I also tried specifying the rendering of just the docx with quarto render proposal.qmd --to docx and all it does is render out the entire book in the output directory rather than just that one chapter.

Thank you!

I believe you would need to use a Quarto profile (Quarto - Project Profiles) to change the project type to default instead of Book.

That way each document would be seen as independent and not part of the book. Though some Book specific feature would not work.

Otherwise, you need to still use a profile, but maybe filter the Render target to only have your docx version the chapter you want ? Quarto - Project Basics

Or maybe filtering the chapters are better ? Quarto - Book Structure

Just ideas. The feature is not native - if you set docx, you will get your book as docx as expected.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.