I am using the multicol
package to make a 2 columns based document but I want in a place to have just fusion these two columns, and then go back to the 2 columns but I can't figure out how to achieve this.
2 Answers
Here's a generalized version of Tom Bombadil's \multicolinterrupt
macro: The current value of \col@number
is saved before ending the multicols
environment, and after typesetting the "interruption" text a new multicols
environment with the same number of columns as the last one is started.
\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{xcolor}
\newcounter{tempcolnum}
\makeatletter
\newcommand{\multicolinterrupt}[1]{% Stuff to span both rows
\setcounter{tempcolnum}{\col@number}
\end{multicols}
#1%
\begin{multicols}{\value{tempcolnum}}
}
\makeatother
\begin{document}
\begin{multicols}{3}
\lipsum[1-2]
\multicolinterrupt{\textcolor{blue}{\lipsum[3-4]}}
\lipsum[5-6]
\end{multicols}
\end{document}
-
Nice, I was wondering if the current column number was somehow accessible, but was, to be honest, too lazy to look it up :) Commented Jun 9, 2012 at 10:56
Probably like this?
\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{xcolor}
\newcommand{\multicolinterrupt}[1]{% Stuff to span both rows
\end{multicols}
#1
\begin{multicols}{2}
}
\begin{document}
\begin{multicols}{2}
\lipsum[1-2]
\multicolinterrupt{\textcolor{blue}{\lipsum[3-4]}}
\lipsum[5-6]
\end{multicols}
\end{document}