2

I have a small problem. I'm writing my PhD thesis (that's not the problem) and I want my images to be where I want them to be. I manage to do that using

\begin{figure}[H]
\end{figure}

but often the pictures goes on the next page. I really don't mind but the text is then spread out all over the page. I can fix the problem localy by adding \clearpage but I'm feeling using microsoft Word when I do so and of course when I add some text I have to change the position of the clearpage commands.

Do you know how to help me?

Thanks!

6
  • 3
    using H is a request to get unpleasant white space in your document it is an explicit instruction to disable the float mechanism which is there to avoid white spaces. Perhaps you want \raggedbottom rather that \flushbottom so the space comes at the end of the page, but not using H is usually better. Oct 15, 2014 at 9:46
  • Thanks a lot. '\raggedbottom' works very well. Do you have other solution than using H? To me, having the images where you want in a document is a minimum, no?
    – Fabien
    Oct 15, 2014 at 9:58
  • 2
    In traditional printing you would not get a choice: the whole reason for the convention of tables and figures to be separate captioned items is to allow the (human) typesetter to fit them in to a place that works with the page breaking. LaTeX is only a program not a person, so if you choose to argue with it you can always win, but choosing not to argue could be a possibility to consider, Oct 15, 2014 at 10:22
  • With the needspace package, you can request a vertain amount of vertical space in advance. If not available, it will clear the page. For example, try \documentclass{article} \usepackage{lipsum,needspace} \begin{document} \lipsum[1-4] \needspace{1.5in} \begin{figure}[ht] \centering \rule{1in}{1in} \caption{This is my caption} \end{figure} \lipsum[5-8] \end{document} Oct 15, 2014 at 11:31
  • 1
    Always "where you want" without wasting space is simply impossible, whatever you do. Best approach is "here if possible, less harmful place otherwise". This is possible with wise control of options and floats rules. See here about float algorithm parameters. However, IMHO figures between text disrupt the lecture more than using top/bottom/page positions, so use [H] sparingly, only if you want stop the lecture at this point even at the cost of worse page layouts.
    – Fran
    Oct 16, 2014 at 4:47

1 Answer 1

1

You can get rid of the floating environment and use the caption package:

\usepackage{caption}

and then

some text some text some text some text 
\noindent\begin{minipage}{\textwidth}
\captionsetup{type=figure}
\centering
\includegraphics{your-figure-here}
\caption{caption goes here}
\end{minipage}
other text other text other text other text 

Anyway, I second the comment of David Carlisle, and strongly recommend to use floats and let LaTeX do the page composition (possibly using only the [tb] placing options).

1
  • This is a well-known equivalent alternative to using a (non-) floating object with the Hspecifier; it doesn’t solve the spacing issue, though.
    – GuM
    Oct 13, 2017 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .