How can I make a global set/show-set rule for dropcaps using "Droplet"?

This MWE shows how droplet can be used to produce a dropcap on any paragraph as required:

#set page(paper: "a7")
#import "@preview/droplet:0.3.1": dropcap
#set par(justify: true)

= Heading
#dropcap(
  height: 3,
  gap: 4pt,
  hanging-indent: 1em,
)[#lorem(75)]

However, I would like to use dropcaps with identical details at the beginning of every section in a long document. Would it be possible to create a set or show-set rule in the preamble of main.typ, eventually in a template, so that at each instance all I would have to enter would be #dropcap[Content of paragraph], rather than repeating the details every time.

Could someone help me please?

:slight_smile:
Mark

Hi @Mark_Hilton ,

You could just define your own like this:

#set page(paper: "a7")
#import "@preview/droplet:0.3.1": dropcap
#set par(justify: true)

// Keep original dropcap
#let orig-dropcap = dropcap

// My dropcap with my defaults
#let dropcap(body) = orig-dropcap(
  height: 3,
  gap: 4pt,
  hanging-indent: 1em,
  body,
)

= Custom
#dropcap[#lorem(20)]

= Original
#orig-dropcap[#lorem(20)]

1 Like

Thank you for this.

As always, my problem was: I know I need to define my own, but I have no idea how to set about it! I will keep my original and your solution in a reference document so that if I encounter similar needs in future, I might be able to use it as an example.

:slight_smile:
Mark

1 Like