1
\documentclass{article}
\usepackage{lmodern}
\usepackage{parallel}
\textwidth=6in
\begin{document}
\begin{center}
    He Rescued Me\\
\end{center}    
\begin{Parallel}[c]{}{}
\ParallelLText{
\noindent
Grey coat gold eyes\\

\noindent
Maybe I'm craze\\

\noindent\\
Muki bear where are you?\\

        \ParallelRText{
        \noindent
We’ve been through\\

\noindent\\
I held him close\\
    }
\end{Parallel}
\end{document}

I want to typeset song lyrics in two columns on one page with the title centered above the text and the columns balanced on the page. With the current code the text is not balanced on the page, it's skewed to the left. The title is not centered above the text but on the page, and since the lyrics aren't centered on the page there is a misalignment. I'm using the parallel package but apparently there are various other possibilities that can achieve the result I want. Is there a better option? output

Rolomoto
  • 111

3 Answers3

1

This solution uses varwidth to determine the width needed, then combines a minipage and multicols to place the text close to the center.

\documentclass{article}
\usepackage[width=6in, left=1.25in,showframe]{geometry}
\usepackage{lmodern}
\usepackage{environ}
\usepackage{varwidth}
\usepackage{multicol}

\setlength{\parindent}{0pt}

\NewEnviron{balanced}{\sbox0{\begin{varwidth}{\dimexpr 0.5\textwidth-0.5\columnsep} \let\columnbreak=\relax \BODY \end{varwidth}}% measure width of column \par\noindent\hfil \begin{minipage}{\dimexpr 2\wd0 + \columnsep} \begin{multicols}{2} \BODY \end{multicols} \end{minipage}\par}

\begin{document} \begin{center} He Rescued Me \end{center}

\begin{balanced} Grey coat gold eyes

Maybe I'm craze

Muki bear where are you?

We’ve been through

I held him close \end{balanced} \end{document}


Just for fun, this version uses \raggedleft in the left column and \raggedright in the right column.

\documentclass{article}
\usepackage[width=6in, left=1.25in,showframe]{geometry}
\usepackage{lmodern}
\usepackage{paracol}

\begin{document} \begin{center} He Rescued Me \end{center}

\begin{paracol}{2} \raggedleft Grey coat gold eyes

Maybe I'm craze

Muki bear where are you?

\switchcolumn\raggedright We’ve been through

I held him close \end{paracol} \end{document}

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
  • When I use the first version the text goes down only so far in the first column and then starts filling in the second column, in other words I have no apparent control over when the second column begins. In the second version there is no vertical space between the verses. I tried \vspace but it didn't do anything. Is there any way to remedy this? – Rolomoto Jul 30 '21 at 01:50
  • With multicols you can use \columnbreak to force a column break. – John Kormylo Jul 30 '21 at 01:59
  • My tests show that all the vertical space functions work fine., such as \\[\baselineskip] and \parskip=\baselineskip. Now if you replace the blank line with \vspace{\baselineskip} then it merges the two lines into one paragraph and delays adding the space to the end. – John Kormylo Jul 30 '21 at 02:08
  • Thanks that cleared things up for the second version. But for the first version the problem isn't inserting a \columnbreak rather that a column break is occurring after about 18 lines when in fact I don't want it to occur. – Rolomoto Jul 30 '21 at 04:38
  • \columnbreak will work anywhere on the page, just put it between paragraphs (not in them). Multicol puts the entire page into one column, then splits it up when the page is done. – John Kormylo Jul 30 '21 at 13:31
  • Thanks John, that cleared things up. One final thing I am wondering about is an error: \columnbreak outside multicols. It doesn't affect the output, is this a non-issue? – Rolomoto Jul 31 '21 at 03:26
  • I fixed that in a later edit (inside varwidth). – John Kormylo Jul 31 '21 at 13:51
0

An alternative method to achieve the same goal is to use the blindtext and multicol packages instead. For instance, as an example, the following code:

\documentclass{article}
\usepackage{blindtext}
\usepackage{multicol}
\setlength{\columnsep}{1cm} %set the gap between the columns
\title{Test}
\author{}
\date{}

\begin{document} \maketitle

\begin{multicols}{2} %begin 2 columns The song lyrics and so on... %1st column

\vfill\null \columnbreak %move on to the 2nd column

The song lyrics keep on going... %the 2nd column

\end{multicols}

\end{document}

Will give us:

And as you can see, the text is quite centred. Hope that helps!

CWM12
  • 65
0

A couple things here: First off, parallel is probably not the right tool for the job. I would look at the multicol package which provides a multicols environment.¹ That will make the column balancing/division somewhat less painful.

But the other problem is that, as you've noticed, there is a visual imbalance. This is because with lines of verse² the lines will tend to be shorter and create an illusion that everything is unbalanced. Also, I recommend using the verse environment which allows you to write things like:

   \begin{verse}
   ...
   he's warm\\
   he rescued me

Maybe I'm craze\ ... \end{verse}

but this will still shift things to the left. A simple solution would be to manually adjust the left margin of the verse environment until it looks better. We don't want to just increase \leftmargin since that will also cause the right margin to be increased and might cause unwanted line breaks.³ Unfortunately, the way that verse is implemented, it doesn't really provide a good way to override that⁴ so we'll have to redefine list ourselves. Fortunately, it's not too bad. Here's the current definition:

\newenvironment{verse}
    {%
       \let\\\@centercr
       \list{}{\itemsep \z@
         \itemindent   -1.5em%
         \listparindent\itemindent
         \rightmargin  \leftmargin
         \advance\leftmargin 1.5em}%
       \item\relax}
    {\endlist}

We can modify it with this:

\makeatletter
\RenewDocumentEnvironment{verse}{ O{1.5em} }
    {%
       \let\\\@centercr
       \list{}{\itemsep \z@
         \itemindent   -1.5em%
         \listparindent\itemindent
         \rightmargin  \leftmargin
         \advance\leftmargin #1}%
       \item\relax}
    {\endlist}
\makeatother

This changes the verse environment to have an optional argument which is the amount of extra indent to apply to each line. The default is 1.5em (which is what you get with the normal definition of verse). Boosting this to some larger value, say 5em (you'll have to see what looks best to your eye), will give you something that looks more centered.


  1. This mismatch between package name and environment name has caused no end of pain over the last 30ish years since Frank first created the package. Of course back then, DOS and VM/CMS both restricted file names to just 8 characters.
  2. Doing the whole manual line breaking and \noindent etc. like you're doing here really hurts my brain.
  3. At first glance, this might seem ok, because once you have the left and right margins equal and at their largest possible value, the longes line will be centered, but in reality, you really want things to be a bit off-center to the right because the psychological center line does not correspond to the mathematical center line.
  4. The internal mechanism sets things like the linewidth and indentation in a way that the LaTeX hook mechanism can't impact it. We kind of need a \AddToHook{env/verse/list} which doesn't exist (yet).
Don Hosek
  • 14,078
  • Can you tell me where to place those two blocks of code? I tried this: `\documentclass[12pt]{article} \usepackage{multicol} \begin{document} \makeatletter \RenewDocumentEnvironment{verse}{ O{1.5em} } {% \let\@centercr \list{}{\itemsep \z@ \itemindent -1.5em% \listparindent\itemindent \rightmargin \leftmargin \advance\leftmargin #1}% \item\relax} {\endlist} \makeatother \begin{multicols}[2]

    \end{multicols}`

    – Rolomoto Jul 30 '21 at 04:57