Further to my thread at:
If you are using “Droplet” and the paragraph begins with either “A” or “I” followed by a space, the space is included as part of the dropcap, as follows:
#set page(paper: "a7")
#set par(first-line-indent: 1em, spacing: 0.5em, justify: false)
#import "@preview/droplet:0.3.1": dropcap
// Keep original dropcap
#let orig-dropcap = dropcap
// My dropcap with my defaults
#let dropcap(body) = orig-dropcap(
height: 2,
gap: 1pt,
hanging-indent: 0pt,
body,
)
==== Heading
#dropcap[A bit #lorem…
I have been trying to add colour to the dropcaps, and eventually have come up with this code:
#set page(width: 12cm, height: auto)
#set par(first-line-indent: 1em, spacing: 0.5em, justify: false)
#import "@preview/droplet:0.3.1": dropcap
// Keep original dropcap
#let orig-dropcap = dropcap
// Dropcap with my defaults
#let dropcap = orig-dropcap.with(
height: 2,
gap: 1pt,
hanging-indent: 0pt,
color: (rgb("#c00000")),
stroke: 0.5pt + rgb("#c00000"))
)
==== Heading
#dropcap[W][hy #lorem(8)]
==== Heading
#dropcap[A#h(1pt)][bit #lorem(8)]
==== Heading
#dropcap[I#h(2pt)][can #lorem(8)]
which compiles as I would like. However, Typst gives a warning: Unexpected argument: color
How can I set the colour of the dropcaps without throwing up the warning?
Many thanks
Mark
Andrew
November 14, 2025, 11:55am
2
That’s an error. Warning will still allow compiling the document.
If you read the documentation , there is no color argument. And text doesn’t have one, either. There is fill, if that is what you’re implying.
Thanks so much. Yes, that was it. It just shows how we non-coders, used to word processors or page-makeup software think in terms of text having a colour rather than a shape with a fill of some colour.
All good.
Mark