Verseatile: Easily setting poetry with Typst

Hello everyone,

I have recently written a package for setting poetry with Typst called verseatile, that I would like to share with you. My main focus with the package is to provide an uncomplicated way to easily produce decent renditions for most kinds of poetry while also holding the capability for extensive customization and implementing helpful features for advanced use cases.

Rendering an example poem using verseatile

To get to know the basic functionality, let’s say for example, that we wanted to set a poem from Horace’s Odes (Hor. carm. I, 26):

See the full code used to produce the image.
#import "@preview/verseatile:0.2.1": *

#set page(width: auto, height: auto)

#grid(columns: 4, gutter: 60pt,

{poem[Hor. carm. I, 26][

Musis amicus tristitiam et metus \
tradam protervis in mare Creticum \
portare ventis, quis sub Arcto \
gelidae metuatur orae,

quid Tiridaten terreat, unice \
securus. O quae fontibus integris \
gaudes, apricos necte flores, \
necte meo Lamiae coronam,

Piplea dulcis. Nil sine te mei \
prosunt honores; hunc fidibus novis, \
hunc Lesbio sacrare plectro \
teque tuasque decet sorores.

][0]

v(1em); text(size: 8pt)[Step 1: Default rendering of a poem.]},

{poem[Hor. carm. I, 26][

Musis amicus tristitiam et metus \
tradam protervis in mare Creticum \
portare ventis, quis sub Arcto \
gelidae metuatur orae,

quid Tiridaten terreat, unice \
securus. O quae fontibus integris \
gaudes, apricos necte flores, \
necte meo Lamiae coronam,

Piplea dulcis. Nil sine te mei \
prosunt honores; hunc fidibus novis, \
hunc Lesbio sacrare plectro \
teque tuasque decet sorores.

][0012]

v(1em); text(size: 8pt)[Step 2: Using an `indentpattern`.]},

{show-verse-numbers.update(true)
verse-number-modulo.update(2)

poem[Hor. carm. I, 26][

Musis amicus tristitiam et metus \
tradam protervis in mare Creticum \
portare ventis, quis sub Arcto \
gelidae metuatur orae,

quid Tiridaten terreat, unice \
securus. O quae fontibus integris \
gaudes, apricos necte flores, \
necte meo Lamiae coronam,

Piplea dulcis. Nil sine te mei \
prosunt honores; hunc fidibus novis, \
hunc Lesbio sacrare plectro \
teque tuasque decet sorores.

][0012]

v(1em); text(size: 8pt)[Step 3: Numbering every second verse.]},

{show: preset-classic

poem[Hor. carm. I, 26][

Musis amicus tristitiam et metus \
tradam protervis in mare Creticum \
portare ventis, quis sub Arcto \
gelidae metuatur orae,

quid Tiridaten terreat, unice \
securus. O quae fontibus integris \
gaudes, apricos necte flores, \
necte meo Lamiae coronam,

Piplea dulcis. Nil sine te mei \
prosunt honores; hunc fidibus novis, \
hunc Lesbio sacrare plectro \
teque tuasque decet sorores.

][0012]

v(1em); text(size: 8pt)[Step 4: Using the `classic`-preset for styling.]})

Step 1: Getting started

As a first step we can render the poem simply by using the #poem-function. (Note that the end of a verse is marked with a linebreak while the end of a stanza is not):

#poem[Hor. carm. I, 26][

Musis amicus tristitiam et metus \
tradam protervis in mare Creticum \
portare ventis, quis sub Arcto \
gelidae metuatur orae,

quid Tiridaten terreat, unice \
securus. O quae fontibus integris \
gaudes, apricos necte flores, \
necte meo Lamiae coronam,

Piplea dulcis. Nil sine te mei \
prosunt honores; hunc fidibus novis, \
hunc Lesbio sacrare plectro \
teque tuasque decet sorores.

][0]

This produces a fairly plain rendition of the poem with all the verses being indented to the same level in relation to the title by default. (The base-indent can of course also be customized).

Step 2: Using an indentpattern

To achieve the desired indentation for the verses in each stanza, we can utilize the function’s third argument and specify an indentpattern that is then repeatedly applied to all the verses. For our poem – if we want to indent every third verse to the first and every fourth verse to the second level – we can provide 0012 as our indentpattern:

#poem[Hor. carm. I, 26][

Musis amicus tristitiam et metus \
tradam protervis in mare Creticum \
portare ventis, quis sub Arcto \
gelidae metuatur orae,

quid Tiridaten terreat, unice \
securus. O quae fontibus integris \
gaudes, apricos necte flores, \
necte meo Lamiae coronam,

Piplea dulcis. Nil sine te mei \
prosunt honores; hunc fidibus novis, \
hunc Lesbio sacrare plectro \
teque tuasque decet sorores.

][0012]

Step 3: Numbering verses

We can also print verse numbers and even specify that only every second verse number should be shown:

#show-verse-numbers.update(true)
#verse-number-modulo.update(2)

Step 4: Customization and styling

Most of the elements used in construction of the poem can be independently customized with verseatile. To quickly achive a decent styling we can use one of the presets, that are provided with the package:

#show: preset-classic

Advanced capabilities

Some of the packages other capabilities (as of v.0.2.1) include setting cycles of poems, inline poemtitles, adding dedications and interjections, splitting verses over multiple lines, and many options for advanced styling. You can confer the manual for detailed information.

If you would like to try out verseatile for yourself, I would be very happy to hear your feedback and suggestions for features to come!

3 Likes