Text Formattingverse package and line numbering

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
arma_virumque
Posts: 4
Joined: Thu May 20, 2010 7:05 pm

verse package and line numbering

Post by arma_virumque »

hi all,

It seems that the verse package can do line numbering. This is for a poem. It often happens that poems have line numbering every Nth one. In my case I grabbed some old latin texts and they appear to have this line numbering. So far I've have a pretty complete latex preamble with neat results. It almost looks professional!!

Code: Select all

\setmainfont{DejaVu Sans}


\usepackage[tiny,compact]{titlesec}
\titleformat{\chapter}[block]{\centering\bfseries\large}{LIBER \thechapter}{0pt}{}{}
\titlespacing{\chapter}{0cm}{0cm}{\baselineskip}

\usepackage[absolute]{textpos}

\usepackage[titles]{tocloft}
\addtolength{\cftchapnumwidth}{1.5cm}
\renewcommand{\cftchappresnum}{LIBER }
\setlength\cftparskip{5pt}
\setlength\cftbeforechapskip{7pt}
\setlength\cftaftertoctitleskip{2pt}
\setcounter{secnumdepth}{-1}
\addto\captionslatin{%
\renewcommand\chaptername{LIBER}}

\renewcommand{\thechapter}{\Roman{chapter}}

\titleformat{\chapter}[display]
  {\bfseries\Large}
  {\fileft\MakeUppercase{\chaptertitlename} \Huge\thechapter}
  {4ex}
  {\titlerule
   \vspace{2ex}%
   \filcenter}
  [\vspace{2ex}%
   \titlerule]

\begin{document}
%\thispagestyle{empty}
%\begin{textblock*}{\paperwidth}(0mm,0mm)
%\noindent\includegraphics[width=\paperwidth,height=\paperheight]{ovid.jpg}
%\end{textblock*}
%\null
%\clearpage
\maketitle

\tableofcontents
\newpage

\chapter{LIBER I}
\label{sec:LIBER I}
\begin{verse}
20audierat, Tyrias olim quae verteret arces; \\
hinc populum late regem belloque superbum \\
venturum excidio Libyae: sic volvere Parcas. \\
Id metuens, veterisque memor Saturnia belli, \\
prima quod ad Troiam pro caris gesserat Argis— \\
25necdum etiam causae irarum saevique dolores \\
exciderant animo: manet alta mente repostum \\
iudicium Paridis spretaeque iniuria formae, \\
et genus invisum, et rapti Ganymedis honores. \\
His accensa super, iactatos aequore toto \\
30Troas, reliquias Danaum atque immitis Achilli, \\
\end{verse}

\chapter{LIBER II}
\label{sec:LIBER II}
\begin{verse}
20audierat, Tyrias olim quae verteret arces; \\
hinc populum late regem belloque superbum \\
venturum excidio Libyae: sic volvere Parcas. \\
Id metuens, veterisque memor Saturnia belli, \\
prima quod ad Troiam pro caris gesserat Argis— \\
25necdum etiam causae irarum saevique dolores \\
exciderant animo: manet alta mente repostum \\
iudicium Paridis spretaeque iniuria formae, \\
et genus invisum, et rapti Ganymedis honores. \\
His accensa super, iactatos aequore toto \\
30Troas, reliquias Danaum atque immitis Achilli, \\
\end{verse}

\end{document}
In this example the numbers where included from my cut and paste. But there's a way to add the numbers with some latex command. I try the following \usepackage{verse} which gives me this error message:

Code: Select all

 (/usr/share/texmf-dist/tex/latex/verse/verse.sty

! LaTeX Error: Command \theHpoemline already defined.
               Or name \end... illegal, see p.192 of the manual.
Then when I exit takes me to the verse.sty which I don't know if I am supposed to touch it, I wouldn't know where to begin.

So, next I ommit \usepackage{verse} and try using \poemlines{5} after \begin{verse} and it stops with this message

Code: Select all

! Undefined control sequence.
l.9 \poemlines
              {5}
The verse documentation examples adds \poemlines{5} after \begin{verse} and \poemlines{0} before \end{verse}, which I tried as well. But it clearly doesn't work.

Has anyone succesfully got lines numbered with the verse package? And if so how do you use it? Can you give me an example?

thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply