Cross Reference to table is not working. Getting warning unable to resolved. #6311
-
Descriptionformat: This Does not works. Cross reference is listed in 'insert Cross Reference' window. What am I missing here? See @tbl-missing
Render output Warning |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks. 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.
```` |
Beta Was this translation helpful? Give feedback.
-
Here is the output in pdf for Figure reference: Here is the output in pdf for Table reference: Here is example code. ---
title: "Quarto Document"
format: pdf
---
See Plot @fig-plot
```{r}
#| label: fig-plot
#| fig-cap: Iris Plot
plot(iris$Sepal.Length)
```
See @tbl-iris
```{r tableRef}
#| label: tbl-iris
#| tbl-cap: Table Iris
iris = head(iris)
# Print
knitr::kable(iris, booktabs = T, align='c',
caption = "Table Iris")|>
kable_styling(latex_options = c("striped", "HOLD_position"))
```
|
Beta Was this translation helpful? Give feedback.
-
What do you mean by "This is because your table code cell contains two labels, one inline (i.e., tableRef) and one as yaml (i.e., tbl-iris)." "Finally, don't use both tbl-cap: Table Iris and caption = "Table Iris"." Are they are related? |
Beta Was this translation helpful? Give feedback.
-
See Table @tbl-Test
See Table @tbl-Test
-- See @fig-Test
|
Beta Was this translation helpful? Give feedback.
-
Edit: Not sure if this really was the source and solution of my problem.
#| eval: true
#| label: fig-myfig
#| fig-cap: This is my figure
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show() But this worked: #| label: fig-myfig
#| fig-cap: This is my figure
#| eval: true
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show() |
Beta Was this translation helpful? Give feedback.
Everything works just fine if you follow the documentation about figure/table cross-reference and don't mixed inline/multiline/yaml style syntax for code cell options.
See https://quarto.org/docs/authoring/cross-references.html and https://yihui.org/en/2022/01/knitr-news/.