Highlight-text Quarto Extension
This is a Quarto extension that allows to highlight text in a document for various format: HTML, LaTeX, Typst, and Docx.
Installing
quarto add mcanouil/quarto-highlight-text
This will install the extension under the _extensions
subdirectory. If you’re using version control, you will want to check in this directory.
Using
To use the extension, add the following to your document’s front matter:
filters:
- highlight-text
Then you can use the span syntax markup to highlight text in your document.
[Red]{colour="#b22222" bg-colour="#abc123"} # UK
[Blue]{color="#0000FF" bg-color="#ABC123"} # US
Font Colour
[Red text]{colour="#b22222"}
Red text
[Blue text]{color="#0000FF"}
Blue text
Background Colour
[Red background]{bg-colour="#b22222"}
Red background
[Blue background]{bg-color="#0000FF"}
Blue background
Font and Background Colour
[White text, Red background]{
colour="#FFFFFF" bg-colour="#b22222"
}
White text, Red background
[White text, Blue background]{
color="#FFFFFF" bg-color="#0000FF"
}
White text, Blue background
More Examples
[text [with a link](https://quarto.org/)]{
color="#FFFFFF" bg-color="#00FFFF"
}
text with a link