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?

2 Answers 2

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

8
  • What does the t option to the minipage environment do?
    – Eric
    Sep 29, 2011 at 16:41
  • @Eric: it aligns both minipages vertically to their tops. Sep 29, 2011 at 16:41
  • Would the solution still work without the \noindent? Because it looks better without it.
    – Eric
    Sep 29, 2011 at 16:47
  • @Eric: without the \noindent command, an overfull box will appear, since a new paragraph is starting and \parindent will be used. Sep 29, 2011 at 16:49
  • You're misusing the optional argument to verse; moreover there's no need to guess the size of the minipages.
    – egreg
    Sep 29, 2011 at 16:58
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.

4
  • 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.) Sep 29, 2011 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, 2011 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. Sep 29, 2011 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, 2011 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .