[Tex/LaTex] Span text across columns in multicol

memoirmulticoltwo-column

I am writing a long document with memoir class and multicol package, mostly writing in 2 columns. I am trying to insert a framed text that spans across the two columns, but does not break the flow of text inside the columns. I can end the multicol, insert my framed text, and re-enter the multicol, but it breaks the flow of the text — as in this answer.

Here is an image of what I am trying to achieve: enter image description here

The text flows from 1's to 4's. The text of A's in the middle does not break the 1-4 flow. Is it possible to do so with multicol?

Best Answer

Please always supply a test document.

This is easy if you are prepared to add some space manually in the second column.

enter image description here

The wide text is just placed naturally in the first column together with some negative space so that it overprints the second column. then you just need to add a \vspace to leave a gap.

\documentclass{article}

\usepackage{multicol}

\def\a{1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 }
\def\b{2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 }
\def\c{3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 }
\def\d{4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 }
\def\aa{\a\a\par 11 11 \a\a\a\a\par 11 11 11\a 11 11 1 1 \a\a}
\def\bb{\b\b\b\par 22 22 222 \b\b\b\b\b\par\b\b\b\b\b\b}
\def\cc{\c\c\c\c\c\c\par\c 3\c3\c3\c3\c3\c3}
\def\dd{\d\d\d\d\par\d444\d}

\begin{document}
\begin{multicols}{2}

\aa\a\aa\a

\smallskip
\noindent\fbox{\parbox{\dimexpr\textwidth-2\fboxsep\relax}{%
\def\A{A A A A\dotfill A A A A\dotfill}
\A\A\A\A\A\A\A\A\A\A\A\A\A\A}}\kern-\textwidth
\par\smallskip

\bb\b\bb\b

\cc

\vspace{1.8cm}

\c\cc

\dd\dd\dd\dd\dd\dd

\end{multicols}
\end{document}
Related Question