13.10.12 Verse blocks in LaTeX export

The LaTeX export backend accepts five attributes for verse blocks: ‘:lines’, ‘:center’, ‘:versewidth’, ‘:latexcode’ and ‘:literal’. The three first require the external LaTeX package ‘verse.sty’, which is an extension of the standard LaTeX environment.


To add marginal verse numbering. Its value is an integer, the sequence in which the verses should be numbered.


With value ‘t’ all the verses on the page are optically centered (a typographic convention for poetry), taking as a reference the longest verse, which must be indicated by the attribute ‘:versewidth’.


Its value is a literal text string with the longest verse.


It accepts any arbitrary LaTeX code that can be included within a LaTeX ‘verse’ environment.


With value t, all blank lines are preserved and exported as ‘\vspace*{\baselineskip}’, including the blank lines before or after contents. Note that without the ‘:literal’ attribute, one or more blank lines between stanzas are exported as a single blank line, and any blank lines before or after the content are removed, which is more consistent with the syntax of the LaTeX ‘verse’ environment, and the one provided by the ‘verse’ package. If the ‘verse’ package is loaded, the vertical spacing between all stanzas can be controlled by the global length ‘\stanzaskip’ (see https://www.ctan.org/pkg/verse).

A complete example with Shakespeare’s first sonnet:

#+ATTR_LATEX: :center t :latexcode \color{red} :lines 5
#+ATTR_LATEX: :versewidth Feed’st thy light’s flame with self-substantial fuel,
From fairest creatures we desire increase,
That thereby beauty’s rose might never die,
But as the riper should by time decease
His tender heir might bear his memory
But thou, contracted to thine own bright eyes,
Feed’st thy light’s flame with self-substantial fuel,
Making a famine where abundance lies,
Thyself thy foe, to thy sweet self too cruel.
Thou that art now the world’s fresh ornament,
And only herald to the gaudy spring,
Within thine own bud buriest thy content,
And, tender churl, mak’st waste in niggardly.
Pity the world, or else this glutton be,
To eat the world’s due, by the grave and thee.