[Tex/LaTex] How to put a figure in the page that spans whole page on a two column document

floatsgraphicstwo-column

I want to include a figure that spans the whole page of a twocolumn document. I've tried this link: How do I make a figure that spans a spread of two pages, but it results in the figure being onn the next page. I've also tried begin{figure*}[h], but the figure ends up being at the end of the document. I want the figure to be at the top of the page.

Best Answer

figure*-environments will always be placed at earliest on the next page. So you either need to move the code in your document. Or you can try the stfloats which will place the figure on the current page if it is defined in the first column.

\documentclass[twocolumn]{article}
\usepackage[showframe]{geometry}% http://ctan.org/pkg/geometry
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{stfloats}
\begin{document}
 \section{Start of document}
\lipsum[1-2]
\begin{figure*}
  \includegraphics[width=\textwidth,height=4cm]{example-image}
  \caption{This is a example.}
\end{figure*}
\lipsum[3-10]
\end{document}

enter image description here