Everyone knows the problem, in Latex a figure or table takes the whole width of a page. Even though you can have several figures/tables next to each other (see posts on minipage and subfigure), with none of these techniques it is possible to have floating text around a figure or table.
Here is how you can do it nicely and easily:
You need to include the floating – figure package in your document:
as well as the graphics package if you want to use figures:
Code stub figure:
Similar to the usual figure environment, we first need to open a new floating-figure environment and can than include the image in the document.
Captions and labels can be used in the same way as in the figure environment.
Either of the optional arguments is used:
l: left-hand sided figure
r: right-hand sided figure
p: left for even, right for odd page numbers.
The width-argument indicates the space to be taken by the figure.
Tip: Instead of an absolute width value, make it relative by using a fraction of the textwidth or columnwidth. E.g.
Code stub table:
The main difference of the floating table to the floating figure environment is the second argument. Here we are not indicating the width, but passing the whole table as argument. This is probably necessary to determine the size of the table, which cannot be adjusted by the writer, but is determined by the table itself.
Hint: The only way to reduce the width taken by the table is to reduce the font size. E.g.
Check this post for an introduction to tables.