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

missing reference for flextable table in word document #3601

Closed
4 tasks done
rmflight opened this issue Dec 8, 2022 · 3 comments
Closed
4 tasks done

missing reference for flextable table in word document #3601

rmflight opened this issue Dec 8, 2022 · 3 comments
Assignees
Labels
bug Something isn't working crossref tables Issues with Tables including the gt integration
Milestone

Comments

@rmflight
Copy link

rmflight commented Dec 8, 2022

Bug description

---
title: "flextable missing reference"
format: docx
---


```{r}
#| label: load_data
data(cars)

library(flextable)
```

Now lets try a table in our word document. This should be @tbl-cars.

```{r}
#| label: tbl-cars
#| tbl-cap: Something about cars.
cars |>
  dplyr::slice_head(n = 5) |>
  flextable() |>
  autofit()
```

flextable_missing.docx

Rendering the above document (RStudio render button) results in the table reference looking like ?@tbl-cars, and there is no caption.

If I force HTML output (quarto::quarto_render(..., output_format = "html")), I get the expected output of Table 1, as well as the caption.

Software details:

  • R 4.2.1
  • RStudio 2022.12.0-preview+348
  • quarto 1.3.47
  • flextable 0.8.4.001 2022-12-08 davidgohel/flextable@f38ccb1
  • Linux, Pop! OS 22.04 (skinned version of Ubuntu 22.04)

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.
@rmflight rmflight added the bug Something isn't working label Dec 8, 2022
@cscheid cscheid added crossref tables Issues with Tables including the gt integration labels Dec 8, 2022
@cscheid cscheid self-assigned this Dec 8, 2022
@cscheid cscheid added this to the v1.4 milestone Feb 27, 2023
@cscheid
Copy link
Collaborator

cscheid commented May 23, 2023

In Quarto 1.4's crossref system, this is a duplicate of #1556, #2297, #3397 and #3600.

@cscheid
Copy link
Collaborator

cscheid commented Oct 22, 2023

There's something not quite right with flextable and quarto just yet that I haven't figured out. Specifically, this document produces output that Microsoft Word doesn't like much. If you tell it to go ahead and read the file anyway, though, the output generated seems correct:

3601

If I use output other than flextable (like gt in #3600), I don't get the warning. This is a crossref bug with quarto+flextable specifically, because if I use flextable outside of a crossreferenceable environment, I don't get the warning either.

I'm going to close this bug and open a new, more specific one.

@cscheid cscheid closed this as completed Oct 22, 2023
@cderv
Copy link
Collaborator

cderv commented Oct 30, 2023

@cscheid I do get the warning with example in #3600 using gt. We can discuss tihs in the new issue #7321 but it seems to happen with gt too for me.

Just wanted to share to be thorough.

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 tables Issues with Tables including the gt integration
Projects
None yet
Development

No branches or pull requests

3 participants