Render an emphatic object to typst
as_typst(x, ..., font_size = 10, font = NA, line_spacing = 0.3)
emphatic object
other arguments passed to as.character.emphatic()
font size in points. default: 10
name of font. Default: NA means to just use the default raw font
line spacing in em
units. Default: 0.3
Character string containing typst
representation
hl_diff("hello", "there") |>
as_typst() |>
cat()
#>
#> ```{=typst}
#> #[
#> #set text(size: 10pt, hyphenate: false)
#> #set par(leading: 0.3em)
#>
#> #[#[`[1] "`]]#text(fill: rgb("#000000"))[#highlight(fill: rgb("#9aff9a"))[` `]]#[#[`he`]]#text(fill: rgb("#000000"))[#highlight(fill: rgb("#97ffff"))[`ll`]]#text(fill: rgb("#000000"))[#highlight(fill: rgb("#ff7f50"))[`o`]]#[#[`"`]]\
#> #[#[`[1] "`]]#text(fill: rgb("#000000"))[#highlight(fill: rgb("#9aff9a"))[`t`]]#[#[`he`]]#text(fill: rgb("#000000"))[#highlight(fill: rgb("#97ffff"))[`re`]]#text(fill: rgb("#000000"))[#highlight(fill: rgb("#ff7f50"))[` `]]#[#[`"`]]
#> ]
#> ```