quarto-highlight-text

Quarto extension that allows to highlight text in a document for various formats: HTML, LaTeX, Typst, Reveal.js, Beamer, PowerPoint, and Docx.

https://github.com/mcanouil/quarto-highlight-text

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.2%) to scientific vocabulary

Keywords

docx highlight highlight-text html latex quarto quarto-extension quarto-filter quarto-pub quartopub typst
Last synced: 6 months ago · JSON representation ·

Repository

Quarto extension that allows to highlight text in a document for various formats: HTML, LaTeX, Typst, Reveal.js, Beamer, PowerPoint, and Docx.

Basic Info
Statistics
  • Stars: 27
  • Watchers: 1
  • Forks: 2
  • Open Issues: 2
  • Releases: 17
Topics
docx highlight highlight-text html latex quarto quarto-extension quarto-filter quarto-pub quartopub typst
Created almost 2 years ago · Last pushed 9 months ago
Metadata Files
Readme Funding License Citation

README.md

Highlight-text Extension For Quarto

This is a Quarto extension that allows to highlight text in a document for various format: HTML, LaTeX, Typst, and Docx.

Installing

bash 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:

yaml filters: - highlight-text

Then you can use the span syntax markup to highlight text in your document, e.g.:

markdown [Red]{colour="#b22222" bg-colour="#abc123"} # UK [Blue]{color="#0000FF" bg-color="#ABC123"} # US

You can also use the shorter syntax (v1.1.1):

markdown [Red]{fg="red" bg="primary"}

Using colours from _brand.yml (v1.1.0):

yaml color: palette: red: "#b22222" primary: "#abc123"

markdown [Red]{colour="brand-color.red" bg-colour="brand-color.primary"}

Using colours from light/dark themes with Quarto CLI >=1.7.28 (v1.2.0):

  • From document front matter:

yaml brand: light: color: palette: fg: "#ffffff" bg: "#b22222" dark: color: palette: fg: "#b22222" bg: "#ffffff"

  • From _quarto.yml and _brand.yml file

yaml brand: dark: _brand.yml

markdown [Light: White/Red | Dark: Red/White]{colour="brand-color.fg" bg-colour="brand-color.bg"}

[!NOTE] Only the html support light/dark mode switching. The other formats will use the light mode colours if available or the dark mode colours otherwise.

Limitations

LaTeX \colorbox command does not support wrapping/line breaks in the text to be highlighted. This means that the above example will not work well in LaTeX output.
In order to get a slightly better result, you can use the par=true attribute to add \parbox{\linewidth}:

markdown [Red]{colour="#b22222" bg-colour="#abc123" par=true}

Use pdf-engine: lualatex in your YAML front matter to use the luatex engine and fully alleviate the above issue.

Examples

Here is the source code for a minimal example: example.qmd.

Outputs of example.qmd:

Owner

  • Name: Mickaël Canouil
  • Login: mcanouil
  • Kind: user
  • Location: Lille, France

Biostatistician, Ph. D. (& cinephile) @RLille User Group Organiser

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Highlight-text Extension For Quarto"
message: "If you use this project, please cite it as below."
type: software
authors:
  - family-names: "Canouil"
    given-names: "Mickaël"
    orcid: "https://orcid.org/0000-0002-3396-4549"
repository-code: "https://github.com/mcanouil/quarto-highlight-text"
url: "http://m.canouil.dev/quarto-highlight-text/"
license: "MIT"
date-released: "2025-05-05"
version: 1.3.3

GitHub Events

Total
  • Create event: 32
  • Release event: 12
  • Issues event: 13
  • Watch event: 18
  • Delete event: 22
  • Issue comment event: 17
  • Push event: 50
  • Pull request review event: 2
  • Pull request event: 43
  • Fork event: 1
Last Year
  • Create event: 32
  • Release event: 12
  • Issues event: 13
  • Watch event: 18
  • Delete event: 22
  • Issue comment event: 17
  • Push event: 50
  • Pull request review event: 2
  • Pull request event: 43
  • Fork event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 30
  • Average time to close issues: 13 days
  • Average time to close pull requests: 1 day
  • Total issue authors: 7
  • Total pull request authors: 3
  • Average comments per issue: 1.45
  • Average comments per pull request: 0.07
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 5
  • Pull requests: 22
  • Average time to close issues: 13 days
  • Average time to close pull requests: 2 days
  • Issue authors: 5
  • Pull request authors: 2
  • Average comments per issue: 2.2
  • Average comments per pull request: 0.09
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 8
Top Authors
Issue Authors
  • mcanouil (6)
  • jooyoungseo (2)
  • robert-koetsier (1)
  • espinielli (1)
  • apcamargo (1)
  • parmsam (1)
  • bhelsel (1)
  • Steinthal (1)
Pull Request Authors
  • mcanouil (32)
  • github-actions[bot] (8)
  • jooyoungseo (2)
Top Labels
Issue Labels
Type: Enhancement :bulb: (8) Difficulty: [2] Intermediate (7) Priority: [1] Low (5) Priority: [2] Medium (3) Type: Bug :bug: (3) Difficulty: [1] Novice (2) Status: Help :sos: (1) Status: Good First Issue :beginner: (1) Priority: [3] High (1)
Pull Request Labels
Type: Enhancement :bulb: (12) Type: CI/CD :robot: (11) Type: Bug :bug: (10) Type: Documentation :memo: (5) Type: Refactor :fire: (3)

Dependencies

.github/workflows/deploy.yml actions
  • actions/checkout v4 composite
  • actions/configure-pages v5 composite
  • actions/deploy-pages v4 composite
  • actions/upload-pages-artifact v3 composite
  • quarto-dev/quarto-actions/setup v2 composite