Quarto document does not render to DOCX

Hi

I have a problem rendering a simple Quarto document to .docx (Word) format. I generated the simplest Quarto document that I can using File > New File > New Quarto Document. That file rendered correctly to .docx. I then added two lines at the end:

{{< pagebreak >}}
# Section title

When the above lines were added at the end, the file rendered to .docx, but Word was unable to load the file, giving the following dialog box:

image

If the "{{< pagebreak >}}" line is removed, the document correctly renders to .docx, so that is presumably the culprit. Before I lodge a feature report on Quarto, can anyone reproduce the same behaviour? The Quarto code is below. Version information also below.

Thanks
Stephen

> quarto::quarto_version()
[1] ā€˜1.4.51ā€™
> R.Version()$version.string
[1] "R version 4.2.0 (2022-04-22 ucrt)"
> R.Version()$platform
[1] "x86_64-w64-mingw32"
---
title: "Untitled"
format: docx
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

## Running Code

When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1

You can add options to executable code like this

#| echo: false
2 * 2

The echo: false option disables the printing of code (only output is displayed).

{{< pagebreak >}}

Section title

How come you have got Quarto version

ā€˜1.4.51ā€™

when most up-to-date version is 1.3.361 ?

https://quarto.org/docs/download/

By the way your code works for me perfectly and word opens properly with page break created.
I have got Quarto version 1.3.340 - stable - not pre-release.
Maybe installing current version would be the solution ?

1 Like

The document correctly renders on my macOS setup and opens correctly in Pages (not even Word), So it has the scent of a configuration problem.

I am running quarto 1.2.313 outside of the default RStudio installation, and pandoc 3.0, also outside. Here's my session

R version 4.3.0 (2023-04-21)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.3.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils    
[5] datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.3.0  fastmap_1.1.1  
 [3] cli_3.6.1       htmltools_0.5.5
 [5] tools_4.3.0     rstudioapi_0.14
 [7] yaml_2.3.7      rmarkdown_2.21 
 [9] knitr_1.42      xfun_0.39      
[11] digest_0.6.31   rlang_1.1.1    
[13] evaluate_0.21  

Indeed, that was the problem - the pre-release version of Quarto gave the error, while uninstalling and installing the up-to-date version gives no error. The moral of the story is: be careful with pre-release versions.

I don't know why that pre-release version was installed... Oh yes, now I remember, there was a problem with the current release of Quarto using Julia, which was reported to work with the pre-release version. That's a separate story...

Thanks for your help
Stephen

1 Like

Your are welcome Stephen.
This is probably the first time when my reply was marked as solution, thank you.
I will go celebrate it today. :grinning: :champagne: :clinking_glasses:

This topic was automatically closed 7 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.