# Two-column layout with left column just as wide as its content

Here is image of desired layout, from PDF-ed MS Word version of the documment:

It's A5 format. What I exactly want is:

• have it in two columns, each of them left-aligned
• lyrics should take as much space as they need; so, simple \begin{multicols}{2} is not enough

How can I achieve such layout using LaTeX?

-
how about \begin{tabular}{p{.5\texwidth}l}...\end{tabular}? –  cmhughes Jun 9 '12 at 19:54
@cmhughes, I tried that and played with it for a while, but doesn't seem to adjust width of left column, but maybe I should clarify what I really want: chords shouldn't be far away from lyrics, it's a bit easier to read them when they are closer. But, of course, lyrics can have variable width, so chords column's margin from left edge of page should be variable as well, allowing entire lines of lyrics fit in that "margin". –  Griwes Jun 9 '12 at 20:35
There are packages on CTAN for typesetting chords: guitar and gtrcrd. It's true that the chords are typeset above the verses, but maybe it is possible to obtain what you want by fiddling around with those for a while... –  Count Zero Jun 9 '12 at 20:48
There's a very versatile package for typesetting this (but with a different format): songs. –  Gonzalo Medina Jun 9 '12 at 21:00

All you need is a very basic tabular without anything special. Its default behavior is to make the columns as wide as they need to be. This won't work with lines that are too long and should be broken into the next line, however. For more information on tabular, see section 2.11.6 of The Not So Short Introduction to LaTeX2ε or section 9.23 of the unofficial LaTeX reference manual.

\documentclass{article}

\usepackage[a5paper]{geometry}

% Just to get the umlauts right:
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}

\begin{document}
\section*{An die Freude (Schiller)}

\begin{tabular}{ll}
Freude, schöner Götterfunken, & right column \\
Tochter aus Elisium, & right column \\
Wir betreten feuertrunken & right column \\
Himmlische, dein Heiligthum. & right column \\
Deine Zauber binden wieder, & right column \\
was der Mode Schwerd getheilt; & right column \\
Bettler werden Fürstenbrüder, & right column \\
wo dein sanfter Flügel weilt. & right column \\
\end{tabular}

\end{document}


-
Fine, but is there a way to increase the space between left and right column a bit? Like by one more "tab" in Word? –  Griwes Jun 10 '12 at 9:29
@Griwes: Start the tabular like this: \begin{tabular}{l@{\hspace{1cm}}l}. The @{...} redefines what's added between the two columns. I just added a bit of space, change the 1cm to however much space you desire. –  doncherry Jun 10 '12 at 9:34
Perfect, works exactly as desired; tables in LaTeX are definitely not intuitive for newcomers... –  Griwes Jun 10 '12 at 13:02

The songs package is a very versatile package that allows a user to create beautiful songbooks using the LaTeX. An example (taken from the package documentation):

\documentclass{article}
\usepackage[chorded]{songs}

\newindex{titleidx}{titleidx}
\noversenumbers

\begin{document}
\showindex{Complete Index of Songs}{titleidx}
\songsection{Worship Songs}

\begin{songs}{titleidx}
\beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken},
sr={Revelation 5:13},
cr={Public domain.},
index={Praise God, from Whom all blessings flow}]
\beginverse
\[G]Praise God, \[D]from \[Em]Whom \[Bm]all \[Em]bless\[D]ings \[G]flow;
\[G]Praise Him, all \[D]crea\[Em]tures \[C]here \[G]be\[D]low;
\[Em]Praise \[D]Him \[G]a\[D]bove, \[G]ye \[C]heav'n\[D]ly \[Em]host;
\[G]Praise Fa\[Em]ther, \[D]Son, \[Am]and \[G/B G/C]Ho\[D]ly \[G]Ghost.
\[C]A\[G]men.
\endverse
\endsong
\end{songs}

\end{document}


And using the \nolyrics command you can rewrite the above example in the following way:

\documentclass{article}
\usepackage{songs}

\songcolumns{0}
\noversenumbers

\begin{document}

\begin{songs}{}
\beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken},
sr={Revelation 5:13},
cr={Public domain.},
index={Praise God, from Whom all blessings flow}]
\beginverse
Praise God, from Whom all blessings flow;\hfill{\nolyrics \[G] \[D] \[Em] \[Bm] \[Em] \[D] \[G]}
Praise Him, all creatures here below;\hfill{\nolyrics \[G] \[D] \[Em] \[C] \[G] \[D]}
Praise Him above, ye heav'nly host;\hfill{\nolyrics \[Em] \[D] \[G] \[D] \[G] \[C] \[D] \[Em]}
Praise Father, Son, and Holy Ghost.\hfill{\nolyrics \[G] \[Em] \[D] \[Am] \[G/B G/C] \[D] \[G]}
Amen.\hfill{\nolyrics \[C] \[G]}
\endverse
\endsong
\end{songs}

\end{document}


-

Here's a table-based solution. X is a column type that automatically fills the space up to the predefined width of the table, whereas l adjusts only up to the width of its content.

Alternatively, you could define the columns as X[3,l]X[1,l], which would give you a first column three times as wide as the second one. Instead of using a monospaced font for chord alignment, you might also consider using one column per chord (if the maximum number of chords is known in advance). In this case, you could also use \textsuperscript{7} for the seventh chords.

\documentclass{article}
\usepackage{booktabs}
\usepackage{tabu}
\usepackage{parskip}    %no paragraph indentation
\renewcommand{\arraystretch}{1.5}   %increase interrow spacing

\begin{document}

\section{Song name}
Capo on fret II
\bigskip

\begin{tabu} to \textwidth {X[l]l}
\toprule
First line of lyrics    & \texttt{a~~E}\\   %protected spaces
Second line of lyrics   & \texttt{E7 a}\\[.5em] %additional space
Third line of lyrics    & \texttt{A7}\\
Fourth line of lyrics   & \texttt{d}\\
\bottomrule
\end{tabu}
\end{document}

-