Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to introduce line numbers in a hymn on specific lines. I'm using the lineno package but I'm having no luck with it. Ideally I'd like a macro that I can use to say place line number here. I'm manually breaking the lines using \\ so there is no confusion about where the lies will be. Any good packages or ideas?

share|improve this question
    
If you use \\ , I'd just redefine it (maybe locally) to count lines and optionally (maybe as \\*?) put the line number in the margin. (Sorry, no time to code this now, so I'm just throwing in a comment.) –  mbork Jun 25 '12 at 20:03
    
Are you referring to something like a modulo numbering? Or just certain paragraphs that have numbers, intermixed with paragraphs that don't have line numbers? –  Werner Jun 25 '12 at 20:05
add comment

1 Answer

up vote 7 down vote accepted

The package verse can number verses with a certain interval between numbers. In the example I number every fifth verse. There are many customizations possible.

\documentclass{article}
\usepackage{verse}

\begin{document}

\settowidth{\versewidth}{Quid sum miser tunc dicturus?}
\verselinenumbersleft
\verselinenumfont{\footnotesize}
\setlength{\vrightskip}{-8em}

\poemtitle{Dies Irae}

\poemlines{5}

\begin{verse}[\versewidth]
Dies Irae, dies illa\\
solvet saeclum in favilla:\\
teste David cum Sybilla.\\!
Quantus tremor est futurus,\\
Quando judex est venturus,\\
Cuncta stricte discussurus.\\!
Tuba, mirum spargens sonum\\
per sepulcra regionum\\
coget omnes ante thronum.\\!
Mors stupebit et natura,\\
cum resurget creatura,\\
judicanti responsura.\\!
Liber scriptus proferetur,\\
in quo totum continetur,\\
unde mundus judicetur.\\!
Judex ergo cum sedebit,\\
quidquid latet, apparebit:\\
nil inultum remanebit.\\!
Quid sum miser tunc dicturus?\\
quem patronum rogaturus,\\
cum vix justus sit securus?\\!
Rex tremendae majestatis,\\
qui salvandos salvas gratis,\\
salva me, fons pietatis.\\!
Recordare, Jesu pie,\\
quod sum causa tuae viae\\
ne me perdas illa die.\\!
Quaerens me, sedisti lassus,\\
redemisti Crucem passus:\\
tantus labor non sit cassus.\\!
Juste judex ultionis,\\
donum fac remissionis\\
ante diem rationis.\\!
Ingemisco, tamquam reus,\\
culpa rubet vultus meus\\
supplicanti parce, Deus.\\!
Qui Mariam absolvisti,\\
et latronem exaudisti,\\
mihi quoque spem dedisti.\\!
Preces meae non sunt dignae,\\
sed tu bonus fac benigne,\\
ne perenni cremer igne.\\!
Inter oves locum praesta,\\
et ab haedis me sequestra,\\
statuens in parte dextra.\\!
Confutatis maledictis,\\
flammis acribus addictis,\\
voca me cum benedictis.\\!
Oro supplex et acclinis,\\
cor contritum quasi cinis:\\
gere curam mei finis.\\!
Lacrimosa dies illa,\\
qua resurget ex favilla\\!
Judicandus homo reus.\\
huic ergo parce, Deus:\\!
Pie Jesu Domine,\\
dona eis requiem. Amen.
\end{verse}
\end{document}

enter image description here


If specific lines must have a number, then a different approach can be used:

\documentclass{article}
\usepackage{verse}

\newcommand{\?}{%
  \makebox[0pt][r]{\footnotesize\makebox[1em][r]{\thepoemline}\hspace{2em}}%
\ignorespaces}


\begin{document}

\settowidth{\versewidth}{Quid sum miser tunc dicturus?}
\verselinenumbersleft
\verselinenumfont{\footnotesize}

\poemtitle{Dies Irae}
\begin{verse}[\versewidth]
Dies Irae, dies illa\\
solvet saeclum in favilla:\\
teste David cum Sybilla.\\!
Quantus tremor est futurus,\\
Quando judex est venturus,\\
\?Cuncta stricte discussurus.\\!
Tuba, mirum spargens sonum\\
per sepulcra regionum\\
\?coget omnes ante thronum.\\!
Mors stupebit et natura,\\
cum resurget creatura,\\
judicanti responsura.\\!
\?Liber scriptus proferetur,\\
in quo totum continetur,\\
unde mundus judicetur.\\!
Judex ergo cum sedebit,\\
quidquid latet, apparebit:\\
nil inultum remanebit.\\!
Quid sum miser tunc dicturus?\\
quem patronum rogaturus,\\
cum vix justus sit securus?\\!
Rex tremendae majestatis,\\
qui salvandos salvas gratis,\\
salva me, fons pietatis.\\!
Recordare, Jesu pie,\\
quod sum causa tuae viae\\
ne me perdas illa die.\\!
Quaerens me, sedisti lassus,\\
redemisti Crucem passus:\\
tantus labor non sit cassus.\\!
Juste judex ultionis,\\
donum fac remissionis\\
ante diem rationis.\\!
Ingemisco, tamquam reus,\\
culpa rubet vultus meus\\
supplicanti parce, Deus.\\!
Qui Mariam absolvisti,\\
et latronem exaudisti,\\
mihi quoque spem dedisti.\\!
Preces meae non sunt dignae,\\
sed tu bonus fac benigne,\\
ne perenni cremer igne.\\!
Inter oves locum praesta,\\
et ab haedis me sequestra,\\
statuens in parte dextra.\\!
Confutatis maledictis,\\
flammis acribus addictis,\\
voca me cum benedictis.\\!
Oro supplex et acclinis,\\
cor contritum quasi cinis:\\
gere curam mei finis.\\!
Lacrimosa dies illa,\\
qua resurget ex favilla\\!
Judicandus homo reus.\\
huic ergo parce, Deus:\\!
Pie Jesu Domine,\\
dona eis requiem. Amen.
\end{verse}
\end{document}

The line to be numbered are marked with \?; any number of spaces can follow this command.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.