How to highlight some words in a verbatim block #7697
-
DescriptionIs there a way to highlight specific words in a code block? For example, consider this block to simulate an interactive program execution:
I wish what the user typed to have a distinct color or be highlighted someway. Something like: What is your name? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I don't think you can or you would need to define a highlight style as for programming languages. |
Beta Was this translation helpful? Give feedback.
-
I think you could create your own syntax. See https://hamel.dev/notes/quarto/highlighting.html |
Beta Was this translation helpful? Give feedback.
-
I ended writing my own simple language, thank you. It just highlights text between null characters to differentiate user input from the rest. I opted to use It works with HTML and I had to add To work with Quarto:
|
Beta Was this translation helpful? Give feedback.
I ended writing my own simple language, thank you.
terminal.xml.zip
It just highlights text between null characters to differentiate user input from the rest. I opted to use
\0
to render "invisible" characters. Since my examples are generated by a program, I don't have to type de null characters.It works with HTML and I had to add
\catcode0=9
to allow nulls in TeX files.To work with Quarto: