Use correct table/figure references when child document (template) is rendered multiple times #10644
Replies: 2 comments
-
My tentative conclusion is that this isn't yet supported. Is that correct? Are there plans to support this sort of pattern? |
Beta Was this translation helpful? Give feedback.
-
Hi, see if figure-table-formatter can solve your issue. You can cross-reference the figures and tables in the order that they are mentioned in the text, and sort them accordingly. It automatically outputs a file with the sorted tags of the figures and tables. You can use this file to automatically sort the figures in other files using the same filter (handy for supplements). It would be nice to have the same functionality in the native Quarto, but at least this is a viable alternative now. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I asked a question on stackoverflow about this but it may be more of a "feature request" than a true SO question for how to do a thing. The following content is largely copied from the SO question:
When repeatedly using child documents with figures/tables all references are to the last version of the figure/table in the document/site. I set up a github repo to make a minimum reproducible example, since it's too much code to dump here. Just clone the repo and run
quarto render
.Details:
I have a quarto book project that uses the
knitr
engine. It conducts an analysis on several different days of data. To do this I have a quarto document for each day with parameters in the YAML header, e.g.,In the body of the document I have
I generate a book (HTML or PDF) using
quarto render
. There is a chapter for each day, and theday-template.qmd
analysis executed for each chapter. The problem is that even though I'm allowing duplicate labels, the figure references using those labels are not correct.E.g., if there is a code chunk in
day-template.qmd
that generates a plot with the labelfig-a
. I can reference that figure in the body ofday-template.qmd
using@fig-a
. However ifday-template.qmd
is creating content for chapters 2 and 3, then the@fig-a
reference that is in chapter 2 will reference the version of the figure in chapter 3.Here is what it looks like when rendered to PDF:
Is there a way to help quarto figure out how to properly configure figure labels in this case?
Beta Was this translation helpful? Give feedback.
All reactions