You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a document is in a sub-directory and the execute directory is not the sub-directory, then a quarto -> docx document with a gt table will fail to render.
This is important in particular for targets workflows, where to have access to the targets environment, the document is rendered with the execute_dir at the top level.
Or at least that is the config bit I modify to be able to test document renders outside of the actual targets workflow.
I’ve created a repo here with the files that are rendered below.
Note that d2.qmd and doc/d1.qmd are essentially identical documents with the same code, just their physical location in the filesystem are slightly different, and they are generating very basic gt tables.
Top Level Renders Fine
quarto::quarto_render("d2.qmd")
## �[31m
##
## processing file: d2.qmd
## �[39m
|
| | 0%
|
|........ | 11%
## inline R code fragments
##
##
|
|................ | 22%
## label: setup (with options)
## List of 1
## $ include: logi FALSE
##
##
|
|....................... | 33%
## ordinary text without R code
##
##
|
|............................... | 44%
## label: load-targets (with options)
## List of 1
## $ include: logi FALSE
##
##
|
|....................................... | 56%
## ordinary text without R code
##
##
|
|............................................... | 67%
## label: create_table
##
|
|...................................................... | 78%
## ordinary text without R code
##
##
|
|.............................................................. | 89%
## label: gt_it
##
|
|......................................................................| 100%
## ordinary text without R code
##
##
## �[31moutput file: d2.knit.md
##
## �[39m�[1mpandoc �[22m
## to: docx
## output-file: d2.docx
## default-image-extension: png
##
## �[1mmetadata�[22m
## title: Untitled Draft
## author: Report Author
## date: '`r format(Sys.time(), ''%d %B, %Y'')`'
##
## Output created: d2.docx
In that case, reverting to gt 0.6.0 made the problem disappear.
In that discussion, @wlandau proposes a specific change to solve the issue:
This can be fixed if https://github.com/rstudio/gt/blob/a585bd6a916cca767c7a2e3e72eda8f91c2f67f5/R/print.R#L27 uses knitr::current_input(dir = TRUE) instead of knitr::current_input().
I think it is likely related. However, the whole reason I was using gt 0.7.0 was for docx support, as I would really like quarto based documents to word documents, with table auto-numbering (flextable & quarto don't support that quite yet), in a targets workflow. So 0.6.0 is a no go.
If a document is in a sub-directory and the execute directory is not the sub-directory, then a quarto -> docx document with a
gt
table will fail to render.This is important in particular for
targets
workflows, where to have access to thetargets
environment, the document is rendered with theexecute_dir
at the top level.Or at least that is the config bit I modify to be able to test document renders outside of the actual
targets
workflow.I’ve created a repo here with the files that are rendered below.
Note that
d2.qmd
anddoc/d1.qmd
are essentially identical documents with the same code, just their physical location in the filesystem are slightly different, and they are generating very basicgt
tables.Top Level Renders Fine
In A Sub-Directory With execute_dir as Top Level
In A Sub-Directory With No execute_dir
The text was updated successfully, but these errors were encountered: