I am typesetting a text in the classics. A part of it consists of numbered verses. For each verse line I would like to show (1) a line number, (2) the verse text, and (3) an optional "clause".
As there are tens of thousands of these verses and most are rather short, I would like to set the document with two columns. Some verses are very long, so it is important to fill them like paragraphs. Finally, the line numbers that appear to the left of the verses should be set manually (they are generated by a script).
The following is the best I have come up with so far (note that the command "clause" is defined to ensure that the clauses appear on the right even after a line break):
\documentclass[9pt, DIV=22]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\setlength{\parindent}{0cm}
\begin{document}
\twocolumn
\newcommand\clause[1]{{%
\unskip\nobreak\hfil\penalty50
\hskip2em\hbox{}\nobreak\hfil\textbf{#1}%
\parfillskip=0pt \finalhyphendemerits=0 \par}}
\section{Traktate}
\subsection{Ad Demetrianum}
{\tiny 1} \textbf{1} Oblatrantem te
% Most verses are short.
{\tiny 2} et aduersus Deum
{\tiny 3} qui unus et uerus est
\clause{T2gdz}
{\tiny 4} ore sacrilego
\clause{Tg}
{\tiny 5} et uerbis impiis
{\tiny 6} obstrepentem frequenter,
\clause{Pg}
{\tiny 7} Demetriane,
{\tiny 8} contempseram
{\tiny 9} uerecundius et melius existimans
{\tiny 10} errantis inperitiam silentio spernere
\clause{T2d}
{\tiny 11} quam loquendo dementis insaniam prouocare.
\clause{V3d}
{\tiny 12} Nec hoc sine magisterii diuini auctoritate faciebam,
\clause{TT12g}
{\tiny 13} cum scriptum sit:
% Many verses span multiple lines, a few are very long.
{\tiny 14} In aures inprudentis noli quicquam dicere, ne quando audierit inrideat sensatos sermones tuos, [Prou. 23, 9]
\clause{bib}
\end{document}
I wonder: Is there a way to put the line numbers in a "column of their own"? This would mean that the numbers are right-aligned, and that the verse texts are set in a separate column to the right of the line numbers.
The obvious solution seems to be to use tables. Here the problem is that most table packages do not support \twocolumn or multicol and tables spanning multiple pages. I almost succeeded with the "tabu" package using a trick to make it work with multiple columns. But a problem that I have been unable to solve is that when using tables long verses are not split across pages. Since some verses take up half of a page this is not acceptable.
If there was a way to specify a prefix that will be prepended to each physical line after the text has been filled, the above example could be modified to fulfill all the requirements.