4

I need to typeset two parallel columns of text running over several pages, with occasional synchronization. (Synchronization meaning that both columns "restart" from the same vertical position.)

I need to use some math, including display math. Doing this messes up the layout:

enter image description here

Notice the break in the vertical line (circles in red) and notice how the last line of the first paragraph in the second column is misaligned. It shouldn't be preceded by that large vertical space. Finally, the spacing above/below the equation seems wrong.

Question: Is there a simple way to typeset parallel columns with display math and avoid such problems?

I don't need top quality typesetting, as these are just personal notes, but I cannot live with gross misalignment like above.


Update: I noticed in the parcolumns documentation that it is mentioned that it doesn't work well with display math. It is suggested to put the display math in a separate \colchunk. This is not acceptable for my purposes because (1) it forces a synchronization between the two columns, which I cannot have on every formula (2) it is just too much work when the priority is noting down things rather than producing book-quality typesetting.

If there is no simple way to do parallel columns with math, then I'll just give up on parallel columns. However, that would be a pity because in some cases I found this layout very useful in handwritten notes, and I was hoping not to have to give it up with digital ones.


Example code:

\documentclass[10pt]{article}
\usepackage{parcolumns}
\usepackage{amsmath}
\usepackage{microtype}

\begin{document}
\begin{parcolumns}[rulebetween]{2}

\colchunk[1]{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.
\[ x^2 + y^2 = r^2 \]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.
}

\colchunk[2]{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.

}

\colplacechunks

\end{parcolumns}

\end{document}
3

You could try paracol.sty, the documentation does not mention any limitations with math, example:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{paracol,xcolor,geometry}
\usepackage{microtype}

\setlength{\columnseprule}{0.4pt}
\colseprulecolor{blue}

\begin{document}

\begin{paracol}{2}
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et
  dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim
  est. Etiam vel ipsum dui.  Maecenas vitae accumsan
  nibh. Pellentesque habitant morbi tristique senectus et netus et
  malesuada fames ac turpis egestas.

  \switchcolumn

  Lorem ipsum dolor sit amet, consectetur adipiscing elit.

  \switchcolumn

  Suspendisse quis tincidunt turpis.
  \[ x^2 + y^2 = r^2 \]

  \switchcolumn*

  Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a
  dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan
  nibh. Pellentesque habitant morbi tristique senectus et netus et
  malesuada fames ac turpis egestas. Suspendisse quis tincidunt
  turpis.

  \switchcolumn

  Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{paracol}
\end{document}

enter image description here

1

(This solves 1 of the 2 issues)

Since parcolumns seems not to likedisplay math, here I just isolate the display math inside a temporary \vbox and output the box instead. (Of course, this will lose the ability of a short math expression to get tucked in nicely following a short line. It may also change the vertical skip to the equation in other ways)

\documentclass[10pt]{article}
\usepackage{parcolumns}
\usepackage{amsmath}
\usepackage{microtype}

\begin{document}
\begin{parcolumns}[rulebetween]{2}

\colchunk[1]{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.
\\\setbox0=\vbox{\[ x^2 + y^2 = r^2 \]}\box0

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.
}
\colchunk[2]{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et dolor nulla. Nam tempor consequat dui vel ornare. Ut a dignissim est. Etiam vel ipsum dui. Maecenas vitae accumsan nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse quis tincidunt turpis.
}

\colplacechunks

\end{parcolumns}

\end{document}

enter image description here

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.