-
When I'm adding example code to a book project, how do I specify the code block to have a caption and to be formatted with line numbers while still having the relevant syntax highlighting? For example how would I create the following listing? Treating it like a table doesn't seem to work. Maybe it's not currently possible to do something like this with quarto?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
This is documented under https://quarto.org/docs/authoring/figures.html and https://quarto.org/docs/output-formats/html-code.html#highlighting |
Beta Was this translation helpful? Give feedback.
-
I posted on the Posit community before being reminded this might be the right place to ask. I can't figure out how to use
|
Beta Was this translation helpful? Give feedback.
-
I've been able to make it work by using inline chunk options, like so:
So perhaps the issue is with the in-chunk options? |
Beta Was this translation helpful? Give feedback.
This is documented under https://quarto.org/docs/authoring/figures.html and https://quarto.org/docs/output-formats/html-code.html#highlighting