Poetry Typesetting – Best Practices

poetry

I have ~250 poems to typeset, consisting of ~40 verses each. 99% are in this form:

line 1
line 2
line 3
line 4

line 5
line 6
line 7
line 8

...

The "source" of each poem is a PDF file which I use to copy / paste into a plain text file.

Now the task is to format these poems while avoiding too much markup. I could do this:

\begin{verse}
line 1 \\
line 2 \\
line 3 \\
line 4 \\
\end{verse}

\begin{verse}
line 5 \\
line 6 \\
line 7 \\
line 8 \\
\end{verse}

But I much prefer not adding \begin{verse} and \end{verse} around each verse and I would like to avoid the double backslash at the end of each line. What can I do?

Some "rules"

  • No page break is allowed inside a 4 line verse
  • I want to avoid markup, but if it's not possible, its OK to add markup
  • All exceptions are handeld manually
  • No other special formatting is required (each of the four lines are flush left and ragged right, no automatic line breaking
  • Some poems should be mulitcolumn, if feasible
  • Each poem is in its own file, having a \title{...} and a \date{...} before it starts (I could put this somewhere else though).

Best Answer

enter image description here

\documentclass[twocolumn]{article}

\textheight.5\textheight

\begingroup
\makeatletter
\catcode13\active%
\gdef\verseinput#1{%
{%
\interlinepenalty\@M%
\def^^M{\@ifnextchar^^M\par{\ifhmode\break\fi}}%
\rightskip\fill%
\parindent\z@%
\parskip\baselineskip%
\raggedbottom%
\catcode13\active\input{#1}%
\par%
}}%
\endgroup%
\begin{document}

\verseinput{v1.txt}

\end{document}

line 1
line 2
line 3
line 4

line 5
line 6
line 7
line 8

line 9
line 10
line 11
line 12

line a9
line a10
line a11
line a12

line b9
line b10
line b11
line b12

line a9
line a10
line a11
line a12

line b9
line b10
line b11
line b12

line a9
line a10
line a11
line a12

line b9
line b10
line b11
line b12

line a9
line a10
line a11
line a12

line b9
line b10
line b11
line b12

line a9
line a10
line a11
line a12

line b9
line b10
line b11
line b12
Related Question