0

using the memoir document class, and including graphics using \begin{figure}[!h].

For some reason, if the graphic shows up near the end of the chapter, something weird happens.

If there isn't enough space on the last page to include all text and the figure as well, then it'll put the graphic on a page all to itself, and put it in the middle of the page.

Now. I have no problem with it being all alone on a page. I just don't want it in the middle.

4
  • 1
    you should enable more freedom to tex at positioning of floats (figure, table) in text. try to use [htb].
    – Zarko
    Commented Feb 6, 2019 at 21:37
  • 1
    since you don't mind it being on a float page you should not suppress that possibility by using [h] then get a float page anyway as a fallback because ph] is not possible, use [htp] then see the link Kurt gave for top aligning float pages. Commented Feb 6, 2019 at 21:53
  • @DavidCarlisle \makeatletter \setlength{\@fptop}{0pt} \makeatother did not work. I was under the impression that it would just force the next float page to start at the beginning by adding zero space? Commented Feb 6, 2019 at 21:58
  • setting \@fptop will make float pages top aligned. I amd not sure what you mean by "it" in "it would force..." the main effect of [!h] is to prevent the float beong placed at the top of a page or a float page (so usually you et a warning from latex that it is changing it to [ht] but without an example impossible to debug. wher edid you set \@fptop? (in the document preamble is best) Commented Feb 6, 2019 at 23:08

1 Answer 1

0

For this, you'll need \usepackage{float} in your preamble.

Replace \begin{figure}[!h] with \begin{figure}[H] and the figure should move to the top of the page. H behaves similarly to !h, but making the switch fixed this issue for me.

2
  • 2
    with option [H] a float (image, table) image will not move anywhere :-(. it will be in text after point where it is inserted. consequently can happen that in case that in the page is not enough space for image (table), it will moved on the top of the next page but left empty space on the previous. this lead to very bad text formatting.
    – Zarko
    Commented Feb 6, 2019 at 21:49
  • Don't use the [H] option. See <tex.stackexchange.com/questions/469880> Commented Feb 7, 2019 at 19:10

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