13.10.12 Verse blocks in LaTeX export

LaTeX 导出后端为诗歌块支持五个属性: ‘:lines’ 、 ‘:center’ 、 ‘:versewidth’ 、 ‘:latexcode’ 与 ‘:literal’ 。前三个需要外部 LaTeX 宏包 ‘verse.sty’ ,该宏包是标准 LaTeX verse 环境的扩展。

:lines

为诗歌添加行号标注,值为整数,指定行号递增步长。

:center

值为 ‘t’ 时,所有诗歌按排版惯例光学居中,以最长行为基准,最长行需通过 ‘:versewidth’ 属性指定。

:versewidth

值为文本字符串,即诗歌中最长的一行。

:latexcode

接受可插入 LaTeX ‘verse’ 环境内的任意 LaTeX 代码。

:literal

值为 t 时保留所有空行,导出为 ‘\vspace*{\baselineskip}’ ,包括内容前后的空行。 注意未设置 ‘:literal’ 时,诗节间多个空行会导出为单个空行,内容前后空行会被移除,更符合 LaTeX ‘verse’ 环境与 ‘verse’ 宏包的语法规范。 若已加载 ‘verse’ 宏包,可通过全局长度 ‘\stanzaskip’ 控制诗节间距(参见 https://www.ctan.org/pkg/verse)。

完整示例(莎士比亚第一首十四行诗):

#+ATTR_LATEX: :center t :latexcode \color{red} :lines 5
#+ATTR_LATEX: :versewidth Feed’st thy light’s flame with self-substantial fuel,
#+BEGIN_VERSE
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.
#+END_VERSE