typst/tests/typ/text/decorations.typ
Laurenz 594809e35b Library functions behave more imperatively
- Templates scope state changes
- State-modifying function operate in place instead of returning a template
- Internal template representation contains actual owned nodes instead of a pointer to a syntax tree + an expression map
- No more wide calls
2021-08-17 22:20:37 +02:00

35 lines
858 B
Typst

// Test text decorations.
---
#let red = rgb("fc0030")
// Basic strikethrough.
#strike[Statements dreamt up by the utterly deranged.]
// Move underline down.
#underline(offset: 5pt)[Further below.]
// Different color.
#underline(red)[Critical information is conveyed here.]
// Inherits font color.
[#font(fill: red) #underline[Change with the wind.]]
// Both over- and underline.
#overline(underline[Running amongst the wolves.])
// Disable underline by setting it back to 0pt.
#underline[Still important, but not #underline(0pt)[mission ]critical.]
---
#let redact = strike with (10pt, extent: 5%)
#let highlight = strike with (
stroke: rgb("abcdef88"),
thickness: 10pt,
extent: 5%,
)
// Abuse thickness and transparency for redacting and highlighting stuff.
Sometimes, we work #redact[in secret].
There might be #highlight[redacted] things.