Skip to content

Fix for italic/bold text in typst #24

Description

@ASNDataAnalytics

The underscores aren't being parsed as italic markup because you're passing a string (in quotes), not content (in square brackets).

In Typst, "From Away" is a string literal — the underscores are just literal characters, like any other text in a string. Typst's markup syntax (... for italics, ... for bold, etc.) only gets parsed when you're in markup/content mode, not inside a quoted string.

Fix: use square brackets instead of quotes:

typst
#highlight_box[From Away—Native Mainers' term describing anyone born outside the state of Maine.]

That passes actual content to your function, so the underscores are interpreted as markup and render italic.

If you ever do need italics from a string value (e.g. it's stored as a variable), you'd need #emph(the_string) instead, since string markup won't auto-parse:

typst
#highlight_box(emph("From Away—Native Mainers' term..."))

But for a literal string like this, switching "..." → [...] is the simplest fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions