How can I have an uncaptioned table nested within a custom crossref environment? #12519
-
DescriptionI have a custom cross-reference (float) environment defined, that works without concern. However, if I end up using an (uncaptioned) Markdown table within the div for the custom cross-reference, the cross-reference becomes unnumbered/unlabelled in the rendered HTML. I am not sure whether this is a misunderstanding of the expected behaviour or whether there may be a workaround for this. From my perspective, the expected behaviour would be to have cross-reference still labelled, with no caption required, as it is for the instances without tables within them. If I have uncaptioned figures, they work as expected (as do divs with no nesting of cross-reference environments). Reproducible Example---
title: "Minimal Example for Cross-Reference Problem"
format: html
crossref:
custom:
- kind: float
reference-prefix: My Cross Ref
key: mcr
mcr-cap-location: top
---
:::{#mcr-1}
I work as intended!
:::
::::{#mcr-2}
I do not work. I think because of this table:
| Table |
| :------------------: |
| Basic Table Here ... |
::::
:::{#mcr-3}
If I use two captions here, then the numbering returns.
| Table |
| :------------------: |
| Basic Table Here ... |
: This is the table caption.
<!-- Anything written below the table caption stands in as a caption for the MCR -->
This is the MCR Caption
::: DetailsRunning Windows 11.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
It's not about the table, it's because your code is not a valid cross-reference div at least to get what you want. A cross-reference div is: ::: {#prefix-label}
content
caption
::: The line before the table is a content and so your table is the caption. |
Beta Was this translation helpful? Give feedback.
Note that the current stable version is 1.6.43, the Release Candidate is 1.7.23 and that 1.6.32 is an old pre-release.
If you intend to use pre-releases, please ensure to keep it up to date.