Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong language & crossref output when format:docx #5383

Closed
5 tasks done
Lulliter opened this issue May 2, 2023 · 6 comments
Closed
5 tasks done

wrong language & crossref output when format:docx #5383

Lulliter opened this issue May 2, 2023 · 6 comments
Assignees
Labels
bug Something isn't working crossref
Milestone

Comments

@Lulliter
Copy link

Lulliter commented May 2, 2023

Bug description

The language choice picked in YAML (lang: it)renders correctly in html, but fails in docx output for table caption (lang and crossreff).
docx_issues.docx

---
title: "docx_issues"
lang: it
toc: true
format:
  html:
    toc-title: Indice
    embed-resources: true # external dependencies embedded (Not in ..._files/)
  docx:
    toc-title: Indice
    embed-resources: true # external dependencies embedded (Not in ..._files/)

---

## Issue 

Rendering in **html**:

1. crossreference of table (@tbl-test) works correctly
2. and shows the title in the required language picked in YAML `lang: it` (**"Tabella 1: table title"**) 

Rendering in **word** INSTEAD:

1. crossreference of table (@tbl-test) does **NOT** work
2. and shows the title **NOT** in the required language picked in YAML `lang: it`(**"Table 1: table title"**) 
 
```{r}
#| label: tbl-test 
#| echo: false
#| warning: false
#| output: true
#| tbl-cap: "table title"
library(quarto) 
library(flextable) 
library(magrittr)  
 ft <- mtcars %>% head() %>% 
  flextable() 
 
 ft
```

+ R version 4.2.2 (2022-10-31)
+ R Studio Version 2022.12.0+353 (2022.12.0+353)
+ Quarto Version ‘1.2.258’

[✓] Checking Quarto installation......OK
Version: 1.2.258
Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.9.13
Path: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
Jupyter: 5.2.0
Kernels: python3, python2

(-) Checking Jupyter engine render....Traceback (most recent call last):
File "/Applications/quarto/share/jupyter/jupyter.py", line 21, in
from notebook import notebook_execute, RestartKernel
File "/Applications/quarto/share/jupyter/notebook.py", line 16, in
import nbformat
ModuleNotFoundError: No module named 'nbformat'
[✓] Checking Jupyter engine render....OK

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.
  • Please provide the output of quarto check so we know which version of quarto and its dependencies you're running.
@Lulliter Lulliter added the bug Something isn't working label May 2, 2023
@cscheid
Copy link
Collaborator

cscheid commented May 2, 2023

Thanks for the report. You're using an old version of quarto - can you try a recent version first?

@cscheid cscheid added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label May 2, 2023
@Lulliter
Copy link
Author

Lulliter commented May 2, 2023

Sure, I have installed Quarto version 1.3.340 for Mac, but I still see the same output.
I have a Microsoft Word for Mac license (version 16.72), not sure if that could be the issue

@cscheid cscheid added crossref and removed bug Something isn't working labels May 2, 2023
@cscheid cscheid added this to the v1.4 milestone May 2, 2023
@cscheid
Copy link
Collaborator

cscheid commented May 2, 2023

I can repro this. The issue here is that our crossref system is not doing a good job recognizing tables that come in as a raw openxml object (the HTML format is handled differently). It's not an easy fix but I'm working on crossrefs right now. Hopefully we'll have it fixed in ~3 months or so.

@cscheid cscheid added the bug Something isn't working label May 2, 2023
@cscheid cscheid self-assigned this May 2, 2023
@cscheid cscheid mentioned this issue May 23, 2023
61 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2023

Thank you for using Quarto and reporting an issue!

Unfortunately, this issue is now considered stale because it has been opened since 14 days without providing a "working" reproducible example to help us investigate.
If you are still facing the issue, please review the "Bug Reports" guide on how to provide a fully reproducible example as a self-contained Quarto document or a link to a Git repository.
Without a reproducible example, it is unlikely that the issue will be addressed and thus will be closed.

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)
```

The end.
````

Remove stale / needs-repro labels or this will be closed in 14 days.

@github-actions github-actions bot added the stale Issues open for 30+ days without providing a "working" reproducible example label Jun 3, 2023
@mcanouil mcanouil removed needs-repro Issues that are blocked until reporter provides an adequate reproduction stale Issues open for 30+ days without providing a "working" reproducible example labels Jun 4, 2023
@mcanouil
Copy link
Collaborator

mcanouil commented Jun 4, 2023

I can repro this.

Removing "needs-repro".

@cscheid
Copy link
Collaborator

cscheid commented Oct 22, 2023

Aside from #7321, this is now fixed on main:

5383

@cscheid cscheid closed this as completed Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crossref
Projects
None yet
Development

No branches or pull requests

3 participants