Generalproblem with lining up text in columns

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
a s
Posts: 3
Joined: Mon Jul 16, 2007 8:27 pm

problem with lining up text in columns

Post by a s »

Hi, I am having problems setting up a LaTeX document which is single-column by default but in which I sometimes switch into a two-column format, and where I want to have the text in the left column line up very well with the text in the right column (certain algebraic theorems are in the left column and equivalent theorems in a more geometric language are in the right column, and I want them side by side to invite the reader to compare them). The best I have been able to do is using multicol, which has the following drawback: suppose I write the following:

Code: Select all

\begin{multicols}{2}
Thm. 1A           
statement of 1A   
proof of 1A       
more 1A proof     
Thm. 1B
statement of 1B
proof of 1B
more 1B proof
\end{multicols}
This does what I want, unless it hits a page break before it's finished. Suppose LaTeX reaches a page break after the first two lines. Then multicol produces the output:

Code: Select all

Thm. 1A           proof of 1A
statement of 1A   more 1A proof
          (page break)
Thm. 1B           proof of 1B
statement of 1B   more 1B proof
...when really I want this:

Code: Select all

Thm. 1A           Thm. 1B
statement of 1A   statement of 1B
          (page break)
proof of 1A       proof of 1B
more 1A proof     more 1B proof
Does anyone know how to tell multicol how to handle this correctly? Or some other way to produce the desired output?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

a s
Posts: 3
Joined: Mon Jul 16, 2007 8:27 pm

Re: problem with lining up text in columns

Post by a s »

Let me add that I have also tried the parallel package for this purpose, and it works very well except for the poor behavior of some things which appear inside the parallel text, for instance, \begin{enumerate} produces an enumerated list which spans both columns, when I want to have a separate enumerated list in each column. If anyone can tell me of a way to stop enumerate and other things from spanning both columns, that would be another solution to this typesetting problem.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

problem with lining up text in columns

Post by gmedina »

You could try using the parcolumns package. In your case, you could use something like this:

Code: Select all

...
\usepackage{parcolumns}
...
\begin{parcolumns}{2}
  \colchunk{Thm. 1A           
  statement of 1A   
  proof of 1A       
  more 1A proof}

  \colchunk{Thm. 1B
  statement of 1B
  proof of 1B
  more 1B proof}

  \colplacechunks
\end{parcolumns}
Edit: maybe something like this will produce better line up:

Code: Select all

...
\usepackage{parcolumns}
...
\begin{parcolumns}{2}

  \colchunk{Thm. 1A           
  statement of 1A}

  \colchunk{Thm. 1B
  statement of 1B}

  \colplacechunks   

  \colchunk{proof of 1A}       

  \colchunk{proof of 1B}

  \colplacechunks   

  \colchunk{more 1A proof}       

  \colchunk{more 1B proof}       

  \colplacechunks
\end{parcolumns}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
a s
Posts: 3
Joined: Mon Jul 16, 2007 8:27 pm

Re: problem with lining up text in columns

Post by a s »

The parcolumns package seems to work perfectly for what I want, thank you for the suggestion!
Post Reply