I want to get the current chunk label inside a chunk. Is this possible?
```{r my_chunk}
gettextf("This chunk is called %s", some_function_to_get_chunk_label())
```
You can use opts_current$get
eg...
opts_current$get(name = 'label')
eg
cat(knit(text ="
```{r 'hello'}
render_markdown(strict=TRUE)
opts_current$get(name = 'label')
```
"))
Which gives
render_markdown(strict = TRUE)
opts_current$get(name = "label")
## [1] "hello"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With