Rendering code cells containing labels in .ipynb output #13905
-
DescriptionI am puzzled by some behavior I observe when rendering to .ipynb. Possibly related to #12242? I am aiming to I am running quarto render test.qmd --no-executeContents of ---
format: ipynb
title: Test
wrap: none
---
I expect this .qmd when rendered to ipynb to contain two Markdown and two code cells.
```{python}
#| label: fig-test
print("This renders to part of a Markdown cell.")
```
But instead I got a single Markdown cell. @fig-test is not being rendered as a code cell.
```{python}
print("This renders to a code cell.")
```Expected ResultI was expecting/hoping the resulting .ipynb to contain four cells: the first and third Markdown, the second and fourth executable code blocks. # Test
I expect this .qmd when rendered to ipynb to contain three Markdown and two code cells.print("This renders to part of a Markdown cell.")Figure 1
But instead I got a single Markdown cell. <a href="#fig-test" class="quarto-xref">Figure 1</a> is not being rendered as a code cell.print("This renders to a code cell.")Observed ResultThe resulting # Test
I expect this .qmd when rendered to ipynb to contain three Markdown and two code cells.
``` python
print("This renders to part of a Markdown cell.")
```
Figure 1
But instead I got a single Markdown cell. <a href="#fig-test" class="quarto-xref">Figure 1</a> is not being rendered as a code cell.Followed by code cell print("This renders to a code cell.")Quarto version 1.8.25 on MacOS 15.1. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
|
What do you expect a cross-reference to do in this context? What is exactly the use case behind? |
Beta Was this translation helpful? Give feedback.
-
|
Hello, I was just wondering whether there was anything that can be said to explain this behavior. I'm happy to try to achieve my use case with a Lua filter (and have tried a bit), but I'm stuck and confused on how exactly the presence of the label + cross reference leads to the behavior shown, so I don't really know what the filter should try to modify. |
Beta Was this translation helpful? Give feedback.
-
|
For reference, as design choices relates to: |
Beta Was this translation helpful? Give feedback.
I have a workaround, but using the div syntax and execution: