GeneralHow to keep \poemtitle on same page as \verse

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
batonac
Posts: 12
Joined: Fri Feb 26, 2010 5:41 pm

How to keep \poemtitle on same page as \verse

Post by batonac »

I am trying to compile a large book of poems. I'm using the verse package to format the poetry.

Because of the helpful responses in this form: http://www.latex-community.org/forum/vi ... .php?t=872 I am now able to keep the lines of my poetry together on the same page. (by using \\*)

My problem lies in the fact that I can't figure out how to keep the Poem's title on the same page as the rest of the poem. This is a big problem in my document, as the compiler groups the bodies of large poems together but leaves the title behind on the previous page.

Here's a sample of my coding:

Code: Select all

\poemtitle{Metamorphosis}
\begin{verse}
Living life with no concrete direction,\\*
following my mind with no constant decision,\\*
drug after drug, living in prison,\\*
this was how my flesh was existing.\\*
I check myself and then I deny,\\*
my selfish pleasures and then I die,\\*
to rise up and then I,\\*
live a new stage of life.
\end{verse}
I hope you understand, I don't want a new page after EVERY poem, I just don't want any poem to be fragmented across two pages, and I want the title to be grouped with the poem.

I'll appreciate any help/direction. Thanks!

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to keep \poemtitle on same page as \verse

Post by gmedina »

Hi,

please provide complete, minimal and compilable code; \poemtitle is a command implemented by some package or class that I don't know and I don't have time to perform a search for that package or class.

Edit: nevermind. One possible solution would be to enclose both the \poemtitle command and the verse environment inside a minipage; the following example illustrates this approach through a new environment that I called mypoem:

Code: Select all

\documentclass{memoir}

\newenvironment{mypoem}[1]
  {\noindent\begin{minipage}{\textwidth}%
    \poemtitle{#1}%
    \begin{verse}}
  {\end{verse}\end{minipage}}

\begin{document}

\poemtitle{Metamorphosis}
\begin{verse}
Living life with no concrete direction,\\*
following my mind with no constant decision,\\*
drug after drug, living in prison,\\*
this was how my flesh was existing.\\*
I check myself and then I deny,\\*
my selfish pleasures and then I die,\\*
to rise up and then I,\\*
live a new stage of life.
\end{verse}

\begin{mypoem}{Metamorphosis}
Living life with no concrete direction,\\*
following my mind with no constant decision,\\*
drug after drug, living in prison,\\*
this was how my flesh was existing.\\*
I check myself and then I deny,\\*
my selfish pleasures and then I die,\\*
to rise up and then I,\\*
live a new stage of life.
\end{mypoem}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
batonac
Posts: 12
Joined: Fri Feb 26, 2010 5:41 pm

Re: How to keep \poemtitle on same page as \verse

Post by batonac »

Hey Thanks ALOT! This suggestion worked pretty good, but I still had problems with keeping all of the content grouped together as I wanted it, so I finally found a solution in the poemscol package, which seems to have been designed exactly for my use case!

Again, thanks for your time, I hope this code will be useful for others. :D
Post Reply