14

I am typesetting a simple songbook and would like some songs to be displayed in two columns (I use the multicol package). However, I would like to prevent inserting a columnbreak within a stanza. It would be great to have something like a samecol environment.

I tried to apply hints from Prevent column break in multicolumn index, but it didn't yield the expected result.

I'd be grateful for any advice.

mac-p
  • 341

3 Answers3

10

I found the answer accidentally, while looking for something else. In order to prevent column break within a stanza I mark line ends with \\* instead of \\. Example:

\begin{multicols}{2}
  \begin{verse}       
     I heard, I heard, the old man say,\\*
     John Kanaka-naka tu-lai-ay!\\*
     Today, today is a holiday,\\*
     John Kanaka-naka tu-lai-ay!

     Tu-lai-ay, Oh! Tu-lai-ay!\\*
     John Kanaka-naka tu-lai-ay!
  \end{verse} 
 \end{multicols}

I realize this does not solve the general problem of column break prevention, but perfectly fits my needs.

mac-p
  • 341
6

I suggest you take a look at the needspace package and its macro \Needspace{}. This macro should be invoked with the number of lines that need to be kept together, expressed in multiples of \baselineskip. Thus, \Needspace{5\baselineskip} will keep the next five lines together by forcing a column break, if necessary, before the start of the stanza. Note that it should only be used between paragraphs (stanzas).

Mico
  • 506,678
  • Thank you for the answer. However, it doesn't work. Maybe due to the fact that inside multicol environment I put theverse environment. – mac-p Jul 23 '12 at 19:08
  • 1
    @mac-p - thanks for this feedback. Please consider editing your question to include a more specific description; providing a full MWE (minimum working example) that reproduces the problem in question would be especially helpful. Hopefully, having this additional information will help me and/or others figure out a solution. – Mico Jul 23 '12 at 19:21
1

I have found a solution that works for me, although the factor that \linewidth needs to be multiplied by may need to be adjusted in different situations:

Put

\newenvironment{stanza}
   {\begin{minipage}{1.1\linewidth} \begin{verse}}
   {\end{verse} \end{minipage}}

in the preamble, and use the stanza environment for the stanzas that are troublesome.

ahorn
  • 673