The wrapfig package provides this functionality.
documentclass{article} usepackage{wrapfig,lipsum,booktabs} %- begin{document} This is where the table goes with text wrapping around it. You may embed tabular environment inside wraptable environment and customize as you like. %- begin{wraptable}{r}{5.5cm} caption{A wrapped table going nicely inside the text.}label{wrap-tab:1} begin{tabular}{ccc}\toprule Header-1 & Header-1 & Header-1 \midrule 2 &3 & 5\ midrule 2 &3 & 5\ midrule 2 &3 & 5\ bottomrule end{tabular} end{wraptable} %- {lipsum[2] par Table~ref{wrap-tab:1} is a wrapped table. %- end{document}
Source: tex.stackexchange.com
Using wrapfig to span multiple columns ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wrapfig can’t automatically make matching cutouts in adjacent columns because it doesn’t know which text will land in just the right place in the column next-door. It certainly can’t handle floating in such situations!
Here are some methods for doing such layout “by hand”. They are practical for one or a few such figures where you can tweak the layout for the final copy. It is too painful to do this for long or frequently-revised documents. If you do have multiple fiddling, fix the first one in each chapter (or after any forced page break), rerun, then fix the second, etc.
(These examples use calc.sty to evaluate overhangs in place.)
Cutouts in Matching Columns
Read more: Beard profile
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
Initially, write the document without the wrapfigure, and locate the desired natural linebreak at “X”. (This first step is used for all methods described here.) Then change to
~~~~~~~~X begin{wrapfigure}[6]{r}[.5width+.5columnsep]{6cm} … end{wrapfigure} ~~~~….
and run LaTeX again. This will print the figure overlapping the right column, but no matter. Use this run to locate position “Y” in the text. For the final run, switch to:
~~~~~~~~X begin{wrapfigure}[6]{r}[.5width+.5columnsep]{6cm} … end{wrapfigure} ~~~~…. …~~~~~~~Y begin{wrapfigure}[6]{l}[.5width+.5columnsep]{6cm} vfill end{wrapfigure} ~~~~~~~~~~~
Taking a whole column plus a cutout
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
Locate “X” first, without any figure, as above, then write the document like:
~~~~~~~~X begin{wrapfigure}[6]{r}[columnwidth+columnsep]{9cm} … end{wrapfigure} ~~~~….
Read more: Fear method of carding
and ignore the overprinting of the right column. Then, after locating “Y” in the text, switch to:
~~~~~~~~X begin{wrapfigure}[6]{r}[columnwidth+columnsep]{9cm} … end{wrapfigure} ~~~~…. …~~~~~~~Yvspace{6baselinskip} ~~~~~~~~~~~ for the final layout
a whole column preceding a cutout
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
After locating “X”, write the draft document like:
~~~~~~~~Xvspace{6baselinskip} ~~~~…. ~~~~~~~~~~~~~ ~~~~~~~~~
run LaTeX to locate “Y”, and then switch to:
~~~~~~~~Xvspace{6baselinskip} ~~~~…. ~~~~~~~~~~~~~Y begin{wrapfigure}[6]{l}[columnwidth+columnsep]{9cm} … end{wrapfigure} ~~~~~~~~~
Spanning (parts of) three columns
Read more: Huge cat code generator
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~X ~~~~~~~~~~~~~~~~~Y ~~~~~~~~~~~~~~~~~Z ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
This uses a combination of the above. First locate X, then use
~~~~~~~~X begin{wrapfigure}[6]{r}[.5width+.5columnwidth+columnsep]{12cm} … end{wrapfigure} ~~~~….
Locate Y from this, and change to
~~~~~~~~X begin{wrapfigure}[6]{r}[.5width+.5columnwidth+columnsep]{12cm} … end{wrapfigure} ~~~~…. ~~~~~~~~~~~~Yvspace{6baselineskip} ~~~~~~~….
which allows you to locate Z, to end up with
~~~~~~~~X begin{wrapfigure}[6]{r}[.5width+.5columnwidth+columnsep]{12cm} … end{wrapfigure} ~~~~…. ~~~~~~~~~~~~Yvspace{6baselineskip} ~~~~~~~…. ~~~~~~~~~~~~Z begin{wrapfigure}[6]{l}[.5width+.5columnwidth+columnsep]{12cm} vfill end{wrapfigure}
(Of course, to do matching cut-outs properly requires typesetting the text to a grid.)
Source: CTAN.org, Wrapfig