2

I’m trying to typeset a parallel translation of a mathematical text, with the original text and translation facing each other in two columns.

For the most part, the paracol package provides this excellently (and it looks like reledmac/reledpar would also work well) — it provides several very nice features like smooth synchronisation of theorem numbering, and so on.

But I would also like, if possible, to have displayed equations (and similar environments) shared between the two versions, i.e. not duplicated in each column, but appearing once, and full text width. This doesn’t seem to be provided for by either paracol or reledpar. The simple kludge is to end the 2-column environment, give the displayed equation, and restart the 2-columns afterwards. This isn’t great, but it’s good enough to be getting on with, especially with some by-hand adjustment to the spacing.

What I really can’t find any decent way to do is displayed equations, shared between the columns, within theorems or similar environments — the kludge above doesn’t work, because to temporarily end the two-column environment, one has to end the theorem environment. The desired outcome is that each column would look like an ordinary theorem-containing-a-displayed-equation, except with the equation shared, and extra vertical space as necessary if the text preceding the equation is longer in one column than the other.

A principled solution would be great, if anyone knows of one, but I would be happy just to find a reasonable kludge that works for the within-theorem case as well as for the simple case.

My MWE uses paracol, but I would be very happy also for solutions using reledpar, or any other package that provides a comparable setup for parallel texts.

MWE output:

screenshot of output of MWE

MWE source:

\documentclass{article}

\usepackage{paracol}

\usepackage{amsthm}
\newtheorem{sats}{Sats}
\newtheorem{theorem}[sats]{Theorem}

\begin{document}

\begin{paracol}{2}
Här skriver jag på svenska, bara ett par linjer för at skapa ett kort paragraf.
\switchcolumn
Here I write in English, just a couple of lines to make a short paragraph.
\switchcolumn*
\begin{sats}
Tyvärr vet jag inga matematiska satser att skriva här.
\end{sats}
\switchcolumn
\begin{theorem}
Unfortunately I know no mathematical theorems to write here.
\end{theorem}
\switchcolumn*
Här är en ekvation: för alla rella tal $a$ och $b$,
\switchcolumn
Here is an equation: for all real numbers $a$ and $b$,
\end{paracol}
\[a + b = b + a; \]
\begin{paracol}{2}
\noindent men troligtvis är det för enkel för att kallas för en sats.  Men det har en mer interessant generalisering:
\switchcolumn
\noindent but it’s probably too simple to be called a theorem.  But it has a more interesting generalisation:
\switchcolumn*
\begin{sats}
För alla rella tal $a$, $b$, $c$, och $d$,
\end{sats}
\switchcolumn
\begin{theorem}
For all real numbers $a$, $b$, $c$, och $d$,
\end{theorem}
\end{paracol}
\[a + b + c + d = c + d + a + b; \]
\begin{paracol}{2}
\noindent som är ganska användbar (och det här ska vara en forstättning av satsen).  
\switchcolumn
\noindent which is quite useful (and this should be a continuation of the theorem).
\end{paracol}
\end{document}
  • That is also how you would do it with multicol. The other trick is to overlay one column on top of another, which is relatively easy with paracol. – John Kormylo Mar 16 at 13:28
3

This shows how to do the overlay trick.

\documentclass{article}

\usepackage{paracol}

\usepackage{amsthm}
\newtheorem{sats}{Sats}
\newtheorem{theorem}[sats]{Theorem}

\newcommand{\singlecol}[2][0]% #1 = column (0=left) to wind up in (optional), #2 = text to appear as if in a signel column
  {\switchcolumn[0]*
  \noindent\rlap{\parbox{\textwidth}{#2}}
  \switchcolumn[#1]*}

\begin{document}

\begin{paracol}{2}
Här skriver jag på svenska, bara ett par linjer för at skapa ett kort paragraf.
\switchcolumn
Here I write in English, just a couple of lines to make a short paragraph.
\switchcolumn*
\begin{sats}
Tyvärr vet jag inga matematiska satser att skriva här.
\end{sats}
\switchcolumn
\begin{theorem}
Unfortunately I know no mathematical theorems to write here.
\end{theorem}
\switchcolumn*
Här är en ekvation: för alla rella tal $a$ och $b$,
\switchcolumn
Here is an equation: for all real numbers $a$ and $b$,
\singlecol{\[a + b = b + a; \]}
\noindent men troligtvis är det för enkel för att kallas för en sats.  Men det har en mer interessant generalisering:
\switchcolumn
\noindent but it’s probably too simple to be called a theorem.  But it has a more interesting generalisation:
\switchcolumn*
\begin{sats}
För alla rella tal $a$, $b$, $c$, och $d$,
\end{sats}
\switchcolumn
\begin{theorem}
For all real numbers $a$, $b$, $c$, och $d$,
\end{theorem}
\singlecol{\[a + b + c + d = c + d + a + b; \]}
\noindent som är ganska användbar (och det här ska vara en forstättning av satsen).  
\switchcolumn
\noindent which is quite useful (and this should be a continuation of the theorem).
\end{paracol}
\end{document}

It turns out that if you start an environment in one column, it will affect both columns until ended. OTOH, theorem environments can be nested, and each column uses independent counters.

Note: you can only switch columns between paragraphs.

\documentclass{article}

\usepackage{paracol}

\usepackage{amsthm}
\newtheorem{sats}{Sats}
\newtheorem{theorem}[sats]{Theorem}

\newcommand{\singlecol}[2][0]% #1 = column (0=left) to wind up in (optional), #2 = text to appear as if in a signel column
  {\switchcolumn[0]*
  \noindent\rlap{\parbox[b]{\textwidth}{#2}}
  \switchcolumn[#1]*}

\begin{document}

\begin{paracol}{2}
Här skriver jag på svenska, bara ett par linjer för at skapa ett kort paragraf.
\switchcolumn
Here I write in English, just a couple of lines to make a short paragraph.
\switchcolumn*
\begin{sats}
Tyvärr vet jag inga matematiska satser att skriva här.
\switchcolumn
\begin{theorem}
Unfortunately I know no mathematical theorems to write here.
\switchcolumn*
Här är en ekvation: för alla rella tal $a$ och $b$,
\switchcolumn
Here is an equation: for all real numbers $a$ and $b$,
\singlecol{\[a + b = b + a; \]}
\noindent men troligtvis är det för enkel för att kallas för en sats.  Men det har en mer interessant generalisering:
\switchcolumn
\noindent but it’s probably too simple to be called a theorem.  But it has a more interesting generalisation:
\end{theorem}\end{sats}% note order of nesting
\switchcolumn*
\begin{sats}
För alla rella tal $a$, $b$, $c$, och $d$,
\switchcolumn
\begin{theorem}
For all real numbers $a$, $b$, $c$, och $d$,
\singlecol{\[a + b + c + d = c + d + a + b; \]}
\noindent som är ganska användbar (och det här ska vara en forstättning av satsen).  
\switchcolumn
\noindent which is quite useful (and this should be a continuation of the theorem).
\end{theorem}\end{sats}% note order of nesting
\end{paracol}
\end{document}
  • 1
    Thankyou — this is a good slight improvement on my current solution. I don’t quite see how to use this within a theorem, though, which is the main thing I was hoping for? I.e. how to use it so that the last line of the MWE following the displaced equation is part of Theorem 2, or at least gets typeset to look like it is? – Peter LeFanu Lumsdaine Mar 16 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.