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.

1 Answer 1

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

1
  • @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? Oct 26, 2014 at 23:23

You must log in to answer this question.

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