0

I would like line numbers to not reset when using poetry environment.

Consider this MWE:

\documentclass{article}
\usepackage{poetry}

\setcounter{poemlinenumsevery}{5}

\begin{document}

{\bf First}

\begin{poem}
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\!

Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\!
\end{poem}

{\bf Second}

\begin{poem}
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\!

Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\!
\end{poem}

\end{document}

Is there a way to make the line numbering continue counting even though you've started a new verse environment?

4
  • For some reasons I can't compile your code, or modifications to it. However, its manual Ch. 3.1 desribes how to use verseline , there as a standard renewcommand . Just simplify the example to your needs, i.e. delete :\arabic{verseline} from the example given.
    – MS-SPO
    Commented May 27, 2023 at 7:48
  • This doesn't solve the issue.
    – e_moro
    Commented May 27, 2023 at 10:31
  • Thanks. The other option would be to avoid putting reset ˋ\\!ˋ too early.
    – MS-SPO
    Commented May 27, 2023 at 10:49
  • 1
    I stop using this package. I have found more bugs using the verse counter. (Specially if you count by fives (5,10,15...)
    – e_moro
    Commented May 28, 2023 at 9:45

1 Answer 1

1

Ask the package maintainer for the enhancement.

If I understand correctly, line numbering can be carried across poem environments with a helper counter and its associated code changes added to each poem beginning and end, but then the modulo function will need to be rewritten.

poetry

MWE

\documentclass{article}
\usepackage{poetry}

%\setcounter{poemlinenumsevery}{5}

\newcount\oldpoemlineno%
\newcounter{oldpoemline}%



\begin{document}

\textbf{First}

\begin{poem}
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\!

Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\?
\setcounter{oldpoemline}{\the\poemlineno}%
\end{poem}

\textbf{Second}

\begin{poem}*%
\setcounter{poemline}{\theoldpoemline}%
\poemlineno=\thepoemline%
\ifnum\poemlineno=1\poemlineno=\thepoemline\*\fi%
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\!

Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\?
\setcounter{oldpoemline}{\the\poemlineno}%
\end{poem}


\textbf{Third}

\begin{poem}*%
\setcounter{poemline}{\theoldpoemline}%
\poemlineno=\thepoemline%
\ifnum\poemlineno=1\poemlineno=\thepoemline\*\fi%
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\!

Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\
Lorem ipsum dolor sit amet, consectetur adipiscing elit\\?
\setcounter{oldpoemline}{\the\poemlineno}%
\end{poem}

\end{document}
2
  • Thanks for the answer. But it doesn't work with \setcounter{poemlinenumsevery}{5}. I definitely stop using this package. I come back to 'verse'.
    – e_moro
    Commented May 28, 2023 at 9:46
  • To use poemlinenumsevery with overall lines means completely re-writing the modulo function. It is not complicated, but a large coding change; and any hack will last only to the next version. Ask the package maintainer to make it part of the package.
    – Cicada
    Commented May 28, 2023 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .