4

I have a nasty paragraph with tables, long math and enums which I want to flow between two regions of my page. Here is an example of what I am trying to accomplish:

Disjoint text flow

I figured I could somehow do it with minipages, but I can't figure out how to associate the two.

2
  • I think \parshape can do this. But, it would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. – Peter Grill Nov 4 '14 at 22:06
  • Maybe it is overkill, but if you have more than two boxes, the package flowfram for certain will fulfil all your desires. Here, you will also be able to link the frames so that text in one column, will flow to the linked frame. I have never used it, so I cannot tell you how to set it up, but it has an extensive documentation with lot of example. – Sveinung Nov 4 '14 at 23:01
5

Here is an example of using parshape:

enter image description here

Code:

\documentclass{article}

\begin{document}
\parshape=13
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0pt \textwidth
\noindent
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. 
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer 
id, vulputate a, magna. 
Donec vehicula augue eu neque. 
Pellentesque habitant morbi tristique senectus et netus et malesuada 
fames ac turpis egestas.
\end{document}

In case you want boxes around the text, then I only know how to do that with tikz:

enter image description here

Notes:

  • With the \lipsum text I needed to add \sloppy to get TeX to line break within the confines of the \parshape. As you can see in the above version the second box has some text sticking out to the right.

Code:

\documentclass{article}

\usepackage{xparse}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\newcommand*{\TopTweak}{0.7\baselineskip}
\newcommand*{\BotTweak}{0.3\baselineskip}
\newcommand*{\RightTweak}{1pt}
\newcommand*{\LeftTweak}{1pt}
\newcommand*{\InnerSep}{3pt}
\NewDocumentCommand{\DrawBoxes}{%
   O{}% #1 = options for first box
   O{}% #2 = options for second box
   m %  #3 = top mark
   m %  #4 = total number of lines in parshape
   m %  #5 = number of lines in first box
   m %  #6 = offset of first section
   m %  #7 = width of first section
   m %  #8 = offset of second section
   m %  #9 = width of second section
}{%
    \begin{tikzpicture}[overlay, remember picture]
        \coordinate (First Box Top Left) at 
                ($(#3)+
                (-\LeftTweak,\TopTweak) + 
                (-\InnerSep,\InnerSep)$);
        \coordinate (First Box Bottom Right) at 
                ($(#3) +
                (\RightTweak,-\numexpr#5-1\relax*\baselineskip)+
                (#7,-\BotTweak)+
                (2*\InnerSep,-\InnerSep)$);
                
        \draw [#1] (First Box Top Left) rectangle (First Box Bottom Right);
        
        \coordinate (Second Box Top Left) at 
                ($(#3)+
                (#8,-\numexpr#5\relax*\baselineskip)+
                (-\LeftTweak,\TopTweak)+ 
                (-\InnerSep,\InnerSep)$);
        \coordinate (Second Box Bottom Right) at 
                ($(Second Box Top Left) + 
                (#9,0)+
                (2*\RightTweak,-\numexpr#4-#5-1\relax*\baselineskip)+
                (2*\InnerSep,-\InnerSep)$);
                
        \draw [#2] (Second Box Top Left) rectangle (Second Box Bottom Right);
    \end{tikzpicture}%
}


\begin{document}
\parshape=14
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0pt 0.4\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0.6\textwidth 0.35\textwidth
0pt \textwidth
\noindent\tikzmark{top mark}\sloppy%
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. 
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer 
id, vulputate a, magna. 
Donec vehicula augue eu neque. 
Pellentesque habitant morbi tristique senectus et netus et malesuada 
fames ac turpis egestas.
\DrawBoxes[draw=red, thick][draw=blue, thick]
    {top mark}{14}{6}
    {0pt}{0.4\textwidth}
    {0.6\textwidth}{0.35\textwidth}%
\end{document}
4

enter image description here

Not really pure latex markup but....

\documentclass{article}

\begin{document}

\setbox0\vbox{\hsize=3cm\raggedright
1 The quick brown fox jumps over the lazy dog.
2 The quick brown fox jumps over the lazy dog.
3 The quick brown fox jumps over the lazy dog.
4 The quick brown fox jumps over the lazy dog.
5 The quick brown fox jumps over the lazy dog.
6 The quick brown fox jumps over the lazy dog.
7 The quick brown fox jumps over the lazy dog.
8 The quick brown fox jumps over the lazy dog.
}

\setbox2\vsplit0 to 3cm

\fbox{\begin{picture}(250,300)


\put(10,200){\fbox{\box2}}

\put(120,30){\fbox{\box0}}


\end{picture}}

\end{document}
1

Here's a version using the output routine. It is just about as bare-bones as one can get, so it's missing some glues and proper \hsize handling et cetera. But the idea is there.

\catcode`\@=11
\newdimen\gutter
\def\pagebody{
  \setbox0\vsplit\@cclv to.5\vsize % split the box no. 255 half into box0
  \vbox to\vsize{
    \unvbox0 \vfil
    \kern-2\baselineskip % back up a little to display vertical overlap
    \moveright\dimexpr\hsize+\gutter\box\@cclv \vfil}}
\catcode`\@=12

\gutter=1cm
\hsize=\dimexpr.5\hsize-\gutter
\pdfpageheight=.3\pdfpageheight % just to keep it shorter
\vsize=.5\pdfpageheight % ditto

\input knuth \par\input knuth
\bye

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.