# How to create trapezoidal multicols?

I would like to create a XeLaTeX layout where multicol's columns (two in this case, no figures, text only) are tilted where they meet. The lines still should be ordinary lines below each other, but the start/end points of each line should glide a bit each line for it to look something like this:

xxxxxxxxxx  xxxx
xxxxxxxxxx  xxxx
xxxxxxxxx  xxxxx
xxxxxxxxx  xxxxx
SECTION   xxxxxx
xxxxxxxx  xxxxxx
xxxxxxx  xxxxxxx
xxxxxxx  xxxxxxx
xxxxxx  xxxxxxxx
xxxxxx  xxxxxxxx
xxxxx  xxxxxxxxx
xxxxx  xxxxxxxxx
xxxx  SUBSECTION
xxxx  xxxxxxxxxx


So not the whole column is tilted, but one gets narrower while the other one gets wider.

I've seen examples using \parshape, but those I found are based that one counts lines and more or less manually defines the shape. I also would need that LaTeX keeps the multicol functionality (page breaks, text flow, ...) and does this automatically on each page for a longer chapter.

How do I create such a layout? If multicol is not easy to mix with this layout, what would be an alternative?

-
This is an interesting question, and I hope to learn a lot from the answers to it. But… why on earth would you want to do this? –  Seamus Jun 22 '12 at 14:35
Actually there is a whole book set using this kind of style, and I was wondering about the effort to mimic this with LaTeX: rpggeek.com/image/915457/… –  TeXter Jun 22 '12 at 15:15

This has so many restrictions I don't know where to begin. The main one that you need to separate paragraphs by \endgraf not \par. (and would need to locally redefine section heads not to use \par either.)

\documentclass{article}
\usepackage{shapepar}
\iffalse
xxxxxxxxxx  xxxx
xxxxxxxxxx  xxxx
xxxxxxxxx  xxxxx
xxxxxxxxx  xxxxx
SECTION   xxxxxx
xxxxxxxx  xxxxxx
xxxxxxx  xxxxxxx
xxxxxxx  xxxxxxx
xxxxxx  xxxxxxxx
xxxxxx  xxxxxxxx
xxxxx  xxxxxxxxx
xxxxx  xxxxxxxxx
xxxx  SUBSECTION
xxxx  xxxxxxxxxx
\fi
\count0=0
\def\a{\advance\count0 1 \the\count0. One two three four. }
\def\b{\a\a\a\endgraf\a\a\a Red blue green yellow. }
\def\c{\b\b}
\def\z{\c\c}

\begin{document}
\makeatletter
\let\@@SH@restack\SH@restack
\def\SH@restack{\def\nobreak{\penalty\z@}\@@SH@restack}
\setbox8\hbox{\Shapepar
{{6}
{0}b{0}\\
{0}t{0}{12}\\
{1}t{0}{12}\\
{2}t{0}{11}\\
{3}t{0}{11}\\
{4}t{0}{9}\\
{5}t{0}{10}\\
{6}t{0}{9}\\
{7}t{0}{9}\\
{8}t{0}{8}\\
{9}t{0}{6}\\
{10}t{0}{6}\\
{11}t{0}{4}\\
{12}t{0}{4}\\
{12}e{0}\\
{13}b{14}\\
{13}t{14}{4}\\
{14}t{14}{4}\\
{15}t{13}{5}\\
{16}t{13}{5}\\
{17}t{12}{6}\\
{18}t{12}{6}\\
{19}t{11}{7}\\
{20}t{11}{7}\\
{21}t{10}{8}\\
{22}t{8}{10}\\
{23}t{8}{10}\\
{24}t{6}{12}\\
{25}t{6}{12}\\
{25}e{6}}
\z
\par}

{
\setbox0\hbox{\unhbox8 \global\setbox1\lastbox}
\dimen0\ht1
\divide\dimen0 by 2
\splittopskip\baselineskip
\setbox0\vsplit1 to \dimen0
\setbox0=\vbox{\break\unvbox0}
\setbox2=\vsplit0 to 0pt
\box0
\nobreak
\vskip-\dimen0
\box1
}

\end{document}


Note this is an updated answer, in the first version I messed up the shapepar line spec, and got a wobbly right hand edge.

-
and the baselines do not line up ... so it is more than just having restrictions :-) I guess the correct thing to do is to add \dimen0=\ht0 just before typesetting \box0 –  Frank Mittelbach Sep 21 '13 at 17:16

You name it, we have it;).

ftp://ftp.gust.org.pl/pub/GUST/bulletin/08/07bj.ps.gz

Drawback: the article is in Polish. But there's (plain) TeX code there which does more or less what you want (and a few more things).

-
Interesting, but due the language barrier I can't see how to apply the trapezoid (or wave-form) \parshape to an multicol environment. Is the .tex source available for that document? –  TeXter Jun 22 '12 at 13:19
I don't know, you would probably have to email the author. And I am afraid that using this together with multicol might be quite nontrivial - but this is only my speculation. I'd also speculate that actually what you want to achieve might be easier in ConTeXt MkIV - but I'm no expert at it, so you'd have to ask here or on the ConTeXt mailing list. –  mbork Jun 22 '12 at 14:25