2

I'm using the custom Verse environment provided in this answer for producing horizontally centered verses.

I would like to add a verse number to the last line of a verse and I would like just the number to be flushed right (like equation numbering works). Here is an example:

enter image description here

I tried using flushright within the last line but it didn't work. Appreciate any pointers.

hashable
  • 531

1 Answers1

1

Absolutely no warranty! but since you asked for pointers, here is this.

\documentclass{article}
\usepackage{varwidth}
\newcounter{verse}
\setcounter{verse}{0}
\newenvironment{Verse}
  {\refstepcounter{verse}
   \equation
   \let\theequation\theverse
   \varwidth[b]{\linewidth}
  }
  {\endvarwidth
   \endequation
   \addtocounter{equation}{-1}
  }
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{Verse}\label{me}
foo bar\\
baz
\end{Verse}
\lipsum[1]
\begin{Verse}
foo bar\\
baz \\
 foo bar\\
baz
\end{Verse}
\end{document}

enter image description here

  • @hashable although this centres each verse separately, unlike the image you showed (with no code) that centred the verses together so with their left edge aligned, do you need that? – David Carlisle Oct 26 '14 at 23:23