I have a two column layout on this document and I want my image to spread across the two columns, so I've done {figure*} but when I compile my document this image is inputted on to a completely separate page. I want it to be at the top of the page with its caption underneath it and then the main body text continuing on underneath the caption. I've tried [h!] and other commands but nothing is working. Any suggestions? Thank you for your help.
Asked
Active
Viewed 601 times
1 Answers
0
Try to use stfloats package:
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{stfloats}
\begin{document}
\begin{figure}[t]
\includegraphics[width=\linewidth]{example-image-duck}
\caption{May caption}
\end{figure}
\lipsum[1-4]
\end{document}
Is this what you looking for?
Zarko
- 296,517
-
It is what i'm looking for but when i input it into my document it still doesn't work. I get error messages to say don't use the stfloats package and that my document can't have two classes. It also messes up all of my other images in my document. Any other ideas? Sorry, I'm really new to latex! – Alana Nov 26 '22 at 22:13
-
1@Alana, that is why we usually ask for MWE (Minimal Working Example). We haven't any information about your document nor know, how you include proposed solution in your document. Please show us a small but complete document which reproduce your errors and contain my solution. – Zarko Nov 26 '22 at 22:32

\dbltopfraction) is .7 of the text length, and text (\textfraction) must be at least .2 of the page. Your figure may exceed those values. – barbara beeton Nov 26 '22 at 16:20tandpoptions. You may have to move the definition earlier in the document to wind up or the right page. This might change the caption number as well. – John Kormylo Nov 27 '22 at 18:06