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

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}

enter image description here

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}

enter image description here


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.

enter image description here

\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}

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}

output

Tags:

Two Column