8

I'm doing a poem analysis of some English poem translated to Swedish. I want include the poem in both the languages, like this:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{verse}

\begin{document}

\settowidth{\versewidth}{Mitt hjärta, stilla dina slag,}
\begin{verse}[\versewidth]
  Mitt hjärta, stilla dina slag, \\
  sen andra hjärtan slutits till! \\
  Men - kan jag ej bli älskad, jag \\
  \vin dock älska vill.
\end{verse}

\begin{verse}[\versewidth]
  'T is time this heart should be unmoved, \\
  \vin Since others it hath ceased to move: \\
  Yet, though I cannot be beloved, \\
  \vin \vin Still let me love!
\end{verse}

From this part we can see that bla bla bla \dots

\end{document}

This code results in:

enter image description here

But I'd also like to typeset these two versions side by side, in two separate columns. How may I do this?

David Carlisle
  • 757,742
Eric
  • 325

2 Answers2

6

There are a number of options to do what you want. One possibility would be to use minipages; the width for each minipage will be given by the corresponding \versewidth (+1pt, since \versewidth alone doesn't work).

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{verse}

\begin{document}

\settowidth{\versewidth}{Men - kan jag ej bli älskad, jag}
\begin{minipage}[t]{\dimexpr\versewidth+1pt\relax}
\begin{verse}[\versewidth]
  Mitt hjärta, stilla dina slag, \\
  sen andra hjärtan slutits till! \\
  Men - kan jag ej bli älskad, jag \\
  \vin dock älska vill.
\end{verse}
\end{minipage}\hfill
\settowidth{\versewidth}{'T is time this heart should be unmoved,}%
\begin{minipage}[t]{\dimexpr\versewidth+1pt\relax}
\begin{verse}[\versewidth]
  'T is time this heart should be unmoved, \\
  \vin Since others it hath ceased to move: \\
  Yet, though I cannot be beloved, \\
  \vin\vin Still let me love!
\end{verse}
\end{minipage}\bigskip

From this part we can see that bla bla bla \dots

\end{document}

enter image description here

Moriambar
  • 11,466
Gonzalo Medina
  • 505,128
3
\begin{center}
\settowidth{\versewidth}{Men - kan jag ej bli älskad, jag}
\begin{minipage}[t]{\dimexpr\versewidth+1sp\relax}
\begin{verse}[\versewidth]
  Mitt hjärta, stilla dina slag, \\
  sen andra hjärtan slutits till! \\
  Men - kan jag ej bli älskad, jag \\
  \vin dock älska vill.
\end{verse}
\end{minipage}\hfill
\settowidth{\versewidth}{'T is time this heart should be unmoved,}
\begin{minipage}[t]{\dimexpr\versewidth+1sp\relax}
\begin{verse}[\versewidth]
  'T is time this heart should be unmoved, \\
  \vin Since others it hath ceased to move: \\
  Yet, though I cannot be beloved, \\
  \vin \vin Still let me love!
\end{verse}
\end{minipage}
\end{center}

Strangely enough, \begin{minipage}[t]{\versewidth} is not sufficient.

It's best to set \versewidth to the maximum verse length.

David Carlisle
  • 757,742
egreg
  • 1,121,712
  • would adding a space at the end of the argument to \settowidth make it possible to use just the \versewidth? all the lines of the verse in the input do end with spaces, which i don't think are automatically ignored at the ends of lines. (or, alternatively, just putting \\ tight up against the last word in each line.) – barbara beeton Sep 29 '11 at 17:47
  • @barbarabeeton Adding a space will do, but the weird thing is that 1sp suffices! Probably a rounding problem similar to \hbox to 2in{\hskip1in \hskip1in} – egreg Sep 29 '11 at 17:50
  • maybe a rounding problem indeed; do you know if the \hbox ... example has been documented as a known bug? if not (and i don't have time now to research it), then if you can put together a cogent and compact report, i'll be glad to put it in the queue for dek. – barbara beeton Sep 29 '11 at 18:57
  • @barbarabeeton I don't think it qualifies as a bug: it's just an effect of truncation in binary arithmetic; I believe to have seen it documented by David Kastrup. Perhaps in TUGboat, but I don't remember. – egreg Sep 29 '11 at 19:23