Skip to content

Use of inline r code in code-chunk options fig-cap and tbl-cap #6193

Answered by mcanouil
larnsce asked this question in Q&A
Discussion options

You must be logged in to vote

This thread is very old.
As with recent version of Quarto, I would highly recommend to avoid !expr which is knitr specific and can lead to very weird syntax.

Use the cross-reference div syntax and inline code.

::: {#<prefix>-<whatever-name>}

```{language}
Code
```

The caption with `{language} code`.
::: 

@fig-{{var}} is not an R expression in your case.
What you provide to !expr still needs to be valid R code.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@larnsce
Comment options

@jkylearmstrong
Comment options

@mcanouil
Comment options

Answer selected by mcanouil
Comment options

You must be logged in to vote
1 reply
@mcanouil
Comment options

Comment options

You must be logged in to vote
1 reply
@mcanouil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
4 participants