diff --git a/docs/manuscripts/authoring/_inline-computations.qmd b/docs/manuscripts/authoring/_inline-computations.qmd index 76d37f4927..9ee58e9174 100644 --- a/docs/manuscripts/authoring/_inline-computations.qmd +++ b/docs/manuscripts/authoring/_inline-computations.qmd @@ -208,15 +208,29 @@ avg_years_between_eruptions ``` ::: -::: {.content-visible unless-meta="tool.is_rstudio"} +::: {.content-visible when-meta="tool.is_jupyterlab"} You can also use computed values directly in your article text by using inline code. Read more in [Inline Code](/docs/computations/inline-code.qmd). ::: ::: {.content-visible when-meta="tool.is_rstudio"} -You can use computed values directly in your article text using the syntax `` `r expr` ``. For example, consider this line in `index.qmd`: +You can use computed values directly in your article text using the syntax `` `{{r}} expr` ``. For example, consider this line in `index.qmd`: + +``` markdown +Based on data up to and including 1971, eruptions on La Palma happen every `{{r}} round(avg_years_between_eruptions, 1)` years on average. +``` + +When rendered, it displays as: + +> Based on data up to and including 1971, eruptions on La Palma happen every 79.8 years on average. + +You can read more about using code inline at [Inline Code](/docs/computations/execution-options.qmd#inline-code). +::: + +::: {.content-visible when-meta="tool.is_vscode"} +You can use computed values directly in your article text using the syntax `` `{{python}} expr` ``. For example, consider this line in `index.qmd`: ``` markdown -Based on data up to and including 1971, eruptions on La Palma happen every `r round(avg_years_between_eruptions, 1)` years on average. +Based on data up to and including 1971, eruptions on La Palma happen every `{{python}} f"{avg_years_between_eruptions:.1f}"` years on average. ``` When rendered, it displays as: