I want to embed the value of a variable inside a markdown cell, which should be possible according to quarto “inline code” documentation:
```{python}
radius = 5
```
The radius of the circle is `{python} radius`
But when I try the suggested syntax, it gets rendered as the back-ticked string {python} radius
in the generated HTML, instead of the expected value (5).
Do I need to do something out of the default to enable this functionality?
In Quarto, to embed the value of a variable in a markdown cell using inline code, you should use the following syntax. Instead of the curly braces you provided, use single backticks and specify the code chunk language directly. Here’s how you can do it: Vantage ADP
radius = 5
The radius of the circle is r radius.
Make sure you're using the correct inline code syntax with `r` before the variable name. This should correctly render the value of `radius` (5) in the generated HTML output. If you're still facing issues, ensure that your Quarto version is up to date and that you're running the document correctly.
Thanks for the reply!
I tried your suggestion, but I got the same result. Maybe some parts of it got scrambled in the formatting?
To be clear: I am not trying to render a Quarto document directly, I am trying to render a notebook using nbdev
, and since I know I can render inline variables in Quarto with the syntax I linked, I was wondering if this functionality was also available in nbdev
. The variable I am trying to render is actually computed in a notebook cell.
My Quarto and nbdev versions are both the latest available (1.5.57 and 2.3.31 respectively)